@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.js
CHANGED
|
@@ -287,10 +287,15 @@ function getDepositSourceTier(chainName, tokenSymbol, priorityContext) {
|
|
|
287
287
|
if (sameAsset) return 2;
|
|
288
288
|
return 3;
|
|
289
289
|
}
|
|
290
|
+
function getDepositAuthorizationRank(status) {
|
|
291
|
+
return status == null || status === "ACTIVE" || status === "AUTHORIZED" ? 0 : 1;
|
|
292
|
+
}
|
|
290
293
|
function compareDepositSourcePriority(a, b) {
|
|
291
294
|
const aSufficient = a.transferAmount <= 0 || a.balance >= a.transferAmount;
|
|
292
295
|
const bSufficient = b.transferAmount <= 0 || b.balance >= b.transferAmount;
|
|
293
296
|
if (aSufficient !== bSufficient) return aSufficient ? -1 : 1;
|
|
297
|
+
const authDiff = getDepositAuthorizationRank(a.tokenStatus) - getDepositAuthorizationRank(b.tokenStatus);
|
|
298
|
+
if (authDiff !== 0) return authDiff;
|
|
294
299
|
const priorityContext = {
|
|
295
300
|
destinationChainName: a.destinationChainName ?? b.destinationChainName ?? null,
|
|
296
301
|
destinationTokenSymbol: a.destinationTokenSymbol ?? b.destinationTokenSymbol ?? null
|
|
@@ -329,6 +334,7 @@ function sourcePriorityInput(chainName, source, transferAmount, priorityContext)
|
|
|
329
334
|
tokenSymbol: source.token.symbol,
|
|
330
335
|
balance: source.balance.available.amount,
|
|
331
336
|
transferAmount,
|
|
337
|
+
tokenStatus: source.token.status,
|
|
332
338
|
destinationChainName: priorityContext?.destinationChainName ?? null,
|
|
333
339
|
destinationTokenSymbol: priorityContext?.destinationTokenSymbol ?? null
|
|
334
340
|
};
|
|
@@ -11198,6 +11204,7 @@ function selectedSourceForWallet(selectedWallet, selectedTokenSymbol, depositAmo
|
|
|
11198
11204
|
tokenSymbol: a.source.token.symbol,
|
|
11199
11205
|
balance: a.source.balance.available.amount,
|
|
11200
11206
|
transferAmount: depositAmount,
|
|
11207
|
+
tokenStatus: a.source.token.status,
|
|
11201
11208
|
destinationChainName: priorityContext?.destinationChainName ?? null,
|
|
11202
11209
|
destinationTokenSymbol: priorityContext?.destinationTokenSymbol ?? null
|
|
11203
11210
|
},
|
|
@@ -11206,6 +11213,7 @@ function selectedSourceForWallet(selectedWallet, selectedTokenSymbol, depositAmo
|
|
|
11206
11213
|
tokenSymbol: b.source.token.symbol,
|
|
11207
11214
|
balance: b.source.balance.available.amount,
|
|
11208
11215
|
transferAmount: depositAmount,
|
|
11216
|
+
tokenStatus: b.source.token.status,
|
|
11209
11217
|
destinationChainName: priorityContext?.destinationChainName ?? null,
|
|
11210
11218
|
destinationTokenSymbol: priorityContext?.destinationTokenSymbol ?? null
|
|
11211
11219
|
}
|