@suilend/sui-fe 0.2.85 → 0.2.86
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 +2 -1
- package/lib/keypair.js +3 -1
- package/package.json +1 -1
package/lib/keypair.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SuiClient, SuiTransactionBlockResponse } from "@mysten/sui/client";
|
|
2
|
+
import { SignatureWithBytes } from "@mysten/sui/cryptography";
|
|
2
3
|
import { Ed25519Keypair } from "@mysten/sui/keypairs/ed25519";
|
|
3
4
|
import { Transaction } from "@mysten/sui/transactions";
|
|
4
5
|
import { SuiSignPersonalMessageMethod, WalletAccount } from "@mysten/wallet-standard";
|
|
@@ -10,7 +11,7 @@ export declare const createKeypair: (account: WalletAccount, signPersonalMessage
|
|
|
10
11
|
privateKey: string;
|
|
11
12
|
}>;
|
|
12
13
|
export declare const checkIfKeypairCanBeUsed: (currentFlowDigests: string[], keypair: Ed25519Keypair, suiClient: SuiClient) => Promise<void>;
|
|
13
|
-
export declare const keypairSignExecuteAndWaitForTransaction: (transaction: Transaction, keypair: Ed25519Keypair, suiClient: SuiClient) => Promise<SuiTransactionBlockResponse>;
|
|
14
|
+
export declare const keypairSignExecuteAndWaitForTransaction: (transaction: Transaction, keypair: Ed25519Keypair, suiClient: SuiClient, onSign?: (signedTransaction: SignatureWithBytes) => void, onExecute?: (res: SuiTransactionBlockResponse) => void) => Promise<SuiTransactionBlockResponse>;
|
|
14
15
|
export type FundKeypairResult = {
|
|
15
16
|
res: SuiTransactionBlockResponse;
|
|
16
17
|
};
|
package/lib/keypair.js
CHANGED
|
@@ -74,18 +74,20 @@ const checkIfKeypairCanBeUsed = (currentFlowDigests, keypair, suiClient) => __aw
|
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
76
|
exports.checkIfKeypairCanBeUsed = checkIfKeypairCanBeUsed;
|
|
77
|
-
const keypairSignExecuteAndWaitForTransaction = (transaction, keypair, suiClient) => __awaiter(void 0, void 0, void 0, function* () {
|
|
77
|
+
const keypairSignExecuteAndWaitForTransaction = (transaction, keypair, suiClient, onSign, onExecute) => __awaiter(void 0, void 0, void 0, function* () {
|
|
78
78
|
var _a, _b;
|
|
79
79
|
// 1) Sign
|
|
80
80
|
const builtTransaction = yield transaction.build({
|
|
81
81
|
client: suiClient,
|
|
82
82
|
});
|
|
83
83
|
const signedTransaction = yield keypair.signTransaction(builtTransaction);
|
|
84
|
+
onSign === null || onSign === void 0 ? void 0 : onSign(signedTransaction);
|
|
84
85
|
// 2) Execute
|
|
85
86
|
const res1 = yield suiClient.executeTransactionBlock({
|
|
86
87
|
transactionBlock: signedTransaction.bytes,
|
|
87
88
|
signature: signedTransaction.signature,
|
|
88
89
|
});
|
|
90
|
+
onExecute === null || onExecute === void 0 ? void 0 : onExecute(res1);
|
|
89
91
|
// 3) Wait
|
|
90
92
|
const res2 = yield suiClient.waitForTransaction({
|
|
91
93
|
digest: res1.digest,
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@suilend/sui-fe","version":"0.2.
|
|
1
|
+
{"name":"@suilend/sui-fe","version":"0.2.86","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"}}
|