Skip to content

Commit 3429fa4

Browse files
committed
chore: adding stellar transaction types to flows
1 parent 45fa4ea commit 3429fa4

4 files changed

Lines changed: 18 additions & 1 deletion

File tree

queue-manager/rango-preset/src/helpers.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ export const setCurrentStepTx = (
213213
currentStep.tonTransaction = null;
214214
currentStep.suiTransaction = null;
215215
currentStep.xrplTransaction = null;
216+
currentStep.stellarTransaction = null;
216217

217218
const txType = transaction.type;
218219
switch (txType) {
@@ -255,6 +256,9 @@ export const setCurrentStepTx = (
255256
case TransactionType.XRPL:
256257
currentStep.xrplTransaction = transaction;
257258
break;
259+
case TransactionType.STELLAR:
260+
currentStep.stellarTransaction = transaction;
261+
break;
258262
default:
259263
((x: never) => {
260264
throw new Error(`${x} was unhandled!`);

queue-manager/rango-preset/src/shared.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ export const getCurrentNamespaceOf = (
119119
const tonNetwork = step.tonTransaction?.blockChain;
120120
const suiNetwork = step.suiTransaction?.blockChain;
121121
const xrplNetwork = step.xrplTransaction?.blockChain;
122+
const stellarNetwork = step.stellarTransaction?.blockChain;
122123

123124
if (evmNetwork) {
124125
return {
@@ -160,6 +161,11 @@ export const getCurrentNamespaceOf = (
160161
namespace: 'XRPL',
161162
network: xrplNetwork,
162163
};
164+
} else if (stellarNetwork) {
165+
return {
166+
namespace: 'Stellar',
167+
network: stellarNetwork,
168+
};
163169
} else if (!!step.transferTransaction) {
164170
const transferAddress = step.transferTransaction.fromWalletAddress;
165171
if (!transferAddress) {
@@ -239,6 +245,7 @@ export const getCurrentWalletTypeAndAddress = (
239245
swap.wallets[step.tonTransaction?.blockChain || ''] ||
240246
swap.wallets[step.suiTransaction?.blockChain || ''] ||
241247
swap.wallets[step.xrplTransaction?.blockChain || ''] ||
248+
swap.wallets[step.stellarTransaction?.blockChain || ''] ||
242249
(step.transferTransaction?.fromWalletAddress
243250
? {
244251
address: step.transferTransaction.fromWalletAddress,
@@ -472,6 +479,7 @@ export function calculatePendingSwap(params: {
472479
tonTransaction: null,
473480
suiTransaction: null,
474481
xrplTransaction: null,
482+
stellarTransaction: null,
475483

476484
// front fields
477485
hasAlreadyProceededToSign: false,

wallets/core/src/namespaces/common/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ type RangoNamespace =
1111
| 'Tron'
1212
| 'Ton'
1313
| 'Sui'
14-
| 'XRPL';
14+
| 'XRPL'
15+
| 'Stellar';
1516

1617
export type Namespace = RangoNamespace | (string & {});
1718

wallets/shared/src/rango.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ export const namespaces: Record<
145145
mainBlockchain: 'XRPL',
146146
title: 'XRPL',
147147
},
148+
Stellar: {
149+
mainBlockchain: 'Stellar',
150+
title: 'Stellar',
151+
},
148152
};
149153

150154
export type DerivationPath = {

0 commit comments

Comments
 (0)