@interest-protocol/vortex-sdk 6.2.0 → 7.0.0
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/dist/deposit-with-account.d.ts +1 -1
- package/dist/deposit-with-account.d.ts.map +1 -1
- package/dist/deposit.d.ts +1 -1
- package/dist/deposit.d.ts.map +1 -1
- package/dist/entities/utxo.d.ts +7 -0
- package/dist/entities/utxo.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +185 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +182 -37
- package/dist/index.mjs.map +1 -1
- package/dist/swap.d.ts +2 -2
- package/dist/swap.d.ts.map +1 -1
- package/dist/utils/decrypt.d.ts +8 -0
- package/dist/utils/decrypt.d.ts.map +1 -1
- package/dist/utils/deposit.d.ts +1 -2
- package/dist/utils/deposit.d.ts.map +1 -1
- package/dist/utils/withdraw.d.ts +1 -2
- package/dist/utils/withdraw.d.ts.map +1 -1
- package/dist/vortex-api.d.ts +15 -0
- package/dist/vortex-api.d.ts.map +1 -0
- package/dist/vortex-api.types.d.ts +114 -0
- package/dist/vortex-api.types.d.ts.map +1 -0
- package/dist/vortex.d.ts +1 -0
- package/dist/vortex.d.ts.map +1 -1
- package/dist/vortex.types.d.ts +4 -7
- package/dist/vortex.types.d.ts.map +1 -1
- package/dist/withdraw-with-account.d.ts +1 -1
- package/dist/withdraw-with-account.d.ts.map +1 -1
- package/dist/withdraw.d.ts +1 -1
- package/dist/withdraw.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/deposit-with-account.ts +0 -2
- package/src/deposit.ts +0 -2
- package/src/entities/utxo.ts +28 -8
- package/src/index.ts +2 -0
- package/src/swap.ts +0 -4
- package/src/utils/decrypt.ts +57 -1
- package/src/utils/deposit.ts +5 -6
- package/src/utils/withdraw.ts +4 -4
- package/src/vortex-api.ts +189 -0
- package/src/vortex-api.types.ts +137 -0
- package/src/vortex.ts +9 -9
- package/src/vortex.types.ts +3 -7
- package/src/withdraw-with-account.ts +0 -2
- package/src/withdraw.ts +10 -6
package/dist/swap.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Transaction } from '@mysten/sui/transactions';
|
|
2
2
|
import { StartSwapHelperArgs, FinishSwapHelperArgs } from './vortex.types';
|
|
3
|
-
export declare const startSwap: ({ tx, amount, vortexPool, unspentUtxos, vortexKeypair,
|
|
3
|
+
export declare const startSwap: ({ tx, amount, vortexPool, unspentUtxos, vortexKeypair, getMerklePathFn, relayer, minAmountOut, vortexSdk, coinOutType, }: StartSwapHelperArgs) => Promise<{
|
|
4
4
|
tx: Transaction;
|
|
5
5
|
receipt: {
|
|
6
6
|
$kind: "NestedResult";
|
|
@@ -11,7 +11,7 @@ export declare const startSwap: ({ tx, amount, vortexPool, unspentUtxos, vortexK
|
|
|
11
11
|
NestedResult: [number, number];
|
|
12
12
|
};
|
|
13
13
|
}>;
|
|
14
|
-
export declare const finishSwap: ({ tx, amount, vortexSdk, vortexPool, vortexKeypair,
|
|
14
|
+
export declare const finishSwap: ({ tx, amount, vortexSdk, vortexPool, vortexKeypair, getMerklePathFn, unspentUtxos, coinOut, receipt, coinInType, }: FinishSwapHelperArgs) => Promise<{
|
|
15
15
|
tx: Transaction;
|
|
16
16
|
}>;
|
|
17
17
|
//# sourceMappingURL=swap.d.ts.map
|
package/dist/swap.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../src/swap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAK3E,eAAO,MAAM,SAAS,GAAU,
|
|
1
|
+
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../src/swap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAK3E,eAAO,MAAM,SAAS,GAAU,0HAW7B,mBAAmB;;;;;;;;;;EA4BrB,CAAC;AAEF,eAAO,MAAM,UAAU,GAAU,oHAW9B,oBAAoB;;EA6BtB,CAAC"}
|
package/dist/utils/decrypt.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PaginatedEvents } from '@mysten/sui/client';
|
|
2
|
+
import { Commitment } from '../vortex-api.types';
|
|
2
3
|
import { VortexKeypair } from '../entities/keypair';
|
|
3
4
|
import { Utxo } from '../entities/utxo';
|
|
4
5
|
import { Vortex } from '../vortex';
|
|
@@ -10,5 +11,12 @@ interface GetUnspentUtxosArgs {
|
|
|
10
11
|
vortexPool: string | VortexPool;
|
|
11
12
|
}
|
|
12
13
|
export declare const getUnspentUtxos: ({ commitmentEvents, vortexKeypair, vortexSdk, vortexPool, }: GetUnspentUtxosArgs) => Promise<Utxo[]>;
|
|
14
|
+
interface GetUnspentUtxosWithApiArgs {
|
|
15
|
+
commitments: Commitment[];
|
|
16
|
+
vortexKeypair: VortexKeypair;
|
|
17
|
+
vortexSdk: Vortex;
|
|
18
|
+
vortexPool: string | VortexPool;
|
|
19
|
+
}
|
|
20
|
+
export declare const getUnspentUtxosWithApi: ({ commitments, vortexKeypair, vortexSdk, vortexPool, }: GetUnspentUtxosWithApiArgs) => Promise<Utxo[]>;
|
|
13
21
|
export {};
|
|
14
22
|
//# sourceMappingURL=decrypt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decrypt.d.ts","sourceRoot":"","sources":["../../src/utils/decrypt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"decrypt.d.ts","sourceRoot":"","sources":["../../src/utils/decrypt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,UAAU,mBAAmB;IAC3B,gBAAgB,EAAE,eAAe,CAAC;IAClC,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC;CACjC;AAED,eAAO,MAAM,eAAe,GAAU,6DAKnC,mBAAmB,oBAkCrB,CAAC;AAEF,UAAU,0BAA0B;IAClC,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC;CACjC;AAED,eAAO,MAAM,sBAAsB,GAAU,wDAK1C,0BAA0B,oBAwC5B,CAAC"}
|
package/dist/utils/deposit.d.ts
CHANGED
|
@@ -12,12 +12,11 @@ interface PrepareDepositProofArgs {
|
|
|
12
12
|
vortexSdk: Vortex;
|
|
13
13
|
vortexKeypair: VortexKeypairType;
|
|
14
14
|
vortexPool: string | VortexPool;
|
|
15
|
-
root: bigint;
|
|
16
15
|
getMerklePathFn: GetMerklePathFn;
|
|
17
16
|
relayer: string;
|
|
18
17
|
relayerFee: bigint;
|
|
19
18
|
}
|
|
20
|
-
export declare const prepareDepositProof: ({ tx, amount, accountSecret, unspentUtxos, vortexSdk, vortexKeypair, vortexPool,
|
|
19
|
+
export declare const prepareDepositProof: ({ tx, amount, accountSecret, unspentUtxos, vortexSdk, vortexKeypair, vortexPool, getMerklePathFn, relayer, relayerFee, }: PrepareDepositProofArgs) => Promise<{
|
|
21
20
|
extData: import("@mysten/sui/dist/cjs/transactions").TransactionResult;
|
|
22
21
|
tx: Transaction;
|
|
23
22
|
moveProof: import("@mysten/sui/dist/cjs/transactions").TransactionResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deposit.d.ts","sourceRoot":"","sources":["../../src/utils/deposit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAIvD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAGxC,OAAO,EAAiB,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"deposit.d.ts","sourceRoot":"","sources":["../../src/utils/deposit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAIvD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAGxC,OAAO,EAAiB,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEzE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,UAAU,uBAAuB;IAC/B,EAAE,EAAE,WAAW,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,IAAI,EAAE,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,iBAAiB,CAAC;IACjC,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC;IAChC,eAAe,EAAE,eAAe,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,mBAAmB,GAAU,0HAWvC,uBAAuB;;;;;;;;EA8HzB,CAAC"}
|
package/dist/utils/withdraw.d.ts
CHANGED
|
@@ -9,14 +9,13 @@ interface PrepareWithdrawArgs {
|
|
|
9
9
|
unspentUtxos: Utxo[];
|
|
10
10
|
vortexPool: string | VortexPool;
|
|
11
11
|
vortexKeypair: VortexKeypair;
|
|
12
|
-
root: bigint;
|
|
13
12
|
getMerklePathFn: GetMerklePathFn;
|
|
14
13
|
relayer: string;
|
|
15
14
|
relayerFee: bigint;
|
|
16
15
|
vortexSdk: Vortex;
|
|
17
16
|
accountSecret: bigint;
|
|
18
17
|
}
|
|
19
|
-
export declare const prepareWithdraw: ({ tx, amount, unspentUtxos, vortexPool, vortexKeypair,
|
|
18
|
+
export declare const prepareWithdraw: ({ tx, amount, unspentUtxos, vortexPool, vortexKeypair, getMerklePathFn, relayer, relayerFee, vortexSdk, accountSecret, }: PrepareWithdrawArgs) => Promise<{
|
|
20
19
|
tx: Transaction;
|
|
21
20
|
moveProof: import("@mysten/sui/dist/cjs/transactions").TransactionResult;
|
|
22
21
|
extData: import("@mysten/sui/dist/cjs/transactions").TransactionResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withdraw.d.ts","sourceRoot":"","sources":["../../src/utils/withdraw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AASpD,OAAO,EAAiB,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,UAAU,mBAAmB;IAC3B,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,IAAI,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B,
|
|
1
|
+
{"version":3,"file":"withdraw.d.ts","sourceRoot":"","sources":["../../src/utils/withdraw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AASpD,OAAO,EAAiB,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,UAAU,mBAAmB;IAC3B,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,IAAI,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B,eAAe,EAAE,eAAe,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,eAAe,GAAU,0HAWnC,mBAAmB;;;;;EAkIrB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VortexAPIConstructorArgs, HealthResponse, AccountsResponse, CreateAccountRequest, AccountResponse, PoolsResponse, GetPoolsArgs, CommitmentsResponse, GetCommitmentsArgs, MerklePathRequest, MerklePathResponse, ExecuteTransactionRequest, TransactionResponse, RelayerResponse } from './vortex-api.types';
|
|
2
|
+
export declare class VortexAPI {
|
|
3
|
+
#private;
|
|
4
|
+
constructor({ apiUrl }?: VortexAPIConstructorArgs);
|
|
5
|
+
health(): Promise<HealthResponse>;
|
|
6
|
+
getAccounts(hashedSecret: string): Promise<AccountsResponse>;
|
|
7
|
+
createAccount(args: CreateAccountRequest): Promise<AccountResponse>;
|
|
8
|
+
getPools(args?: GetPoolsArgs): Promise<PoolsResponse>;
|
|
9
|
+
getCommitments(args: GetCommitmentsArgs): Promise<CommitmentsResponse>;
|
|
10
|
+
getMerklePath(args: MerklePathRequest): Promise<MerklePathResponse>;
|
|
11
|
+
executeTransaction(args: ExecuteTransactionRequest): Promise<TransactionResponse>;
|
|
12
|
+
getRelayer(): Promise<RelayerResponse>;
|
|
13
|
+
}
|
|
14
|
+
export declare const vortexAPI: VortexAPI;
|
|
15
|
+
//# sourceMappingURL=vortex-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vortex-api.d.ts","sourceRoot":"","sources":["../src/vortex-api.ts"],"names":[],"mappings":"AACA,OAAO,EACL,wBAAwB,EAExB,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,yBAAyB,EACzB,mBAAmB,EACnB,eAAe,EAGhB,MAAM,oBAAoB,CAAC;AAE5B,qBAAa,SAAS;;gBAGR,EAAE,MAAuB,EAAE,GAAE,wBAA6B;IAIhE,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC;IAQjC,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAY5D,aAAa,CAAC,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC;IAWnE,QAAQ,CAAC,IAAI,GAAE,YAAiB,GAAG,OAAO,CAAC,aAAa,CAAC;IAyBzD,cAAc,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IA2BtE,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAkBnE,kBAAkB,CACtB,IAAI,EAAE,yBAAyB,GAC9B,OAAO,CAAC,mBAAmB,CAAC;IAazB,UAAU,IAAI,OAAO,CAAC,eAAe,CAAC;CA0C7C;AAED,eAAO,MAAM,SAAS,WAAkB,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { MerklePath } from './utils';
|
|
2
|
+
export declare const VORTEX_API_URL = "https://api.vortexfi.xyz";
|
|
3
|
+
export interface VortexAPIConstructorArgs {
|
|
4
|
+
apiUrl?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface HealthStatus {
|
|
7
|
+
mongodb: boolean;
|
|
8
|
+
redis: boolean;
|
|
9
|
+
sui: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface HealthResponse {
|
|
12
|
+
success: true;
|
|
13
|
+
data: HealthStatus;
|
|
14
|
+
}
|
|
15
|
+
export interface Account {
|
|
16
|
+
owner: string;
|
|
17
|
+
hashedSecret: string;
|
|
18
|
+
}
|
|
19
|
+
export interface AccountsResponse {
|
|
20
|
+
success: true;
|
|
21
|
+
data: Account[];
|
|
22
|
+
}
|
|
23
|
+
export interface CreateAccountRequest {
|
|
24
|
+
owner: string;
|
|
25
|
+
hashedSecret: string;
|
|
26
|
+
}
|
|
27
|
+
export interface AccountResponse {
|
|
28
|
+
success: true;
|
|
29
|
+
data: Account;
|
|
30
|
+
}
|
|
31
|
+
export interface Pool {
|
|
32
|
+
objectId: string;
|
|
33
|
+
coinType: string;
|
|
34
|
+
balance: string;
|
|
35
|
+
nextIndex: number;
|
|
36
|
+
}
|
|
37
|
+
export interface Pagination {
|
|
38
|
+
page: number;
|
|
39
|
+
limit: number;
|
|
40
|
+
total: number;
|
|
41
|
+
totalPages: number;
|
|
42
|
+
hasNext: boolean;
|
|
43
|
+
hasPrev: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface PoolsResponse {
|
|
46
|
+
success: true;
|
|
47
|
+
data: {
|
|
48
|
+
items: Pool[];
|
|
49
|
+
pagination: Pagination;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export interface GetPoolsArgs {
|
|
53
|
+
page?: number;
|
|
54
|
+
limit?: number;
|
|
55
|
+
coinType?: string;
|
|
56
|
+
}
|
|
57
|
+
export interface Commitment {
|
|
58
|
+
commitment: string;
|
|
59
|
+
index: number;
|
|
60
|
+
coinType: string;
|
|
61
|
+
encryptedOutput: string;
|
|
62
|
+
}
|
|
63
|
+
export interface CommitmentsResponse {
|
|
64
|
+
success: true;
|
|
65
|
+
data: {
|
|
66
|
+
items: Commitment[];
|
|
67
|
+
pagination: Pagination;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export type CommitmentsOperator = 'gt' | 'gte' | 'lt' | 'lte';
|
|
71
|
+
export interface GetCommitmentsArgs {
|
|
72
|
+
coinType: string;
|
|
73
|
+
index: number;
|
|
74
|
+
op?: CommitmentsOperator;
|
|
75
|
+
page?: number;
|
|
76
|
+
limit?: number;
|
|
77
|
+
}
|
|
78
|
+
export interface MerklePathRequest {
|
|
79
|
+
coinType: string;
|
|
80
|
+
index: number;
|
|
81
|
+
amount: string;
|
|
82
|
+
publicKey: string;
|
|
83
|
+
blinding: string;
|
|
84
|
+
vortexPool: string;
|
|
85
|
+
}
|
|
86
|
+
export interface MerklePathResponse {
|
|
87
|
+
success: true;
|
|
88
|
+
data: {
|
|
89
|
+
path: MerklePath;
|
|
90
|
+
root: string;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export interface ExecuteTransactionRequest {
|
|
94
|
+
txBytes: string;
|
|
95
|
+
}
|
|
96
|
+
export interface TransactionResponse {
|
|
97
|
+
success: true;
|
|
98
|
+
data: {
|
|
99
|
+
digest: string;
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
export interface Relayer {
|
|
103
|
+
address: string;
|
|
104
|
+
}
|
|
105
|
+
export interface RelayerResponse {
|
|
106
|
+
success: true;
|
|
107
|
+
data: Relayer;
|
|
108
|
+
}
|
|
109
|
+
export interface ErrorResponse {
|
|
110
|
+
success: false;
|
|
111
|
+
error: string;
|
|
112
|
+
}
|
|
113
|
+
export type ApiResponse<T> = T | ErrorResponse;
|
|
114
|
+
//# sourceMappingURL=vortex-api.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vortex-api.types.d.ts","sourceRoot":"","sources":["../src/vortex-api.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,eAAO,MAAM,cAAc,6BAA6B,CAAC;AAEzD,MAAM,WAAW,wBAAwB;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,GAAG,EAAE,OAAO,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,YAAY,CAAC;CACpB;AAED,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,OAAO,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,IAAI;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;C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AAC;CACH;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC"}
|
package/dist/vortex.d.ts
CHANGED
package/dist/vortex.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vortex.d.ts","sourceRoot":"","sources":["../src/vortex.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACL,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,cAAc,EAEd,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,sBAAsB,EACtB,OAAO,EACP,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,aAAa,EACb,cAAc,EACf,MAAM,gBAAgB,CAAC;AAexB,qBAAa,MAAM;;IAGjB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,gBAAgB,CAAC;gBAQf,EACV,QAAQ,EACR,SAAS,EACT,aAAa,EACb,WAAsC,GACvC,EAAE,eAAe;IAgBlB,UAAU,CAAC,EAAE,EAAsB,EAAE,YAAY,EAAE,EAAE,cAAc;;;;IASnE,UAAU,CAAC,EACT,EAAsB,EACtB,OAAO,EACP,QAAQ,EACR,KAAK,GACN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AAqB,CAAC,QAAQ,EAAE,MAAM;IAItC,sBAAsB,CAAC,QAAQ,EAAE,MAAM;IAIvC,wBAAwB;IAIxB,oBAAoB,CAAC,EAAE,EAAE,WAAW;;;;;IAQpC,kBAAkB,CAAC,EAAE,EAAE,WAAW;;;;;IAQ5B,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;CAG1E;AAED,eAAO,MAAM,SAAS,QAQpB,CAAC"}
|
package/dist/vortex.types.d.ts
CHANGED
|
@@ -13,7 +13,10 @@ interface NestedResult {
|
|
|
13
13
|
$kind: 'NestedResult';
|
|
14
14
|
NestedResult: [number, number];
|
|
15
15
|
}
|
|
16
|
-
export type GetMerklePathFn = (utxo: Utxo | null) => Promise<
|
|
16
|
+
export type GetMerklePathFn = (utxo: Utxo | null) => Promise<{
|
|
17
|
+
path: MerklePath;
|
|
18
|
+
root: bigint;
|
|
19
|
+
}>;
|
|
17
20
|
export interface RegisterArgs extends MaybeTx {
|
|
18
21
|
encryptionKey: string;
|
|
19
22
|
}
|
|
@@ -87,7 +90,6 @@ export interface DepositArgs extends MaybeTx {
|
|
|
87
90
|
vortexSdk: Vortex;
|
|
88
91
|
vortexPool: string | VortexPool;
|
|
89
92
|
vortexKeypair: VortexKeypair;
|
|
90
|
-
root: bigint;
|
|
91
93
|
getMerklePathFn: GetMerklePathFn;
|
|
92
94
|
unspentUtxos?: Utxo[];
|
|
93
95
|
relayer?: string;
|
|
@@ -97,7 +99,6 @@ export interface DepositWithAccountArgs extends MaybeTx {
|
|
|
97
99
|
vortexSdk: Vortex;
|
|
98
100
|
vortexPool: string | VortexPool;
|
|
99
101
|
vortexKeypair: VortexKeypair;
|
|
100
|
-
root: bigint;
|
|
101
102
|
getMerklePathFn: GetMerklePathFn;
|
|
102
103
|
unspentUtxos?: Utxo[];
|
|
103
104
|
account: string;
|
|
@@ -112,7 +113,6 @@ export interface WithdrawArgs extends MaybeTx {
|
|
|
112
113
|
unspentUtxos: Utxo[];
|
|
113
114
|
vortexSdk: Vortex;
|
|
114
115
|
vortexKeypair: VortexKeypair;
|
|
115
|
-
root: bigint;
|
|
116
116
|
getMerklePathFn: GetMerklePathFn;
|
|
117
117
|
relayer: string;
|
|
118
118
|
relayerFee: bigint;
|
|
@@ -121,7 +121,6 @@ export interface WithdrawWithAccountArgs extends MaybeTx {
|
|
|
121
121
|
vortexSdk: Vortex;
|
|
122
122
|
vortexPool: string | VortexPool;
|
|
123
123
|
vortexKeypair: VortexKeypair;
|
|
124
|
-
root: bigint;
|
|
125
124
|
getMerklePathFn: GetMerklePathFn;
|
|
126
125
|
unspentUtxos?: Utxo[];
|
|
127
126
|
account: string;
|
|
@@ -179,7 +178,6 @@ export interface StartSwapHelperArgs extends MaybeTx {
|
|
|
179
178
|
unspentUtxos: Utxo[];
|
|
180
179
|
vortexSdk: Vortex;
|
|
181
180
|
vortexKeypair: VortexKeypair;
|
|
182
|
-
root: bigint;
|
|
183
181
|
getMerklePathFn: GetMerklePathFn;
|
|
184
182
|
relayer: string;
|
|
185
183
|
minAmountOut: bigint;
|
|
@@ -190,7 +188,6 @@ export interface FinishSwapHelperArgs extends MaybeTx {
|
|
|
190
188
|
vortexSdk: Vortex;
|
|
191
189
|
vortexPool: string | VortexPool;
|
|
192
190
|
vortexKeypair: VortexKeypair;
|
|
193
|
-
root: bigint;
|
|
194
191
|
getMerklePathFn: GetMerklePathFn;
|
|
195
192
|
unspentUtxos?: Utxo[];
|
|
196
193
|
coinOut: TransactionResult;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vortex.types.d.ts","sourceRoot":"","sources":["../src/vortex.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,aAAa,EAA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IAClB,UAAU,EAAE,MAAM,GAAG,UAAU,CAAC;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B,eAAe,EAAE,eAAe,CAAC;IACjC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,iBAAiB,GAAG,YAAY,CAAC;IAC1C,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Transaction } from '@mysten/sui/transactions';
|
|
2
2
|
import { WithdrawWithAccountArgs } from './vortex.types';
|
|
3
|
-
export declare const withdrawWithAccount: ({ tx, unspentUtxos, vortexPool, vortexKeypair,
|
|
3
|
+
export declare const withdrawWithAccount: ({ tx, unspentUtxos, vortexPool, vortexKeypair, getMerklePathFn, relayer, relayerFee, vortexSdk, account, accountSecret, amount, }: WithdrawWithAccountArgs) => Promise<{
|
|
4
4
|
tx: Transaction;
|
|
5
5
|
coin: import("@mysten/sui/dist/cjs/transactions").TransactionResult;
|
|
6
6
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withdraw-with-account.d.ts","sourceRoot":"","sources":["../src/withdraw-with-account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAGzD,eAAO,MAAM,mBAAmB,GAAU,
|
|
1
|
+
{"version":3,"file":"withdraw-with-account.d.ts","sourceRoot":"","sources":["../src/withdraw-with-account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAGzD,eAAO,MAAM,mBAAmB,GAAU,mIAYvC,uBAAuB;;;EA2BzB,CAAC"}
|
package/dist/withdraw.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Transaction } from '@mysten/sui/transactions';
|
|
2
2
|
import { WithdrawArgs } from './vortex.types';
|
|
3
|
-
export declare const withdraw: ({ tx, amount, unspentUtxos, vortexPool, vortexKeypair,
|
|
3
|
+
export declare const withdraw: ({ tx, amount, unspentUtxos, vortexPool, vortexKeypair, getMerklePathFn, relayer, relayerFee, vortexSdk, }: WithdrawArgs) => Promise<{
|
|
4
4
|
tx: Transaction;
|
|
5
5
|
coin: import("@mysten/sui/dist/cjs/transactions").TransactionResult;
|
|
6
6
|
}>;
|
package/dist/withdraw.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withdraw.d.ts","sourceRoot":"","sources":["../src/withdraw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"withdraw.d.ts","sourceRoot":"","sources":["../src/withdraw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C,eAAO,MAAM,QAAQ,GAAU,2GAU5B,YAAY;;;EAiCd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interest-protocol/vortex-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"rimraf": "^6.0.1",
|
|
38
38
|
"ts-jest": "^29.1.1",
|
|
39
39
|
"tsup": "^8.3.5",
|
|
40
|
-
"@interest-protocol/
|
|
41
|
-
"@interest-protocol/
|
|
40
|
+
"@interest-protocol/typescript-config": "1.0.0",
|
|
41
|
+
"@interest-protocol/prettier-config": "1.0.0"
|
|
42
42
|
},
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public",
|
|
@@ -11,7 +11,6 @@ export const depositWithAccount = async ({
|
|
|
11
11
|
vortexSdk,
|
|
12
12
|
vortexKeypair,
|
|
13
13
|
vortexPool,
|
|
14
|
-
root,
|
|
15
14
|
getMerklePathFn,
|
|
16
15
|
accountSecret,
|
|
17
16
|
account,
|
|
@@ -48,7 +47,6 @@ export const depositWithAccount = async ({
|
|
|
48
47
|
vortexSdk,
|
|
49
48
|
vortexKeypair,
|
|
50
49
|
vortexPool,
|
|
51
|
-
root,
|
|
52
50
|
getMerklePathFn,
|
|
53
51
|
relayer,
|
|
54
52
|
relayerFee,
|
package/src/deposit.ts
CHANGED
|
@@ -12,7 +12,6 @@ export const deposit = async ({
|
|
|
12
12
|
vortexSdk,
|
|
13
13
|
vortexKeypair,
|
|
14
14
|
vortexPool,
|
|
15
|
-
root,
|
|
16
15
|
getMerklePathFn,
|
|
17
16
|
relayer = normalizeSuiAddress('0x0'),
|
|
18
17
|
relayerFee = 0n,
|
|
@@ -37,7 +36,6 @@ export const deposit = async ({
|
|
|
37
36
|
vortexSdk,
|
|
38
37
|
vortexKeypair,
|
|
39
38
|
vortexPool,
|
|
40
|
-
root,
|
|
41
39
|
getMerklePathFn,
|
|
42
40
|
relayer,
|
|
43
41
|
relayerFee,
|
package/src/entities/utxo.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { VortexKeypair } from './keypair';
|
|
2
2
|
import { poseidon3, poseidon4 } from '../crypto';
|
|
3
3
|
import { normalizeSuiAddress } from '@mysten/sui/utils';
|
|
4
|
+
|
|
4
5
|
interface UtxoConstructorArgs {
|
|
5
6
|
amount: bigint;
|
|
6
7
|
blinding?: bigint;
|
|
@@ -9,6 +10,13 @@ interface UtxoConstructorArgs {
|
|
|
9
10
|
vortexPool: string;
|
|
10
11
|
}
|
|
11
12
|
|
|
13
|
+
interface MakeCommitmentArgs {
|
|
14
|
+
amount: bigint;
|
|
15
|
+
publicKey: string;
|
|
16
|
+
blinding: bigint;
|
|
17
|
+
vortexPool: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
12
20
|
export class Utxo {
|
|
13
21
|
amount: bigint;
|
|
14
22
|
blinding: bigint;
|
|
@@ -30,19 +38,31 @@ export class Utxo {
|
|
|
30
38
|
this.vortexPool = vortexPool;
|
|
31
39
|
}
|
|
32
40
|
|
|
41
|
+
static makeCommitment({
|
|
42
|
+
amount,
|
|
43
|
+
publicKey,
|
|
44
|
+
blinding,
|
|
45
|
+
vortexPool,
|
|
46
|
+
}: MakeCommitmentArgs) {
|
|
47
|
+
return poseidon4(
|
|
48
|
+
amount,
|
|
49
|
+
BigInt(publicKey),
|
|
50
|
+
blinding,
|
|
51
|
+
BigInt(normalizeSuiAddress(vortexPool, !vortexPool.startsWith('0x')))
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
33
55
|
static blinding() {
|
|
34
56
|
return BigInt(Math.floor(Math.random() * 1_000_000_000));
|
|
35
57
|
}
|
|
36
58
|
|
|
37
59
|
commitment() {
|
|
38
|
-
return
|
|
39
|
-
this.amount,
|
|
40
|
-
|
|
41
|
-
this.blinding,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
)
|
|
45
|
-
);
|
|
60
|
+
return Utxo.makeCommitment({
|
|
61
|
+
amount: this.amount,
|
|
62
|
+
publicKey: this.keypair.publicKey,
|
|
63
|
+
blinding: this.blinding,
|
|
64
|
+
vortexPool: this.vortexPool,
|
|
65
|
+
});
|
|
46
66
|
}
|
|
47
67
|
|
|
48
68
|
nullifier() {
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from './constants';
|
|
2
2
|
export * from './vortex';
|
|
3
|
+
export * from './vortex-api';
|
|
3
4
|
export * from './entities';
|
|
4
5
|
export * from './vortex.types';
|
|
6
|
+
export * from './vortex-api.types';
|
|
5
7
|
export * from './crypto';
|
|
6
8
|
export * from './utils';
|
|
7
9
|
export * from './deposit';
|
package/src/swap.ts
CHANGED
|
@@ -11,7 +11,6 @@ export const startSwap = async ({
|
|
|
11
11
|
vortexPool,
|
|
12
12
|
unspentUtxos,
|
|
13
13
|
vortexKeypair,
|
|
14
|
-
root,
|
|
15
14
|
getMerklePathFn,
|
|
16
15
|
relayer,
|
|
17
16
|
minAmountOut,
|
|
@@ -29,7 +28,6 @@ export const startSwap = async ({
|
|
|
29
28
|
vortexPool,
|
|
30
29
|
unspentUtxos,
|
|
31
30
|
vortexKeypair,
|
|
32
|
-
root,
|
|
33
31
|
getMerklePathFn,
|
|
34
32
|
relayer,
|
|
35
33
|
relayerFee: 0n,
|
|
@@ -54,7 +52,6 @@ export const finishSwap = async ({
|
|
|
54
52
|
vortexSdk,
|
|
55
53
|
vortexPool,
|
|
56
54
|
vortexKeypair,
|
|
57
|
-
root,
|
|
58
55
|
getMerklePathFn,
|
|
59
56
|
unspentUtxos,
|
|
60
57
|
coinOut,
|
|
@@ -75,7 +72,6 @@ export const finishSwap = async ({
|
|
|
75
72
|
vortexSdk,
|
|
76
73
|
vortexKeypair,
|
|
77
74
|
vortexPool,
|
|
78
|
-
root,
|
|
79
75
|
getMerklePathFn,
|
|
80
76
|
relayer: normalizeSuiAddress('0x0'),
|
|
81
77
|
relayerFee: 0n,
|
package/src/utils/decrypt.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { PaginatedEvents } from '@mysten/sui/client';
|
|
2
2
|
import { parseNewCommitmentEvent } from './events';
|
|
3
|
+
import { Commitment } from '../vortex-api.types';
|
|
3
4
|
import { UtxoPayload } from '../entities/keypair';
|
|
4
5
|
import { VortexKeypair } from '../entities/keypair';
|
|
5
6
|
import { Utxo } from '../entities/utxo';
|
|
6
|
-
|
|
7
|
+
import { normalizeStructTag } from '@mysten/sui/utils';
|
|
7
8
|
import { Vortex } from '../vortex';
|
|
8
9
|
import { VortexPool } from '../vortex.types';
|
|
10
|
+
import invariant from 'tiny-invariant';
|
|
9
11
|
|
|
10
12
|
interface GetUnspentUtxosArgs {
|
|
11
13
|
commitmentEvents: PaginatedEvents;
|
|
@@ -54,3 +56,57 @@ export const getUnspentUtxos = async ({
|
|
|
54
56
|
|
|
55
57
|
return unspentUtxos;
|
|
56
58
|
};
|
|
59
|
+
|
|
60
|
+
interface GetUnspentUtxosWithApiArgs {
|
|
61
|
+
commitments: Commitment[];
|
|
62
|
+
vortexKeypair: VortexKeypair;
|
|
63
|
+
vortexSdk: Vortex;
|
|
64
|
+
vortexPool: string | VortexPool;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const getUnspentUtxosWithApi = async ({
|
|
68
|
+
commitments,
|
|
69
|
+
vortexKeypair,
|
|
70
|
+
vortexSdk,
|
|
71
|
+
vortexPool,
|
|
72
|
+
}: GetUnspentUtxosWithApiArgs) => {
|
|
73
|
+
const allUtxos = [] as UtxoPayload[];
|
|
74
|
+
|
|
75
|
+
const vortexObject = await vortexSdk.resolveVortexPool(vortexPool);
|
|
76
|
+
|
|
77
|
+
commitments.forEach((commitment) => {
|
|
78
|
+
invariant(
|
|
79
|
+
normalizeStructTag(commitment.coinType) ===
|
|
80
|
+
normalizeStructTag(vortexObject.coinType),
|
|
81
|
+
'Commitment coin type does not match vortex pool coin type'
|
|
82
|
+
);
|
|
83
|
+
try {
|
|
84
|
+
const utxo = vortexKeypair.decryptUtxo(commitment.encryptedOutput);
|
|
85
|
+
allUtxos.push(utxo);
|
|
86
|
+
} catch {
|
|
87
|
+
// Do nothing
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
const utxos = allUtxos.map(
|
|
92
|
+
(utxo) =>
|
|
93
|
+
new Utxo({
|
|
94
|
+
...utxo,
|
|
95
|
+
keypair: vortexKeypair,
|
|
96
|
+
vortexPool: vortexObject.objectId,
|
|
97
|
+
})
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
const nullifiers = utxos.map((utxo) => utxo.nullifier());
|
|
101
|
+
|
|
102
|
+
const isNullifierSpentArray = await vortexSdk.areNullifiersSpent({
|
|
103
|
+
nullifiers,
|
|
104
|
+
vortexPool,
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
const unspentUtxos = utxos.filter(
|
|
108
|
+
(_, index) => !isNullifierSpentArray[index]
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
return unspentUtxos;
|
|
112
|
+
};
|
package/src/utils/deposit.ts
CHANGED
|
@@ -3,10 +3,9 @@ import { prove, verify } from '.';
|
|
|
3
3
|
import invariant from 'tiny-invariant';
|
|
4
4
|
import { VortexKeypair } from '../entities/keypair';
|
|
5
5
|
import { Utxo } from '../entities/utxo';
|
|
6
|
-
import { fromHex
|
|
6
|
+
import { fromHex } from '@mysten/sui/utils';
|
|
7
7
|
import { toProveInput } from '.';
|
|
8
8
|
import { Proof, Action, GetMerklePathFn } from '../vortex.types';
|
|
9
|
-
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
10
9
|
import { Vortex } from '../vortex';
|
|
11
10
|
import { VortexKeypair as VortexKeypairType } from '../entities/keypair';
|
|
12
11
|
|
|
@@ -20,7 +19,6 @@ interface PrepareDepositProofArgs {
|
|
|
20
19
|
vortexSdk: Vortex;
|
|
21
20
|
vortexKeypair: VortexKeypairType;
|
|
22
21
|
vortexPool: string | VortexPool;
|
|
23
|
-
root: bigint;
|
|
24
22
|
getMerklePathFn: GetMerklePathFn;
|
|
25
23
|
relayer: string;
|
|
26
24
|
relayerFee: bigint;
|
|
@@ -34,7 +32,6 @@ export const prepareDepositProof = async ({
|
|
|
34
32
|
vortexSdk,
|
|
35
33
|
vortexKeypair,
|
|
36
34
|
vortexPool,
|
|
37
|
-
root,
|
|
38
35
|
getMerklePathFn,
|
|
39
36
|
relayer,
|
|
40
37
|
relayerFee,
|
|
@@ -105,13 +102,15 @@ export const prepareDepositProof = async ({
|
|
|
105
102
|
randomVortexKeypair.encryptionKey
|
|
106
103
|
);
|
|
107
104
|
|
|
105
|
+
const root = BigInt(merklePath0.root);
|
|
106
|
+
|
|
108
107
|
// Prepare circuit input
|
|
109
108
|
const input = toProveInput({
|
|
110
109
|
vortexObjectId,
|
|
111
110
|
accountSecret,
|
|
112
111
|
root,
|
|
113
|
-
merklePath0,
|
|
114
|
-
merklePath1,
|
|
112
|
+
merklePath0: merklePath0.path,
|
|
113
|
+
merklePath1: merklePath1.path,
|
|
115
114
|
publicAmount: amount - relayerFee,
|
|
116
115
|
nullifier0,
|
|
117
116
|
nullifier1,
|