@suilend/sui-fe 3.0.1 → 3.0.2
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 +1 -1
- package/lib/keypair.js +3 -3
- package/lib/transactions.d.ts +2 -2
- package/lib/transactions.js +3 -3
- package/package.json +1 -1
package/lib/keypair.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export declare const createKeypair: (signature: string) => Promise<{
|
|
|
36
36
|
address: string;
|
|
37
37
|
privateKey: string;
|
|
38
38
|
}>;
|
|
39
|
-
export declare const checkIfKeypairCanBeUsed: (lastSignedTransaction: SignatureWithBytes | undefined, currentFlowDigests: string[], keypair: Ed25519Keypair, suiGrpcClient: SuiGrpcClient,
|
|
39
|
+
export declare const checkIfKeypairCanBeUsed: (lastSignedTransaction: SignatureWithBytes | undefined, currentFlowDigests: string[], keypair: Ed25519Keypair, suiGrpcClient: SuiGrpcClient, suiGraphQLClient: SuiGraphQLClient) => Promise<{
|
|
40
40
|
lastCurrentFlowTransaction: GraphQLTransaction | undefined;
|
|
41
41
|
}>;
|
|
42
42
|
export type FundKeypairResult = {
|
package/lib/keypair.js
CHANGED
|
@@ -121,11 +121,11 @@ export const createKeypair = (signature) => __awaiter(void 0, void 0, void 0, fu
|
|
|
121
121
|
return { keypair, address, privateKey };
|
|
122
122
|
});
|
|
123
123
|
// CHECK IF KEYPAIR CAN BE USED
|
|
124
|
-
export const checkIfKeypairCanBeUsed = (lastSignedTransaction, currentFlowDigests, keypair, suiGrpcClient,
|
|
124
|
+
export const checkIfKeypairCanBeUsed = (lastSignedTransaction, currentFlowDigests, keypair, suiGrpcClient, suiGraphQLClient) => __awaiter(void 0, void 0, void 0, function* () {
|
|
125
125
|
var _a;
|
|
126
126
|
const [mostRecentFromAddressTransaction, mostRecentToAddressTransaction] = yield Promise.all([
|
|
127
|
-
getMostRecentAddressTransaction(
|
|
128
|
-
getMostRecentAddressTransaction(
|
|
127
|
+
getMostRecentAddressTransaction(suiGraphQLClient, keypair.toSuiAddress(), "from"),
|
|
128
|
+
getMostRecentAddressTransaction(suiGraphQLClient, keypair.toSuiAddress(), "to"),
|
|
129
129
|
]);
|
|
130
130
|
const mostRecentFromOrToAddressTransaction = [
|
|
131
131
|
mostRecentFromAddressTransaction,
|
package/lib/transactions.d.ts
CHANGED
|
@@ -23,8 +23,8 @@ export declare const getBalanceChange: (res: SuiClientTypes.Transaction<{
|
|
|
23
23
|
balanceChanges: true;
|
|
24
24
|
}>, address: string, token: Token, multiplier?: -1 | 1) => BigNumber | undefined;
|
|
25
25
|
export declare const getAllOwnedObjects: (suiGrpcClient: SuiGrpcClient, address: string, type?: string) => Promise<SuiClientTypes.Object<{
|
|
26
|
-
|
|
26
|
+
json: true;
|
|
27
27
|
}>[]>;
|
|
28
28
|
export declare const getAllCoins: (suiGrpcClient: SuiGrpcClient, address: string, coinType: string) => Promise<SuiClientTypes.Coin[]>;
|
|
29
|
-
export declare const getMostRecentAddressTransaction: (
|
|
29
|
+
export declare const getMostRecentAddressTransaction: (suiGraphQLClient: SuiGraphQLClient, address: string, direction: "from" | "to") => Promise<GraphQLTransaction | undefined>;
|
|
30
30
|
export declare const mergeAllCoins: (coinType: string, transaction: Transaction, allCoins: SuiClientTypes.Coin[]) => SuiClientTypes.Coin;
|
package/lib/transactions.js
CHANGED
|
@@ -37,7 +37,7 @@ export const getAllOwnedObjects = (suiGrpcClient, address, type) => __awaiter(vo
|
|
|
37
37
|
owner: address,
|
|
38
38
|
cursor,
|
|
39
39
|
type,
|
|
40
|
-
include: {
|
|
40
|
+
include: { json: true },
|
|
41
41
|
});
|
|
42
42
|
allObjs.push(...result.objects);
|
|
43
43
|
cursor = result.cursor;
|
|
@@ -78,12 +78,12 @@ const QUERY_TRANSACTIONS = `
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
`;
|
|
81
|
-
export const getMostRecentAddressTransaction = (
|
|
81
|
+
export const getMostRecentAddressTransaction = (suiGraphQLClient, address, direction) => __awaiter(void 0, void 0, void 0, function* () {
|
|
82
82
|
var _a, _b;
|
|
83
83
|
const filter = direction === "from"
|
|
84
84
|
? { sentAddress: address }
|
|
85
85
|
: { affectedAddress: address };
|
|
86
|
-
const result = yield
|
|
86
|
+
const result = yield suiGraphQLClient.query({
|
|
87
87
|
query: QUERY_TRANSACTIONS,
|
|
88
88
|
variables: {
|
|
89
89
|
filter,
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@suilend/sui-fe","version":"3.0.
|
|
1
|
+
{"name":"@suilend/sui-fe","version":"3.0.2","private":false,"description":"A collection of TypeScript frontend libraries","author":"Suilend","license":"MIT","main":"./index.js","exports":{".":"./index.js","./lib/constants":"./lib/constants.js","./lib/transactions":"./lib/transactions.js","./lib/format":"./lib/format.js","./lib/ledger":"./lib/ledger.js","./lib/coinMetadata":"./lib/coinMetadata.js","./lib":"./lib/index.js","./lib/indexedDB":"./lib/indexedDB.js","./lib/coinType":"./lib/coinType.js","./lib/coin":"./lib/coin.js","./lib/msafe":"./lib/msafe.js","./lib/keypair":"./lib/keypair.js","./lib/api":"./lib/api.js"},"types":"./index.js","scripts":{"build":"rm -rf ./dist && bun tsc","eslint":"eslint --fix src/","prettier":"prettier --write src/","lint":"bun eslint && bun prettier && bun tsc --noEmit","release":"bun run build && bun ./release.js && 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.20.0","bignumber.js":"^9.1.2","blake2b":"^2.1.4","lodash":"^4.17.21","p-limit":"3.1.0"},"devDependencies":{"@tsconfig/recommended":"^1.0.8","@types/blake2b":"^2.1.3","@types/lodash":"^4.17.13","@types/node":"^22.9.0","@typescript-eslint/eslint-plugin":"^8.14.0","@typescript-eslint/parser":"^8.14.0","eslint":"^9.14.0","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":"2.15.0"}}
|