@interest-protocol/vortex-sdk 5.0.0 → 6.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/__tests__/test-utils.d.ts +1 -0
- package/dist/__tests__/test-utils.d.ts.map +1 -1
- package/dist/constants.d.ts +6 -4
- package/dist/constants.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +99 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +95 -17
- package/dist/index.mjs.map +1 -1
- package/dist/swap.d.ts +17 -0
- package/dist/swap.d.ts.map +1 -0
- package/dist/utils/deposit.d.ts.map +1 -1
- package/dist/utils/withdraw.d.ts +4 -5
- package/dist/utils/withdraw.d.ts.map +1 -1
- package/dist/vortex.d.ts +18 -3
- package/dist/vortex.d.ts.map +1 -1
- package/dist/vortex.types.d.ts +45 -3
- 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/__tests__/test-utils.ts +4 -0
- package/src/constants.ts +12 -6
- package/src/index.ts +1 -0
- package/src/swap.ts +93 -0
- package/src/utils/deposit.ts +1 -4
- package/src/utils/withdraw.ts +2 -5
- package/src/vortex.ts +59 -2
- package/src/vortex.types.ts +50 -3
- package/src/withdraw-with-account.ts +0 -2
- package/src/withdraw.ts +0 -2
package/src/vortex.types.ts
CHANGED
|
@@ -11,6 +11,11 @@ export enum Action {
|
|
|
11
11
|
Withdraw,
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
interface NestedResult {
|
|
15
|
+
$kind: 'NestedResult';
|
|
16
|
+
NestedResult: [number, number];
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
export type GetMerklePathFn = (utxo: Utxo | null) => Promise<MerklePath>;
|
|
15
20
|
|
|
16
21
|
export interface RegisterArgs extends MaybeTx {
|
|
@@ -26,6 +31,7 @@ export interface ConstructorArgs {
|
|
|
26
31
|
registry: SharedObjectData;
|
|
27
32
|
fullNodeUrl?: string;
|
|
28
33
|
packageId: string;
|
|
34
|
+
swapPackageId: string;
|
|
29
35
|
}
|
|
30
36
|
|
|
31
37
|
export interface Proof {
|
|
@@ -38,7 +44,6 @@ export interface Proof {
|
|
|
38
44
|
}
|
|
39
45
|
|
|
40
46
|
export interface NewExtDataArgs extends MaybeTx {
|
|
41
|
-
recipient: string;
|
|
42
47
|
value: bigint;
|
|
43
48
|
relayer: string;
|
|
44
49
|
relayerFee: bigint;
|
|
@@ -126,7 +131,6 @@ export interface WithdrawArgs extends MaybeTx {
|
|
|
126
131
|
vortexKeypair: VortexKeypair;
|
|
127
132
|
root: bigint;
|
|
128
133
|
getMerklePathFn: GetMerklePathFn;
|
|
129
|
-
recipient: string;
|
|
130
134
|
relayer: string;
|
|
131
135
|
relayerFee: bigint;
|
|
132
136
|
}
|
|
@@ -140,7 +144,6 @@ export interface WithdrawWithAccountArgs extends MaybeTx {
|
|
|
140
144
|
unspentUtxos?: Utxo[];
|
|
141
145
|
account: string;
|
|
142
146
|
accountSecret: bigint;
|
|
143
|
-
recipient: string;
|
|
144
147
|
relayer: string;
|
|
145
148
|
relayerFee: bigint;
|
|
146
149
|
amount: bigint;
|
|
@@ -178,3 +181,47 @@ export interface MergeCoinsArgs extends MaybeTx {
|
|
|
178
181
|
coinType: string;
|
|
179
182
|
coins: Object[];
|
|
180
183
|
}
|
|
184
|
+
|
|
185
|
+
export interface StartSwapArgs extends MaybeTx {
|
|
186
|
+
vortex: string | VortexPool;
|
|
187
|
+
proof: TransactionResult;
|
|
188
|
+
extData: TransactionResult;
|
|
189
|
+
relayer: string;
|
|
190
|
+
minAmountOut: bigint;
|
|
191
|
+
coinOutType: string;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export interface FinishSwapArgs extends MaybeTx {
|
|
195
|
+
vortex: string | VortexPool;
|
|
196
|
+
coinOut: TransactionResult;
|
|
197
|
+
proof: TransactionResult;
|
|
198
|
+
extData: TransactionResult;
|
|
199
|
+
receipt: TransactionResult | NestedResult;
|
|
200
|
+
coinInType: string;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export interface StartSwapHelperArgs extends MaybeTx {
|
|
204
|
+
amount: bigint;
|
|
205
|
+
vortexPool: string | VortexPool;
|
|
206
|
+
unspentUtxos: Utxo[];
|
|
207
|
+
vortexSdk: Vortex;
|
|
208
|
+
vortexKeypair: VortexKeypair;
|
|
209
|
+
root: bigint;
|
|
210
|
+
getMerklePathFn: GetMerklePathFn;
|
|
211
|
+
relayer: string;
|
|
212
|
+
minAmountOut: bigint;
|
|
213
|
+
coinOutType: string;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export interface FinishSwapHelperArgs extends MaybeTx {
|
|
217
|
+
amount: bigint;
|
|
218
|
+
vortexSdk: Vortex;
|
|
219
|
+
vortexPool: string | VortexPool;
|
|
220
|
+
vortexKeypair: VortexKeypair;
|
|
221
|
+
root: bigint;
|
|
222
|
+
getMerklePathFn: GetMerklePathFn;
|
|
223
|
+
unspentUtxos?: Utxo[];
|
|
224
|
+
coinOut: TransactionResult;
|
|
225
|
+
receipt: TransactionResult | NestedResult;
|
|
226
|
+
coinInType: string;
|
|
227
|
+
}
|
|
@@ -9,7 +9,6 @@ export const withdrawWithAccount = async ({
|
|
|
9
9
|
vortexKeypair,
|
|
10
10
|
root,
|
|
11
11
|
getMerklePathFn,
|
|
12
|
-
recipient,
|
|
13
12
|
relayer,
|
|
14
13
|
relayerFee,
|
|
15
14
|
vortexSdk,
|
|
@@ -30,7 +29,6 @@ export const withdrawWithAccount = async ({
|
|
|
30
29
|
vortexKeypair,
|
|
31
30
|
root,
|
|
32
31
|
getMerklePathFn,
|
|
33
|
-
recipient,
|
|
34
32
|
relayer,
|
|
35
33
|
relayerFee,
|
|
36
34
|
vortexSdk,
|
package/src/withdraw.ts
CHANGED
|
@@ -10,7 +10,6 @@ export const withdraw = async ({
|
|
|
10
10
|
vortexKeypair,
|
|
11
11
|
root,
|
|
12
12
|
getMerklePathFn,
|
|
13
|
-
recipient,
|
|
14
13
|
relayer,
|
|
15
14
|
relayerFee,
|
|
16
15
|
vortexSdk,
|
|
@@ -28,7 +27,6 @@ export const withdraw = async ({
|
|
|
28
27
|
vortexKeypair,
|
|
29
28
|
root,
|
|
30
29
|
getMerklePathFn,
|
|
31
|
-
recipient,
|
|
32
30
|
relayer,
|
|
33
31
|
relayerFee,
|
|
34
32
|
vortexSdk,
|