@suilend/sui-fe 0.3.19 → 0.3.21
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/lib/coinType.js +3 -2
- package/lib/keypair.js +8 -4
- package/package.json +1 -1
package/lib/coinType.js
CHANGED
|
@@ -138,11 +138,12 @@ exports.NORMALIZED_MEMECOIN_COINTYPES = [
|
|
|
138
138
|
exports.NORMALIZED_LOFI_COINTYPE, // NOT LISTED
|
|
139
139
|
];
|
|
140
140
|
exports.NON_SPONSORED_PYTH_PRICE_FEED_COINTYPES = [
|
|
141
|
-
exports.
|
|
142
|
-
exports.NORMALIZED_NS_COINTYPE,
|
|
141
|
+
exports.NORMALIZED_FUD_COINTYPE,
|
|
143
142
|
exports.NORMALIZED_WAL_COINTYPE,
|
|
143
|
+
exports.NORMALIZED_HAEDAL_COINTYPE,
|
|
144
144
|
exports.NORMALIZED_UP_COINTYPE, // TODO
|
|
145
145
|
exports.NORMALIZED_KOBAN_COINTYPE, // TODO
|
|
146
|
+
exports.NORMALIZED_IKA_COINTYPE,
|
|
146
147
|
exports.NORMALIZED_LOFI_COINTYPE, // NOT LISTED
|
|
147
148
|
];
|
|
148
149
|
exports.TEMPORARY_PYTH_PRICE_FEED_COINTYPES = [
|
package/lib/keypair.js
CHANGED
|
@@ -183,17 +183,21 @@ const checkIfKeypairCanBeUsed = (lastSignedTransaction, currentFlowDigests, keyp
|
|
|
183
183
|
exports.checkIfKeypairCanBeUsed = checkIfKeypairCanBeUsed;
|
|
184
184
|
const fundKeypair = (tokens, address, keypair, suiClient, signExecuteAndWaitForTransaction, // From WalletContext
|
|
185
185
|
onSign, onExecute) => __awaiter(void 0, void 0, void 0, function* () {
|
|
186
|
+
const filteredTokens = tokens.filter((t) => t.amount.gt(0));
|
|
186
187
|
console.log("[fundKeypair] tokens:", tokens.map((t) => ({
|
|
187
188
|
coinType: t.coinType,
|
|
188
189
|
amount: t.amount.toString(),
|
|
190
|
+
})), "filteredTokens:", filteredTokens.map((t) => ({
|
|
191
|
+
coinType: t.coinType,
|
|
192
|
+
amount: t.amount.toString(),
|
|
189
193
|
})));
|
|
190
|
-
const allCoins = yield Promise.all(
|
|
194
|
+
const allCoins = yield Promise.all(filteredTokens.map((token) => (0, transactions_2.getAllCoins)(suiClient, address, token.coinType)));
|
|
191
195
|
const transaction = new transactions_1.Transaction();
|
|
192
196
|
transaction.setSender(address);
|
|
193
|
-
const mergeCoins =
|
|
197
|
+
const mergeCoins = filteredTokens.map((token, index) => (0, transactions_2.mergeAllCoins)(token.coinType, transaction, allCoins[index]));
|
|
194
198
|
const coins = [];
|
|
195
|
-
for (let i = 0; i <
|
|
196
|
-
const token =
|
|
199
|
+
for (let i = 0; i < filteredTokens.length; i++) {
|
|
200
|
+
const token = filteredTokens[i];
|
|
197
201
|
const [coin] = transaction.splitCoins((0, coinType_1.isSui)(token.coinType)
|
|
198
202
|
? transaction.gas
|
|
199
203
|
: transaction.object(mergeCoins[i].coinObjectId), [
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@suilend/sui-fe","version":"0.3.
|
|
1
|
+
{"name":"@suilend/sui-fe","version":"0.3.21","private":false,"description":"A collection of TypeScript frontend libraries","author":"Suilend","license":"MIT","main":"./index.js","exports":{".":"./index.js","./lib/api":"./lib/api.js","./lib/coin":"./lib/coin.js","./lib/coinMetadata":"./lib/coinMetadata.js","./lib/coinType":"./lib/coinType.js","./lib/constants":"./lib/constants.js","./lib/format":"./lib/format.js","./lib":"./lib/index.js","./lib/indexedDB":"./lib/indexedDB.js","./lib/keypair":"./lib/keypair.js","./lib/ledger":"./lib/ledger.js","./lib/msafe":"./lib/msafe.js","./lib/track":"./lib/track.js","./lib/transactions":"./lib/transactions.js"},"types":"./index.js","scripts":{"build":"rm -rf ./dist && bun tsc","eslint":"eslint --fix \"./src/**/*.ts\"","prettier":"prettier --write \"./src/**/*\"","lint":"bun eslint && bun prettier && bun tsc --noEmit","release":"bun run build && bun ts-node ./release.ts && cd ./dist && npm publish --access public"},"repository":{"type":"git","url":"git+https://github.com/suilend/sui-fe.git"},"bugs":{"url":"https://github.com/suilend/sui-fe/issues"},"dependencies":{"@mysten/wallet-standard":"0.14.7","bignumber.js":"^9.1.2","blake2b":"^2.1.4","lodash":"^4.17.21","mixpanel-browser":"^2.56.0","next":"^15.0.3","p-limit":"3.1.0"},"devDependencies":{"@tsconfig/recommended":"^1.0.8","@types/blake2b":"^2.1.3","@types/lodash":"^4.17.13","@types/mixpanel-browser":"^2.50.2","@types/node":"^22.9.0","@typescript-eslint/eslint-plugin":"^8.14.0","@typescript-eslint/parser":"^8.14.0","eslint":"^9.14.0","eslint-config-next":"^15.0.3","eslint-config-prettier":"^9.1.0","eslint-plugin-import":"^2.31.0","eslint-plugin-prettier":"^5.2.1","prettier":"^3.3.3","ts-node":"^10.9.2","typescript":"^5.6.3"},"peerDependencies":{"@mysten/sui":"1.28.2","date-fns":"^4.1.0"}}
|