@suilend/sui-fe 0.2.93 → 0.2.95

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.d.ts CHANGED
@@ -22,10 +22,11 @@ export declare const fundKeypair: (tokens: (Token & {
22
22
  amount: BigNumber;
23
23
  })[], keypair: Ed25519Keypair, signExecuteAndWaitForTransaction: (transaction: Transaction, options?: {
24
24
  auction?: boolean;
25
- }) => Promise<SuiTransactionBlockResponse>) => Promise<{
25
+ }, onSign?: (signedTransaction: SignatureWithBytes) => void, onExecute?: (res: SuiTransactionBlockResponse) => void) => Promise<SuiTransactionBlockResponse>, // From WalletContext
26
+ onSign?: (signedTransaction: SignatureWithBytes) => void, onExecute?: (res: SuiTransactionBlockResponse) => void) => Promise<{
26
27
  res: SuiTransactionBlockResponse;
27
28
  }>;
28
29
  export type ReturnAllOwnedObjectsAndSuiToUserResult = {
29
30
  res: SuiTransactionBlockResponse;
30
31
  };
31
- export declare const returnAllOwnedObjectsAndSuiToUser: (address: string, keypair: Ed25519Keypair, suiClient: SuiClient) => Promise<ReturnAllOwnedObjectsAndSuiToUserResult>;
32
+ export declare const returnAllOwnedObjectsAndSuiToUser: (address: string, keypair: Ed25519Keypair, suiClient: SuiClient, onSign?: (signedTransaction: SignatureWithBytes) => void, onExecute?: (res: SuiTransactionBlockResponse) => void) => Promise<ReturnAllOwnedObjectsAndSuiToUserResult>;
package/lib/keypair.js CHANGED
@@ -116,7 +116,8 @@ const keypairSignExecuteAndWaitForTransaction = (transaction, keypair, suiClient
116
116
  return res2;
117
117
  });
118
118
  exports.keypairSignExecuteAndWaitForTransaction = keypairSignExecuteAndWaitForTransaction;
119
- const fundKeypair = (tokens, keypair, signExecuteAndWaitForTransaction) => __awaiter(void 0, void 0, void 0, function* () {
119
+ const fundKeypair = (tokens, keypair, signExecuteAndWaitForTransaction, // From WalletContext
120
+ onSign, onExecute) => __awaiter(void 0, void 0, void 0, function* () {
120
121
  console.log("[fundKeypair] tokens:", tokens.map((t) => ({
121
122
  coinType: t.coinType,
122
123
  amount: t.amount.toString(),
@@ -131,11 +132,11 @@ const fundKeypair = (tokens, keypair, signExecuteAndWaitForTransaction) => __awa
131
132
  useGasCoin: (0, coinType_1.isSui)(token.coinType),
132
133
  })(fundKeypairTransaction));
133
134
  fundKeypairTransaction.transferObjects(coinsWithBalance, keypair.toSuiAddress());
134
- const res = yield signExecuteAndWaitForTransaction(fundKeypairTransaction);
135
+ const res = yield signExecuteAndWaitForTransaction(fundKeypairTransaction, undefined, onSign, onExecute);
135
136
  return { res };
136
137
  });
137
138
  exports.fundKeypair = fundKeypair;
138
- const returnAllOwnedObjectsAndSuiToUser = (address, keypair, suiClient) => __awaiter(void 0, void 0, void 0, function* () {
139
+ const returnAllOwnedObjectsAndSuiToUser = (address, keypair, suiClient, onSign, onExecute) => __awaiter(void 0, void 0, void 0, function* () {
139
140
  console.log(`[returnAllOwnedObjectsAndSuiToUser] address: ${address}`);
140
141
  const transaction = new transactions_1.Transaction();
141
142
  transaction.setSender(keypair.toSuiAddress());
@@ -144,7 +145,7 @@ const returnAllOwnedObjectsAndSuiToUser = (address, keypair, suiClient) => __awa
144
145
  .filter((obj) => { var _a; return ((_a = obj.data) === null || _a === void 0 ? void 0 : _a.content).type !== "0x2::coin::Coin<0x2::sui::SUI>"; })
145
146
  .map((obj) => { var _a; return (_a = obj.data) === null || _a === void 0 ? void 0 : _a.objectId; }); // Assumed to be <512 objects
146
147
  transaction.transferObjects(ownedObjectIds, address);
147
- const res = yield (0, exports.keypairSignExecuteAndWaitForTransaction)(transaction, keypair, suiClient);
148
+ const res = yield (0, exports.keypairSignExecuteAndWaitForTransaction)(transaction, keypair, suiClient, onSign, onExecute);
148
149
  return { res };
149
150
  });
150
151
  exports.returnAllOwnedObjectsAndSuiToUser = returnAllOwnedObjectsAndSuiToUser;
@@ -86,7 +86,7 @@ const getMostRecentFromAddressTransaction = (suiClient, address) => __awaiter(vo
86
86
  limit: 1,
87
87
  order: "descending",
88
88
  options: {
89
- showEvents: true,
89
+ showInput: true,
90
90
  },
91
91
  });
92
92
  allTransactions.push(...transactions.data);
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@suilend/sui-fe","version":"0.2.93","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.2.95","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"}}