@suilend/sui-fe 0.3.5 → 0.3.7

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/keypair.js CHANGED
@@ -209,7 +209,9 @@ const returnAllOwnedObjectsAndSuiToUser = (address, keypair, suiClient, onSign,
209
209
  const ownedObjectIds = (yield (0, transactions_2.getAllOwnedObjects)(suiClient, keypair.toSuiAddress()))
210
210
  .filter((obj) => { var _a; return ((_a = obj.data) === null || _a === void 0 ? void 0 : _a.content).type !== "0x2::coin::Coin<0x2::sui::SUI>"; })
211
211
  .map((obj) => { var _a; return (_a = obj.data) === null || _a === void 0 ? void 0 : _a.objectId; }); // Assumed to be <512 objects
212
- transaction.transferObjects(ownedObjectIds, address);
212
+ console.log(`[returnAllOwnedObjectsAndSuiToUser] ownedObjectIds: ${ownedObjectIds}`);
213
+ if (ownedObjectIds.length > 0)
214
+ transaction.transferObjects(ownedObjectIds, address);
213
215
  const res = yield (0, exports.keypairSignExecuteAndWaitForTransaction)(transaction, keypair, suiClient, onSign, onExecute);
214
216
  return { res };
215
217
  });
@@ -76,25 +76,14 @@ const getAllCoins = (suiClient, address, coinType) => __awaiter(void 0, void 0,
76
76
  });
77
77
  exports.getAllCoins = getAllCoins;
78
78
  const getMostRecentAddressTransaction = (suiClient, address, direction) => __awaiter(void 0, void 0, void 0, function* () {
79
- const allTransactions = [];
80
- let cursor = null;
81
- let hasNextPage = true;
82
- while (hasNextPage) {
83
- const transactions = yield suiClient.queryTransactionBlocks({
84
- filter: direction === "from"
85
- ? { FromAddress: address }
86
- : { ToAddress: address },
87
- cursor,
88
- limit: 1,
89
- order: "descending",
90
- options: {
91
- showInput: true,
92
- },
93
- });
94
- allTransactions.push(...transactions.data);
95
- cursor = transactions.nextCursor;
96
- hasNextPage = transactions.hasNextPage;
97
- }
98
- return allTransactions[0];
79
+ const transactions = yield suiClient.queryTransactionBlocks({
80
+ filter: direction === "from" ? { FromAddress: address } : { ToAddress: address },
81
+ limit: 1,
82
+ order: "descending",
83
+ options: {
84
+ showInput: true,
85
+ },
86
+ });
87
+ return transactions.data[0];
99
88
  });
100
89
  exports.getMostRecentAddressTransaction = getMostRecentAddressTransaction;
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@suilend/sui-fe","version":"0.3.5","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/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","@pythnetwork/pyth-sui-js":"^2.1.0","bignumber.js":"^9.1.2","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/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"}}
1
+ {"name":"@suilend/sui-fe","version":"0.3.7","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/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","@pythnetwork/pyth-sui-js":"^2.1.0","bignumber.js":"^9.1.2","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/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"}}