@swype-org/react-sdk 0.2.170 → 0.2.171
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +8 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -290,10 +290,15 @@ function getDepositSourceTier(chainName, tokenSymbol, priorityContext) {
|
|
|
290
290
|
if (sameAsset) return 2;
|
|
291
291
|
return 3;
|
|
292
292
|
}
|
|
293
|
+
function getDepositAuthorizationRank(status) {
|
|
294
|
+
return status == null || status === "ACTIVE" || status === "AUTHORIZED" ? 0 : 1;
|
|
295
|
+
}
|
|
293
296
|
function compareDepositSourcePriority(a, b) {
|
|
294
297
|
const aSufficient = a.transferAmount <= 0 || a.balance >= a.transferAmount;
|
|
295
298
|
const bSufficient = b.transferAmount <= 0 || b.balance >= b.transferAmount;
|
|
296
299
|
if (aSufficient !== bSufficient) return aSufficient ? -1 : 1;
|
|
300
|
+
const authDiff = getDepositAuthorizationRank(a.tokenStatus) - getDepositAuthorizationRank(b.tokenStatus);
|
|
301
|
+
if (authDiff !== 0) return authDiff;
|
|
297
302
|
const priorityContext = {
|
|
298
303
|
destinationChainName: a.destinationChainName ?? b.destinationChainName ?? null,
|
|
299
304
|
destinationTokenSymbol: a.destinationTokenSymbol ?? b.destinationTokenSymbol ?? null
|
|
@@ -332,6 +337,7 @@ function sourcePriorityInput(chainName, source, transferAmount, priorityContext)
|
|
|
332
337
|
tokenSymbol: source.token.symbol,
|
|
333
338
|
balance: source.balance.available.amount,
|
|
334
339
|
transferAmount,
|
|
340
|
+
tokenStatus: source.token.status,
|
|
335
341
|
destinationChainName: priorityContext?.destinationChainName ?? null,
|
|
336
342
|
destinationTokenSymbol: priorityContext?.destinationTokenSymbol ?? null
|
|
337
343
|
};
|
|
@@ -11201,6 +11207,7 @@ function selectedSourceForWallet(selectedWallet, selectedTokenSymbol, depositAmo
|
|
|
11201
11207
|
tokenSymbol: a.source.token.symbol,
|
|
11202
11208
|
balance: a.source.balance.available.amount,
|
|
11203
11209
|
transferAmount: depositAmount,
|
|
11210
|
+
tokenStatus: a.source.token.status,
|
|
11204
11211
|
destinationChainName: priorityContext?.destinationChainName ?? null,
|
|
11205
11212
|
destinationTokenSymbol: priorityContext?.destinationTokenSymbol ?? null
|
|
11206
11213
|
},
|
|
@@ -11209,6 +11216,7 @@ function selectedSourceForWallet(selectedWallet, selectedTokenSymbol, depositAmo
|
|
|
11209
11216
|
tokenSymbol: b.source.token.symbol,
|
|
11210
11217
|
balance: b.source.balance.available.amount,
|
|
11211
11218
|
transferAmount: depositAmount,
|
|
11219
|
+
tokenStatus: b.source.token.status,
|
|
11212
11220
|
destinationChainName: priorityContext?.destinationChainName ?? null,
|
|
11213
11221
|
destinationTokenSymbol: priorityContext?.destinationTokenSymbol ?? null
|
|
11214
11222
|
}
|