@typemove/aptos 1.2.9 → 1.3.0-rc.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/dist/cjs/account-resource-client.d.ts +8 -15
- package/dist/cjs/account-resource-client.d.ts.map +1 -1
- package/dist/cjs/account-resource-client.js +17 -10
- package/dist/cjs/account-resource-client.js.map +1 -1
- package/dist/cjs/account-resource-client.test.js.map +1 -1
- package/dist/cjs/aptos-chain-adapter.d.ts +3 -4
- package/dist/cjs/aptos-chain-adapter.d.ts.map +1 -1
- package/dist/cjs/aptos-chain-adapter.js +7 -2
- package/dist/cjs/aptos-chain-adapter.js.map +1 -1
- package/dist/cjs/builtin/0x1.d.ts +1039 -961
- package/dist/cjs/builtin/0x1.d.ts.map +1 -1
- package/dist/cjs/builtin/0x1.js +2675 -1458
- package/dist/cjs/builtin/0x1.js.map +1 -1
- package/dist/cjs/builtin/0x3.d.ts +126 -83
- package/dist/cjs/builtin/0x3.d.ts.map +1 -1
- package/dist/cjs/builtin/0x3.js +203 -117
- package/dist/cjs/builtin/0x3.js.map +1 -1
- package/dist/cjs/builtin/0x4.d.ts +139 -135
- package/dist/cjs/builtin/0x4.d.ts.map +1 -1
- package/dist/cjs/builtin/0x4.js +365 -210
- package/dist/cjs/builtin/0x4.js.map +1 -1
- package/dist/cjs/client.test.js.map +1 -1
- package/dist/cjs/codegen/codegen.d.ts +1 -1
- package/dist/cjs/codegen/codegen.d.ts.map +1 -1
- package/dist/cjs/codegen/codegen.js +29 -23
- package/dist/cjs/codegen/codegen.js.map +1 -1
- package/dist/cjs/codegen/types.test.js.map +1 -1
- package/dist/cjs/models.d.ts +2 -2
- package/dist/cjs/models.d.ts.map +1 -1
- package/dist/cjs/move-coder.d.ts +4 -5
- package/dist/cjs/move-coder.d.ts.map +1 -1
- package/dist/cjs/move-coder.js +6 -3
- package/dist/cjs/move-coder.js.map +1 -1
- package/dist/cjs/move-types.d.ts +1 -11
- package/dist/cjs/move-types.d.ts.map +1 -1
- package/dist/cjs/move-types.js +11 -0
- package/dist/cjs/move-types.js.map +1 -1
- package/dist/cjs/to-internal.d.ts +1 -1
- package/dist/cjs/to-internal.d.ts.map +1 -1
- package/dist/cjs/to-internal.js +8 -8
- package/dist/cjs/to-internal.js.map +1 -1
- package/dist/esm/account-resource-client.d.ts +8 -15
- package/dist/esm/account-resource-client.d.ts.map +1 -1
- package/dist/esm/account-resource-client.js +17 -10
- package/dist/esm/account-resource-client.js.map +1 -1
- package/dist/esm/account-resource-client.test.js.map +1 -1
- package/dist/esm/aptos-chain-adapter.d.ts +3 -4
- package/dist/esm/aptos-chain-adapter.d.ts.map +1 -1
- package/dist/esm/aptos-chain-adapter.js +7 -2
- package/dist/esm/aptos-chain-adapter.js.map +1 -1
- package/dist/esm/builtin/0x1.d.ts +1039 -961
- package/dist/esm/builtin/0x1.d.ts.map +1 -1
- package/dist/esm/builtin/0x1.js +2675 -1458
- package/dist/esm/builtin/0x1.js.map +1 -1
- package/dist/esm/builtin/0x3.d.ts +126 -83
- package/dist/esm/builtin/0x3.d.ts.map +1 -1
- package/dist/esm/builtin/0x3.js +203 -117
- package/dist/esm/builtin/0x3.js.map +1 -1
- package/dist/esm/builtin/0x4.d.ts +139 -135
- package/dist/esm/builtin/0x4.d.ts.map +1 -1
- package/dist/esm/builtin/0x4.js +365 -210
- package/dist/esm/builtin/0x4.js.map +1 -1
- package/dist/esm/client.test.js.map +1 -1
- package/dist/esm/codegen/codegen.d.ts +1 -1
- package/dist/esm/codegen/codegen.d.ts.map +1 -1
- package/dist/esm/codegen/codegen.js +29 -23
- package/dist/esm/codegen/codegen.js.map +1 -1
- package/dist/esm/codegen/run.js +5 -5
- package/dist/esm/codegen/run.js.map +1 -1
- package/dist/esm/codegen/types.test.js.map +1 -1
- package/dist/esm/models.d.ts +2 -2
- package/dist/esm/models.d.ts.map +1 -1
- package/dist/esm/move-coder.d.ts +4 -5
- package/dist/esm/move-coder.d.ts.map +1 -1
- package/dist/esm/move-coder.js +6 -3
- package/dist/esm/move-coder.js.map +1 -1
- package/dist/esm/move-types.d.ts +1 -11
- package/dist/esm/move-types.d.ts.map +1 -1
- package/dist/esm/move-types.js +11 -0
- package/dist/esm/move-types.js.map +1 -1
- package/dist/esm/to-internal.d.ts +1 -1
- package/dist/esm/to-internal.d.ts.map +1 -1
- package/dist/esm/to-internal.js +9 -9
- package/dist/esm/to-internal.js.map +1 -1
- package/package.json +3 -3
- package/src/abis/0x1.json +193 -4
- package/src/abis/0x4.json +20 -1
- package/src/account-resource-client.ts +30 -19
- package/src/aptos-chain-adapter.ts +10 -6
- package/src/builtin/0x1.ts +3994 -3160
- package/src/builtin/0x3.ts +337 -263
- package/src/builtin/0x4.ts +529 -437
- package/src/codegen/codegen.ts +29 -26
- package/src/codegen/run.ts +5 -5
- package/src/models.ts +7 -12
- package/src/move-coder.ts +18 -9
- package/src/move-types.ts +13 -12
- package/src/tests/types/0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af.ts +829 -684
- package/src/tests/types/0x4dcae85fc5559071906cd5c76b7420fcbb4b0a92f00ab40ffc394aadbbff5ee9.ts +8 -9
- package/src/tests/types/0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541.ts +803 -687
- package/src/to-internal.ts +15 -10
package/src/tests/types/0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af.ts
CHANGED
|
@@ -9,16 +9,15 @@ import { MoveCoder, TypedEventInstance } from "@typemove/aptos";
|
|
|
9
9
|
|
|
10
10
|
import { defaultMoveCoder } from "@typemove/aptos";
|
|
11
11
|
|
|
12
|
-
import { Address } from "@typemove/aptos";
|
|
13
|
-
|
|
14
12
|
import {
|
|
15
|
-
|
|
16
|
-
AptosAccount,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
Aptos,
|
|
14
|
+
Account as AptosAccount,
|
|
15
|
+
MoveAddressType,
|
|
16
|
+
PendingTransactionResponse,
|
|
17
|
+
InputGenerateTransactionOptions,
|
|
18
|
+
MoveStructId,
|
|
19
|
+
InputViewRequestData,
|
|
20
|
+
} from "@aptos-labs/ts-sdk";
|
|
22
21
|
|
|
23
22
|
import { _0x1 } from "@typemove/aptos/builtin";
|
|
24
23
|
import * as _0x4dcae85fc5559071906cd5c76b7420fcbb4b0a92f00ab40ffc394aadbbff5ee9 from "./0x4dcae85fc5559071906cd5c76b7420fcbb4b0a92f00ab40ffc394aadbbff5ee9.js";
|
|
@@ -27,20 +26,23 @@ export namespace fees {
|
|
|
27
26
|
export namespace entry {}
|
|
28
27
|
export namespace view {
|
|
29
28
|
export async function balance<T0 = any>(
|
|
30
|
-
client:
|
|
29
|
+
client: Aptos,
|
|
31
30
|
request: {
|
|
32
|
-
|
|
31
|
+
typeArguments: [MoveStructId];
|
|
33
32
|
},
|
|
34
33
|
version?: bigint,
|
|
35
34
|
): Promise<[bigint]> {
|
|
36
|
-
const coder = defaultMoveCoder(client.
|
|
37
|
-
const data = {
|
|
38
|
-
type_arguments: request.type_arguments,
|
|
39
|
-
arguments: [],
|
|
35
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
36
|
+
const data: InputViewRequestData = {
|
|
40
37
|
function:
|
|
41
38
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::fees::balance",
|
|
39
|
+
functionArguments: [],
|
|
40
|
+
typeArguments: request.typeArguments,
|
|
42
41
|
};
|
|
43
|
-
const res = await client.view(
|
|
42
|
+
const res = await client.view({
|
|
43
|
+
payload: data,
|
|
44
|
+
options: { ledgerVersion: version },
|
|
45
|
+
});
|
|
44
46
|
const type = await coder.getMoveFunction(
|
|
45
47
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::fees::balance",
|
|
46
48
|
);
|
|
@@ -52,26 +54,29 @@ export namespace fees {
|
|
|
52
54
|
export namespace init {
|
|
53
55
|
export namespace entry {
|
|
54
56
|
export async function initialize(
|
|
55
|
-
client:
|
|
57
|
+
client: Aptos,
|
|
56
58
|
account: AptosAccount,
|
|
57
59
|
request: {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
typeArguments: [];
|
|
61
|
+
functionArguments: [];
|
|
60
62
|
},
|
|
61
|
-
|
|
62
|
-
): Promise<
|
|
63
|
-
const coder = defaultMoveCoder(client.
|
|
64
|
-
const
|
|
65
|
-
sender: account.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return await client.
|
|
63
|
+
options?: InputGenerateTransactionOptions,
|
|
64
|
+
): Promise<PendingTransactionResponse> {
|
|
65
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
66
|
+
const transaction = await client.build.simple({
|
|
67
|
+
sender: account.accountAddress,
|
|
68
|
+
data: {
|
|
69
|
+
function:
|
|
70
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::init::initialize",
|
|
71
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
72
|
+
typeArguments: [],
|
|
73
|
+
},
|
|
74
|
+
options,
|
|
75
|
+
});
|
|
76
|
+
return await client.signAndSubmitTransaction({
|
|
77
|
+
signer: account,
|
|
78
|
+
transaction,
|
|
79
|
+
});
|
|
75
80
|
}
|
|
76
81
|
}
|
|
77
82
|
export namespace view {}
|
|
@@ -97,26 +102,29 @@ export namespace package_ {
|
|
|
97
102
|
|
|
98
103
|
export namespace entry {
|
|
99
104
|
export async function publishPackage(
|
|
100
|
-
client:
|
|
105
|
+
client: Aptos,
|
|
101
106
|
account: AptosAccount,
|
|
102
107
|
request: {
|
|
103
|
-
|
|
104
|
-
|
|
108
|
+
typeArguments: [];
|
|
109
|
+
functionArguments: [string, string[]];
|
|
105
110
|
},
|
|
106
|
-
|
|
107
|
-
): Promise<
|
|
108
|
-
const coder = defaultMoveCoder(client.
|
|
109
|
-
const
|
|
110
|
-
sender: account.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return await client.
|
|
111
|
+
options?: InputGenerateTransactionOptions,
|
|
112
|
+
): Promise<PendingTransactionResponse> {
|
|
113
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
114
|
+
const transaction = await client.build.simple({
|
|
115
|
+
sender: account.accountAddress,
|
|
116
|
+
data: {
|
|
117
|
+
function:
|
|
118
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::package::publish_package",
|
|
119
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
120
|
+
typeArguments: [],
|
|
121
|
+
},
|
|
122
|
+
options,
|
|
123
|
+
});
|
|
124
|
+
return await client.signAndSubmitTransaction({
|
|
125
|
+
signer: account,
|
|
126
|
+
transaction,
|
|
127
|
+
});
|
|
120
128
|
}
|
|
121
129
|
}
|
|
122
130
|
export namespace view {}
|
|
@@ -181,62 +189,71 @@ export namespace base_pool {
|
|
|
181
189
|
|
|
182
190
|
export namespace entry {
|
|
183
191
|
export async function setSwapFeeProtocolAllocationBps(
|
|
184
|
-
client:
|
|
192
|
+
client: Aptos,
|
|
185
193
|
account: AptosAccount,
|
|
186
194
|
request: {
|
|
187
|
-
|
|
188
|
-
|
|
195
|
+
typeArguments: [];
|
|
196
|
+
functionArguments: [bigint];
|
|
189
197
|
},
|
|
190
|
-
|
|
191
|
-
): Promise<
|
|
192
|
-
const coder = defaultMoveCoder(client.
|
|
193
|
-
const
|
|
194
|
-
sender: account.
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
return await client.
|
|
198
|
+
options?: InputGenerateTransactionOptions,
|
|
199
|
+
): Promise<PendingTransactionResponse> {
|
|
200
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
201
|
+
const transaction = await client.build.simple({
|
|
202
|
+
sender: account.accountAddress,
|
|
203
|
+
data: {
|
|
204
|
+
function:
|
|
205
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::base_pool::set_swap_fee_protocol_allocation_bps",
|
|
206
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
207
|
+
typeArguments: [],
|
|
208
|
+
},
|
|
209
|
+
options,
|
|
210
|
+
});
|
|
211
|
+
return await client.signAndSubmitTransaction({
|
|
212
|
+
signer: account,
|
|
213
|
+
transaction,
|
|
214
|
+
});
|
|
204
215
|
}
|
|
205
216
|
}
|
|
206
217
|
export namespace view {
|
|
207
218
|
export async function maxSupportedDecimals(
|
|
208
|
-
client:
|
|
219
|
+
client: Aptos,
|
|
209
220
|
|
|
210
221
|
version?: bigint,
|
|
211
222
|
): Promise<[number]> {
|
|
212
|
-
const coder = defaultMoveCoder(client.
|
|
213
|
-
const data = {
|
|
214
|
-
type_arguments: [],
|
|
215
|
-
arguments: [],
|
|
223
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
224
|
+
const data: InputViewRequestData = {
|
|
216
225
|
function:
|
|
217
226
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::base_pool::max_supported_decimals",
|
|
227
|
+
functionArguments: [],
|
|
228
|
+
typeArguments: [],
|
|
218
229
|
};
|
|
219
|
-
const res = await client.view(
|
|
230
|
+
const res = await client.view({
|
|
231
|
+
payload: data,
|
|
232
|
+
options: { ledgerVersion: version },
|
|
233
|
+
});
|
|
220
234
|
const type = await coder.getMoveFunction(
|
|
221
235
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::base_pool::max_supported_decimals",
|
|
222
236
|
);
|
|
223
237
|
return (await coder.decodeArray(res, type.return)) as any;
|
|
224
238
|
}
|
|
225
239
|
export async function poolTokenSupply<T0 = any>(
|
|
226
|
-
client:
|
|
240
|
+
client: Aptos,
|
|
227
241
|
request: {
|
|
228
|
-
|
|
242
|
+
typeArguments: [MoveStructId];
|
|
229
243
|
},
|
|
230
244
|
version?: bigint,
|
|
231
245
|
): Promise<[bigint]> {
|
|
232
|
-
const coder = defaultMoveCoder(client.
|
|
233
|
-
const data = {
|
|
234
|
-
type_arguments: request.type_arguments,
|
|
235
|
-
arguments: [],
|
|
246
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
247
|
+
const data: InputViewRequestData = {
|
|
236
248
|
function:
|
|
237
249
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::base_pool::pool_token_supply",
|
|
250
|
+
functionArguments: [],
|
|
251
|
+
typeArguments: request.typeArguments,
|
|
238
252
|
};
|
|
239
|
-
const res = await client.view(
|
|
253
|
+
const res = await client.view({
|
|
254
|
+
payload: data,
|
|
255
|
+
options: { ledgerVersion: version },
|
|
256
|
+
});
|
|
240
257
|
const type = await coder.getMoveFunction(
|
|
241
258
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::base_pool::pool_token_supply",
|
|
242
259
|
);
|
|
@@ -244,7 +261,7 @@ export namespace base_pool {
|
|
|
244
261
|
}
|
|
245
262
|
|
|
246
263
|
export async function swapFeeProtocolAllocationRatio(
|
|
247
|
-
client:
|
|
264
|
+
client: Aptos,
|
|
248
265
|
|
|
249
266
|
version?: bigint,
|
|
250
267
|
): Promise<
|
|
@@ -252,14 +269,17 @@ export namespace base_pool {
|
|
|
252
269
|
_0x4dcae85fc5559071906cd5c76b7420fcbb4b0a92f00ab40ffc394aadbbff5ee9.fixed_point64.FixedPoint64,
|
|
253
270
|
]
|
|
254
271
|
> {
|
|
255
|
-
const coder = defaultMoveCoder(client.
|
|
256
|
-
const data = {
|
|
257
|
-
type_arguments: [],
|
|
258
|
-
arguments: [],
|
|
272
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
273
|
+
const data: InputViewRequestData = {
|
|
259
274
|
function:
|
|
260
275
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::base_pool::swap_fee_protocol_allocation_ratio",
|
|
276
|
+
functionArguments: [],
|
|
277
|
+
typeArguments: [],
|
|
261
278
|
};
|
|
262
|
-
const res = await client.view(
|
|
279
|
+
const res = await client.view({
|
|
280
|
+
payload: data,
|
|
281
|
+
options: { ledgerVersion: version },
|
|
282
|
+
});
|
|
263
283
|
const type = await coder.getMoveFunction(
|
|
264
284
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::base_pool::swap_fee_protocol_allocation_ratio",
|
|
265
285
|
);
|
|
@@ -460,7 +480,7 @@ export namespace stable_pool {
|
|
|
460
480
|
}
|
|
461
481
|
|
|
462
482
|
export interface StablePoolCreationEvent<T0, T1, T2, T3> {
|
|
463
|
-
creator:
|
|
483
|
+
creator: MoveAddressType;
|
|
464
484
|
amount_0: bigint;
|
|
465
485
|
amount_1: bigint;
|
|
466
486
|
amount_2: bigint;
|
|
@@ -672,48 +692,54 @@ export namespace stable_pool {
|
|
|
672
692
|
|
|
673
693
|
export namespace entry {
|
|
674
694
|
export async function setAmpFactor<T0 = any, T1 = any, T2 = any, T3 = any>(
|
|
675
|
-
client:
|
|
695
|
+
client: Aptos,
|
|
676
696
|
account: AptosAccount,
|
|
677
697
|
request: {
|
|
678
|
-
|
|
679
|
-
|
|
698
|
+
typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
|
|
699
|
+
functionArguments: [bigint];
|
|
680
700
|
},
|
|
681
|
-
|
|
682
|
-
): Promise<
|
|
683
|
-
const coder = defaultMoveCoder(client.
|
|
684
|
-
const
|
|
685
|
-
sender: account.
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
return await client.
|
|
701
|
+
options?: InputGenerateTransactionOptions,
|
|
702
|
+
): Promise<PendingTransactionResponse> {
|
|
703
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
704
|
+
const transaction = await client.build.simple({
|
|
705
|
+
sender: account.accountAddress,
|
|
706
|
+
data: {
|
|
707
|
+
function:
|
|
708
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::set_amp_factor",
|
|
709
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
710
|
+
typeArguments: request.typeArguments,
|
|
711
|
+
},
|
|
712
|
+
options,
|
|
713
|
+
});
|
|
714
|
+
return await client.signAndSubmitTransaction({
|
|
715
|
+
signer: account,
|
|
716
|
+
transaction,
|
|
717
|
+
});
|
|
695
718
|
}
|
|
696
719
|
export async function setDefaultPoolSwapFeeBps(
|
|
697
|
-
client:
|
|
720
|
+
client: Aptos,
|
|
698
721
|
account: AptosAccount,
|
|
699
722
|
request: {
|
|
700
|
-
|
|
701
|
-
|
|
723
|
+
typeArguments: [];
|
|
724
|
+
functionArguments: [bigint];
|
|
702
725
|
},
|
|
703
|
-
|
|
704
|
-
): Promise<
|
|
705
|
-
const coder = defaultMoveCoder(client.
|
|
706
|
-
const
|
|
707
|
-
sender: account.
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
return await client.
|
|
726
|
+
options?: InputGenerateTransactionOptions,
|
|
727
|
+
): Promise<PendingTransactionResponse> {
|
|
728
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
729
|
+
const transaction = await client.build.simple({
|
|
730
|
+
sender: account.accountAddress,
|
|
731
|
+
data: {
|
|
732
|
+
function:
|
|
733
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::set_default_pool_swap_fee_bps",
|
|
734
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
735
|
+
typeArguments: [],
|
|
736
|
+
},
|
|
737
|
+
options,
|
|
738
|
+
});
|
|
739
|
+
return await client.signAndSubmitTransaction({
|
|
740
|
+
signer: account,
|
|
741
|
+
transaction,
|
|
742
|
+
});
|
|
717
743
|
}
|
|
718
744
|
export async function setFlashloanFeeBps<
|
|
719
745
|
T0 = any,
|
|
@@ -721,26 +747,29 @@ export namespace stable_pool {
|
|
|
721
747
|
T2 = any,
|
|
722
748
|
T3 = any,
|
|
723
749
|
>(
|
|
724
|
-
client:
|
|
750
|
+
client: Aptos,
|
|
725
751
|
account: AptosAccount,
|
|
726
752
|
request: {
|
|
727
|
-
|
|
728
|
-
|
|
753
|
+
typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
|
|
754
|
+
functionArguments: [bigint];
|
|
729
755
|
},
|
|
730
|
-
|
|
731
|
-
): Promise<
|
|
732
|
-
const coder = defaultMoveCoder(client.
|
|
733
|
-
const
|
|
734
|
-
sender: account.
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
return await client.
|
|
756
|
+
options?: InputGenerateTransactionOptions,
|
|
757
|
+
): Promise<PendingTransactionResponse> {
|
|
758
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
759
|
+
const transaction = await client.build.simple({
|
|
760
|
+
sender: account.accountAddress,
|
|
761
|
+
data: {
|
|
762
|
+
function:
|
|
763
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::set_flashloan_fee_bps",
|
|
764
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
765
|
+
typeArguments: request.typeArguments,
|
|
766
|
+
},
|
|
767
|
+
options,
|
|
768
|
+
});
|
|
769
|
+
return await client.signAndSubmitTransaction({
|
|
770
|
+
signer: account,
|
|
771
|
+
transaction,
|
|
772
|
+
});
|
|
744
773
|
}
|
|
745
774
|
export async function setPoolSwapFeeBps<
|
|
746
775
|
T0 = any,
|
|
@@ -748,26 +777,29 @@ export namespace stable_pool {
|
|
|
748
777
|
T2 = any,
|
|
749
778
|
T3 = any,
|
|
750
779
|
>(
|
|
751
|
-
client:
|
|
780
|
+
client: Aptos,
|
|
752
781
|
account: AptosAccount,
|
|
753
782
|
request: {
|
|
754
|
-
|
|
755
|
-
|
|
783
|
+
typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
|
|
784
|
+
functionArguments: [bigint];
|
|
756
785
|
},
|
|
757
|
-
|
|
758
|
-
): Promise<
|
|
759
|
-
const coder = defaultMoveCoder(client.
|
|
760
|
-
const
|
|
761
|
-
sender: account.
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
return await client.
|
|
786
|
+
options?: InputGenerateTransactionOptions,
|
|
787
|
+
): Promise<PendingTransactionResponse> {
|
|
788
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
789
|
+
const transaction = await client.build.simple({
|
|
790
|
+
sender: account.accountAddress,
|
|
791
|
+
data: {
|
|
792
|
+
function:
|
|
793
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::set_pool_swap_fee_bps",
|
|
794
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
795
|
+
typeArguments: request.typeArguments,
|
|
796
|
+
},
|
|
797
|
+
options,
|
|
798
|
+
});
|
|
799
|
+
return await client.signAndSubmitTransaction({
|
|
800
|
+
signer: account,
|
|
801
|
+
transaction,
|
|
802
|
+
});
|
|
771
803
|
}
|
|
772
804
|
}
|
|
773
805
|
export namespace view {
|
|
@@ -777,20 +809,23 @@ export namespace stable_pool {
|
|
|
777
809
|
T2 = any,
|
|
778
810
|
T3 = any,
|
|
779
811
|
>(
|
|
780
|
-
client:
|
|
812
|
+
client: Aptos,
|
|
781
813
|
request: {
|
|
782
|
-
|
|
814
|
+
typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
|
|
783
815
|
},
|
|
784
816
|
version?: bigint,
|
|
785
817
|
): Promise<[bigint]> {
|
|
786
|
-
const coder = defaultMoveCoder(client.
|
|
787
|
-
const data = {
|
|
788
|
-
type_arguments: request.type_arguments,
|
|
789
|
-
arguments: [],
|
|
818
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
819
|
+
const data: InputViewRequestData = {
|
|
790
820
|
function:
|
|
791
821
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::flashloan_fee_bps",
|
|
822
|
+
functionArguments: [],
|
|
823
|
+
typeArguments: request.typeArguments,
|
|
792
824
|
};
|
|
793
|
-
const res = await client.view(
|
|
825
|
+
const res = await client.view({
|
|
826
|
+
payload: data,
|
|
827
|
+
options: { ledgerVersion: version },
|
|
828
|
+
});
|
|
794
829
|
const type = await coder.getMoveFunction(
|
|
795
830
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::flashloan_fee_bps",
|
|
796
831
|
);
|
|
@@ -802,20 +837,23 @@ export namespace stable_pool {
|
|
|
802
837
|
T2 = any,
|
|
803
838
|
T3 = any,
|
|
804
839
|
>(
|
|
805
|
-
client:
|
|
840
|
+
client: Aptos,
|
|
806
841
|
request: {
|
|
807
|
-
|
|
842
|
+
typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
|
|
808
843
|
},
|
|
809
844
|
version?: bigint,
|
|
810
845
|
): Promise<[bigint[]]> {
|
|
811
|
-
const coder = defaultMoveCoder(client.
|
|
812
|
-
const data = {
|
|
813
|
-
type_arguments: request.type_arguments,
|
|
814
|
-
arguments: [],
|
|
846
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
847
|
+
const data: InputViewRequestData = {
|
|
815
848
|
function:
|
|
816
849
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::get_precision_multipliers",
|
|
850
|
+
functionArguments: [],
|
|
851
|
+
typeArguments: request.typeArguments,
|
|
817
852
|
};
|
|
818
|
-
const res = await client.view(
|
|
853
|
+
const res = await client.view({
|
|
854
|
+
payload: data,
|
|
855
|
+
options: { ledgerVersion: version },
|
|
856
|
+
});
|
|
819
857
|
const type = await coder.getMoveFunction(
|
|
820
858
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::get_precision_multipliers",
|
|
821
859
|
);
|
|
@@ -823,38 +861,44 @@ export namespace stable_pool {
|
|
|
823
861
|
}
|
|
824
862
|
|
|
825
863
|
export async function lpNameById(
|
|
826
|
-
client:
|
|
864
|
+
client: Aptos,
|
|
827
865
|
request: {
|
|
828
|
-
|
|
866
|
+
functionArguments: [bigint];
|
|
829
867
|
},
|
|
830
868
|
version?: bigint,
|
|
831
869
|
): Promise<[string]> {
|
|
832
|
-
const coder = defaultMoveCoder(client.
|
|
833
|
-
const data = {
|
|
834
|
-
type_arguments: [],
|
|
835
|
-
arguments: coder.encodeArray(request.arguments),
|
|
870
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
871
|
+
const data: InputViewRequestData = {
|
|
836
872
|
function:
|
|
837
873
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::lp_name_by_id",
|
|
874
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
875
|
+
typeArguments: [],
|
|
838
876
|
};
|
|
839
|
-
const res = await client.view(
|
|
877
|
+
const res = await client.view({
|
|
878
|
+
payload: data,
|
|
879
|
+
options: { ledgerVersion: version },
|
|
880
|
+
});
|
|
840
881
|
const type = await coder.getMoveFunction(
|
|
841
882
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::lp_name_by_id",
|
|
842
883
|
);
|
|
843
884
|
return (await coder.decodeArray(res, type.return)) as any;
|
|
844
885
|
}
|
|
845
886
|
export async function nextPoolId(
|
|
846
|
-
client:
|
|
887
|
+
client: Aptos,
|
|
847
888
|
|
|
848
889
|
version?: bigint,
|
|
849
890
|
): Promise<[bigint]> {
|
|
850
|
-
const coder = defaultMoveCoder(client.
|
|
851
|
-
const data = {
|
|
852
|
-
type_arguments: [],
|
|
853
|
-
arguments: [],
|
|
891
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
892
|
+
const data: InputViewRequestData = {
|
|
854
893
|
function:
|
|
855
894
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::next_pool_id",
|
|
895
|
+
functionArguments: [],
|
|
896
|
+
typeArguments: [],
|
|
856
897
|
};
|
|
857
|
-
const res = await client.view(
|
|
898
|
+
const res = await client.view({
|
|
899
|
+
payload: data,
|
|
900
|
+
options: { ledgerVersion: version },
|
|
901
|
+
});
|
|
858
902
|
const type = await coder.getMoveFunction(
|
|
859
903
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::next_pool_id",
|
|
860
904
|
);
|
|
@@ -862,60 +906,69 @@ export namespace stable_pool {
|
|
|
862
906
|
}
|
|
863
907
|
|
|
864
908
|
export async function poolAmpFactor<T0 = any, T1 = any, T2 = any, T3 = any>(
|
|
865
|
-
client:
|
|
909
|
+
client: Aptos,
|
|
866
910
|
request: {
|
|
867
|
-
|
|
911
|
+
typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
|
|
868
912
|
},
|
|
869
913
|
version?: bigint,
|
|
870
914
|
): Promise<[bigint]> {
|
|
871
|
-
const coder = defaultMoveCoder(client.
|
|
872
|
-
const data = {
|
|
873
|
-
type_arguments: request.type_arguments,
|
|
874
|
-
arguments: [],
|
|
915
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
916
|
+
const data: InputViewRequestData = {
|
|
875
917
|
function:
|
|
876
918
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::pool_amp_factor",
|
|
919
|
+
functionArguments: [],
|
|
920
|
+
typeArguments: request.typeArguments,
|
|
877
921
|
};
|
|
878
|
-
const res = await client.view(
|
|
922
|
+
const res = await client.view({
|
|
923
|
+
payload: data,
|
|
924
|
+
options: { ledgerVersion: version },
|
|
925
|
+
});
|
|
879
926
|
const type = await coder.getMoveFunction(
|
|
880
927
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::pool_amp_factor",
|
|
881
928
|
);
|
|
882
929
|
return (await coder.decodeArray(res, type.return)) as any;
|
|
883
930
|
}
|
|
884
931
|
export async function poolBalances<T0 = any, T1 = any, T2 = any, T3 = any>(
|
|
885
|
-
client:
|
|
932
|
+
client: Aptos,
|
|
886
933
|
request: {
|
|
887
|
-
|
|
934
|
+
typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
|
|
888
935
|
},
|
|
889
936
|
version?: bigint,
|
|
890
937
|
): Promise<[bigint[]]> {
|
|
891
|
-
const coder = defaultMoveCoder(client.
|
|
892
|
-
const data = {
|
|
893
|
-
type_arguments: request.type_arguments,
|
|
894
|
-
arguments: [],
|
|
938
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
939
|
+
const data: InputViewRequestData = {
|
|
895
940
|
function:
|
|
896
941
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::pool_balances",
|
|
942
|
+
functionArguments: [],
|
|
943
|
+
typeArguments: request.typeArguments,
|
|
897
944
|
};
|
|
898
|
-
const res = await client.view(
|
|
945
|
+
const res = await client.view({
|
|
946
|
+
payload: data,
|
|
947
|
+
options: { ledgerVersion: version },
|
|
948
|
+
});
|
|
899
949
|
const type = await coder.getMoveFunction(
|
|
900
950
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::pool_balances",
|
|
901
951
|
);
|
|
902
952
|
return (await coder.decodeArray(res, type.return)) as any;
|
|
903
953
|
}
|
|
904
954
|
export async function poolInfo(
|
|
905
|
-
client:
|
|
955
|
+
client: Aptos,
|
|
906
956
|
request: {
|
|
907
|
-
|
|
957
|
+
functionArguments: [string];
|
|
908
958
|
},
|
|
909
959
|
version?: bigint,
|
|
910
960
|
): Promise<[bigint[], bigint, bigint]> {
|
|
911
|
-
const coder = defaultMoveCoder(client.
|
|
912
|
-
const data = {
|
|
913
|
-
type_arguments: [],
|
|
914
|
-
arguments: coder.encodeArray(request.arguments),
|
|
961
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
962
|
+
const data: InputViewRequestData = {
|
|
915
963
|
function:
|
|
916
964
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::pool_info",
|
|
965
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
966
|
+
typeArguments: [],
|
|
917
967
|
};
|
|
918
|
-
const res = await client.view(
|
|
968
|
+
const res = await client.view({
|
|
969
|
+
payload: data,
|
|
970
|
+
options: { ledgerVersion: version },
|
|
971
|
+
});
|
|
919
972
|
const type = await coder.getMoveFunction(
|
|
920
973
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::pool_info",
|
|
921
974
|
);
|
|
@@ -928,20 +981,23 @@ export namespace stable_pool {
|
|
|
928
981
|
T2 = any,
|
|
929
982
|
T3 = any,
|
|
930
983
|
>(
|
|
931
|
-
client:
|
|
984
|
+
client: Aptos,
|
|
932
985
|
request: {
|
|
933
|
-
|
|
986
|
+
typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
|
|
934
987
|
},
|
|
935
988
|
version?: bigint,
|
|
936
989
|
): Promise<[Boolean]> {
|
|
937
|
-
const coder = defaultMoveCoder(client.
|
|
938
|
-
const data = {
|
|
939
|
-
type_arguments: request.type_arguments,
|
|
940
|
-
arguments: [],
|
|
990
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
991
|
+
const data: InputViewRequestData = {
|
|
941
992
|
function:
|
|
942
993
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::stable_pool_exists",
|
|
994
|
+
functionArguments: [],
|
|
995
|
+
typeArguments: request.typeArguments,
|
|
943
996
|
};
|
|
944
|
-
const res = await client.view(
|
|
997
|
+
const res = await client.view({
|
|
998
|
+
payload: data,
|
|
999
|
+
options: { ledgerVersion: version },
|
|
1000
|
+
});
|
|
945
1001
|
const type = await coder.getMoveFunction(
|
|
946
1002
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::stable_pool_exists",
|
|
947
1003
|
);
|
|
@@ -949,9 +1005,9 @@ export namespace stable_pool {
|
|
|
949
1005
|
}
|
|
950
1006
|
|
|
951
1007
|
export async function swapFeeRatio<T0 = any, T1 = any, T2 = any, T3 = any>(
|
|
952
|
-
client:
|
|
1008
|
+
client: Aptos,
|
|
953
1009
|
request: {
|
|
954
|
-
|
|
1010
|
+
typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
|
|
955
1011
|
},
|
|
956
1012
|
version?: bigint,
|
|
957
1013
|
): Promise<
|
|
@@ -959,14 +1015,17 @@ export namespace stable_pool {
|
|
|
959
1015
|
_0x4dcae85fc5559071906cd5c76b7420fcbb4b0a92f00ab40ffc394aadbbff5ee9.fixed_point64.FixedPoint64,
|
|
960
1016
|
]
|
|
961
1017
|
> {
|
|
962
|
-
const coder = defaultMoveCoder(client.
|
|
963
|
-
const data = {
|
|
964
|
-
type_arguments: request.type_arguments,
|
|
965
|
-
arguments: [],
|
|
1018
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
1019
|
+
const data: InputViewRequestData = {
|
|
966
1020
|
function:
|
|
967
1021
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::swap_fee_ratio",
|
|
1022
|
+
functionArguments: [],
|
|
1023
|
+
typeArguments: request.typeArguments,
|
|
968
1024
|
};
|
|
969
|
-
const res = await client.view(
|
|
1025
|
+
const res = await client.view({
|
|
1026
|
+
payload: data,
|
|
1027
|
+
options: { ledgerVersion: version },
|
|
1028
|
+
});
|
|
970
1029
|
const type = await coder.getMoveFunction(
|
|
971
1030
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::swap_fee_ratio",
|
|
972
1031
|
);
|
|
@@ -978,26 +1037,29 @@ export namespace stable_pool {
|
|
|
978
1037
|
export namespace fees_scripts {
|
|
979
1038
|
export namespace entry {
|
|
980
1039
|
export async function transferFee<T0 = any>(
|
|
981
|
-
client:
|
|
1040
|
+
client: Aptos,
|
|
982
1041
|
account: AptosAccount,
|
|
983
1042
|
request: {
|
|
984
|
-
|
|
985
|
-
|
|
1043
|
+
typeArguments: [MoveStructId];
|
|
1044
|
+
functionArguments: [MoveAddressType, bigint];
|
|
986
1045
|
},
|
|
987
|
-
|
|
988
|
-
): Promise<
|
|
989
|
-
const coder = defaultMoveCoder(client.
|
|
990
|
-
const
|
|
991
|
-
sender: account.
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
return await client.
|
|
1046
|
+
options?: InputGenerateTransactionOptions,
|
|
1047
|
+
): Promise<PendingTransactionResponse> {
|
|
1048
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
1049
|
+
const transaction = await client.build.simple({
|
|
1050
|
+
sender: account.accountAddress,
|
|
1051
|
+
data: {
|
|
1052
|
+
function:
|
|
1053
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::fees_scripts::transfer_fee",
|
|
1054
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
1055
|
+
typeArguments: request.typeArguments,
|
|
1056
|
+
},
|
|
1057
|
+
options,
|
|
1058
|
+
});
|
|
1059
|
+
return await client.signAndSubmitTransaction({
|
|
1060
|
+
signer: account,
|
|
1061
|
+
transaction,
|
|
1062
|
+
});
|
|
1001
1063
|
}
|
|
1002
1064
|
}
|
|
1003
1065
|
export namespace view {}
|
|
@@ -1585,7 +1647,7 @@ export namespace weighted_pool {
|
|
|
1585
1647
|
}
|
|
1586
1648
|
|
|
1587
1649
|
export interface WeightedPoolCreationEvent<T0, T1, T2, T3, T4, T5, T6, T7> {
|
|
1588
|
-
creator:
|
|
1650
|
+
creator: MoveAddressType;
|
|
1589
1651
|
amount_0: bigint;
|
|
1590
1652
|
amount_1: bigint;
|
|
1591
1653
|
amount_2: bigint;
|
|
@@ -1797,26 +1859,29 @@ export namespace weighted_pool {
|
|
|
1797
1859
|
|
|
1798
1860
|
export namespace entry {
|
|
1799
1861
|
export async function setDefaultPoolSwapFeeBps(
|
|
1800
|
-
client:
|
|
1862
|
+
client: Aptos,
|
|
1801
1863
|
account: AptosAccount,
|
|
1802
1864
|
request: {
|
|
1803
|
-
|
|
1804
|
-
|
|
1865
|
+
typeArguments: [];
|
|
1866
|
+
functionArguments: [bigint];
|
|
1805
1867
|
},
|
|
1806
|
-
|
|
1807
|
-
): Promise<
|
|
1808
|
-
const coder = defaultMoveCoder(client.
|
|
1809
|
-
const
|
|
1810
|
-
sender: account.
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
return await client.
|
|
1868
|
+
options?: InputGenerateTransactionOptions,
|
|
1869
|
+
): Promise<PendingTransactionResponse> {
|
|
1870
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
1871
|
+
const transaction = await client.build.simple({
|
|
1872
|
+
sender: account.accountAddress,
|
|
1873
|
+
data: {
|
|
1874
|
+
function:
|
|
1875
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::set_default_pool_swap_fee_bps",
|
|
1876
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
1877
|
+
typeArguments: [],
|
|
1878
|
+
},
|
|
1879
|
+
options,
|
|
1880
|
+
});
|
|
1881
|
+
return await client.signAndSubmitTransaction({
|
|
1882
|
+
signer: account,
|
|
1883
|
+
transaction,
|
|
1884
|
+
});
|
|
1820
1885
|
}
|
|
1821
1886
|
export async function setFlashloanFeeBps<
|
|
1822
1887
|
T0 = any,
|
|
@@ -1828,35 +1893,38 @@ export namespace weighted_pool {
|
|
|
1828
1893
|
T6 = any,
|
|
1829
1894
|
T7 = any,
|
|
1830
1895
|
>(
|
|
1831
|
-
client:
|
|
1896
|
+
client: Aptos,
|
|
1832
1897
|
account: AptosAccount,
|
|
1833
1898
|
request: {
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1899
|
+
typeArguments: [
|
|
1900
|
+
MoveStructId,
|
|
1901
|
+
MoveStructId,
|
|
1902
|
+
MoveStructId,
|
|
1903
|
+
MoveStructId,
|
|
1904
|
+
MoveStructId,
|
|
1905
|
+
MoveStructId,
|
|
1906
|
+
MoveStructId,
|
|
1907
|
+
MoveStructId,
|
|
1843
1908
|
];
|
|
1844
|
-
|
|
1909
|
+
functionArguments: [bigint];
|
|
1845
1910
|
},
|
|
1846
|
-
|
|
1847
|
-
): Promise<
|
|
1848
|
-
const coder = defaultMoveCoder(client.
|
|
1849
|
-
const
|
|
1850
|
-
sender: account.
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
return await client.
|
|
1911
|
+
options?: InputGenerateTransactionOptions,
|
|
1912
|
+
): Promise<PendingTransactionResponse> {
|
|
1913
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
1914
|
+
const transaction = await client.build.simple({
|
|
1915
|
+
sender: account.accountAddress,
|
|
1916
|
+
data: {
|
|
1917
|
+
function:
|
|
1918
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::set_flashloan_fee_bps",
|
|
1919
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
1920
|
+
typeArguments: request.typeArguments,
|
|
1921
|
+
},
|
|
1922
|
+
options,
|
|
1923
|
+
});
|
|
1924
|
+
return await client.signAndSubmitTransaction({
|
|
1925
|
+
signer: account,
|
|
1926
|
+
transaction,
|
|
1927
|
+
});
|
|
1860
1928
|
}
|
|
1861
1929
|
export async function setPoolSwapFeeBps<
|
|
1862
1930
|
T0 = any,
|
|
@@ -1868,35 +1936,38 @@ export namespace weighted_pool {
|
|
|
1868
1936
|
T6 = any,
|
|
1869
1937
|
T7 = any,
|
|
1870
1938
|
>(
|
|
1871
|
-
client:
|
|
1939
|
+
client: Aptos,
|
|
1872
1940
|
account: AptosAccount,
|
|
1873
1941
|
request: {
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1942
|
+
typeArguments: [
|
|
1943
|
+
MoveStructId,
|
|
1944
|
+
MoveStructId,
|
|
1945
|
+
MoveStructId,
|
|
1946
|
+
MoveStructId,
|
|
1947
|
+
MoveStructId,
|
|
1948
|
+
MoveStructId,
|
|
1949
|
+
MoveStructId,
|
|
1950
|
+
MoveStructId,
|
|
1883
1951
|
];
|
|
1884
|
-
|
|
1952
|
+
functionArguments: [bigint];
|
|
1885
1953
|
},
|
|
1886
|
-
|
|
1887
|
-
): Promise<
|
|
1888
|
-
const coder = defaultMoveCoder(client.
|
|
1889
|
-
const
|
|
1890
|
-
sender: account.
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
return await client.
|
|
1954
|
+
options?: InputGenerateTransactionOptions,
|
|
1955
|
+
): Promise<PendingTransactionResponse> {
|
|
1956
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
1957
|
+
const transaction = await client.build.simple({
|
|
1958
|
+
sender: account.accountAddress,
|
|
1959
|
+
data: {
|
|
1960
|
+
function:
|
|
1961
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::set_pool_swap_fee_bps",
|
|
1962
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
1963
|
+
typeArguments: request.typeArguments,
|
|
1964
|
+
},
|
|
1965
|
+
options,
|
|
1966
|
+
});
|
|
1967
|
+
return await client.signAndSubmitTransaction({
|
|
1968
|
+
signer: account,
|
|
1969
|
+
transaction,
|
|
1970
|
+
});
|
|
1900
1971
|
}
|
|
1901
1972
|
}
|
|
1902
1973
|
export namespace view {
|
|
@@ -1910,49 +1981,55 @@ export namespace weighted_pool {
|
|
|
1910
1981
|
T6 = any,
|
|
1911
1982
|
T7 = any,
|
|
1912
1983
|
>(
|
|
1913
|
-
client:
|
|
1984
|
+
client: Aptos,
|
|
1914
1985
|
request: {
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1986
|
+
typeArguments: [
|
|
1987
|
+
MoveStructId,
|
|
1988
|
+
MoveStructId,
|
|
1989
|
+
MoveStructId,
|
|
1990
|
+
MoveStructId,
|
|
1991
|
+
MoveStructId,
|
|
1992
|
+
MoveStructId,
|
|
1993
|
+
MoveStructId,
|
|
1994
|
+
MoveStructId,
|
|
1924
1995
|
];
|
|
1925
1996
|
},
|
|
1926
1997
|
version?: bigint,
|
|
1927
1998
|
): Promise<[bigint]> {
|
|
1928
|
-
const coder = defaultMoveCoder(client.
|
|
1929
|
-
const data = {
|
|
1930
|
-
type_arguments: request.type_arguments,
|
|
1931
|
-
arguments: [],
|
|
1999
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2000
|
+
const data: InputViewRequestData = {
|
|
1932
2001
|
function:
|
|
1933
2002
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::flashloan_fee_bps",
|
|
2003
|
+
functionArguments: [],
|
|
2004
|
+
typeArguments: request.typeArguments,
|
|
1934
2005
|
};
|
|
1935
|
-
const res = await client.view(
|
|
2006
|
+
const res = await client.view({
|
|
2007
|
+
payload: data,
|
|
2008
|
+
options: { ledgerVersion: version },
|
|
2009
|
+
});
|
|
1936
2010
|
const type = await coder.getMoveFunction(
|
|
1937
2011
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::flashloan_fee_bps",
|
|
1938
2012
|
);
|
|
1939
2013
|
return (await coder.decodeArray(res, type.return)) as any;
|
|
1940
2014
|
}
|
|
1941
2015
|
export async function getWeight<T0 = any>(
|
|
1942
|
-
client:
|
|
2016
|
+
client: Aptos,
|
|
1943
2017
|
request: {
|
|
1944
|
-
|
|
2018
|
+
typeArguments: [MoveStructId];
|
|
1945
2019
|
},
|
|
1946
2020
|
version?: bigint,
|
|
1947
2021
|
): Promise<[bigint]> {
|
|
1948
|
-
const coder = defaultMoveCoder(client.
|
|
1949
|
-
const data = {
|
|
1950
|
-
type_arguments: request.type_arguments,
|
|
1951
|
-
arguments: [],
|
|
2022
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2023
|
+
const data: InputViewRequestData = {
|
|
1952
2024
|
function:
|
|
1953
2025
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::get_weight",
|
|
2026
|
+
functionArguments: [],
|
|
2027
|
+
typeArguments: request.typeArguments,
|
|
1954
2028
|
};
|
|
1955
|
-
const res = await client.view(
|
|
2029
|
+
const res = await client.view({
|
|
2030
|
+
payload: data,
|
|
2031
|
+
options: { ledgerVersion: version },
|
|
2032
|
+
});
|
|
1956
2033
|
const type = await coder.getMoveFunction(
|
|
1957
2034
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::get_weight",
|
|
1958
2035
|
);
|
|
@@ -1960,38 +2037,44 @@ export namespace weighted_pool {
|
|
|
1960
2037
|
}
|
|
1961
2038
|
|
|
1962
2039
|
export async function lpNameById(
|
|
1963
|
-
client:
|
|
2040
|
+
client: Aptos,
|
|
1964
2041
|
request: {
|
|
1965
|
-
|
|
2042
|
+
functionArguments: [bigint];
|
|
1966
2043
|
},
|
|
1967
2044
|
version?: bigint,
|
|
1968
2045
|
): Promise<[string]> {
|
|
1969
|
-
const coder = defaultMoveCoder(client.
|
|
1970
|
-
const data = {
|
|
1971
|
-
type_arguments: [],
|
|
1972
|
-
arguments: coder.encodeArray(request.arguments),
|
|
2046
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2047
|
+
const data: InputViewRequestData = {
|
|
1973
2048
|
function:
|
|
1974
2049
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::lp_name_by_id",
|
|
2050
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
2051
|
+
typeArguments: [],
|
|
1975
2052
|
};
|
|
1976
|
-
const res = await client.view(
|
|
2053
|
+
const res = await client.view({
|
|
2054
|
+
payload: data,
|
|
2055
|
+
options: { ledgerVersion: version },
|
|
2056
|
+
});
|
|
1977
2057
|
const type = await coder.getMoveFunction(
|
|
1978
2058
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::lp_name_by_id",
|
|
1979
2059
|
);
|
|
1980
2060
|
return (await coder.decodeArray(res, type.return)) as any;
|
|
1981
2061
|
}
|
|
1982
2062
|
export async function nextPoolId(
|
|
1983
|
-
client:
|
|
2063
|
+
client: Aptos,
|
|
1984
2064
|
|
|
1985
2065
|
version?: bigint,
|
|
1986
2066
|
): Promise<[bigint]> {
|
|
1987
|
-
const coder = defaultMoveCoder(client.
|
|
1988
|
-
const data = {
|
|
1989
|
-
type_arguments: [],
|
|
1990
|
-
arguments: [],
|
|
2067
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2068
|
+
const data: InputViewRequestData = {
|
|
1991
2069
|
function:
|
|
1992
2070
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::next_pool_id",
|
|
2071
|
+
functionArguments: [],
|
|
2072
|
+
typeArguments: [],
|
|
1993
2073
|
};
|
|
1994
|
-
const res = await client.view(
|
|
2074
|
+
const res = await client.view({
|
|
2075
|
+
payload: data,
|
|
2076
|
+
options: { ledgerVersion: version },
|
|
2077
|
+
});
|
|
1995
2078
|
const type = await coder.getMoveFunction(
|
|
1996
2079
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::next_pool_id",
|
|
1997
2080
|
);
|
|
@@ -2008,49 +2091,55 @@ export namespace weighted_pool {
|
|
|
2008
2091
|
T6 = any,
|
|
2009
2092
|
T7 = any,
|
|
2010
2093
|
>(
|
|
2011
|
-
client:
|
|
2094
|
+
client: Aptos,
|
|
2012
2095
|
request: {
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2096
|
+
typeArguments: [
|
|
2097
|
+
MoveStructId,
|
|
2098
|
+
MoveStructId,
|
|
2099
|
+
MoveStructId,
|
|
2100
|
+
MoveStructId,
|
|
2101
|
+
MoveStructId,
|
|
2102
|
+
MoveStructId,
|
|
2103
|
+
MoveStructId,
|
|
2104
|
+
MoveStructId,
|
|
2022
2105
|
];
|
|
2023
2106
|
},
|
|
2024
2107
|
version?: bigint,
|
|
2025
2108
|
): Promise<[bigint[], bigint[]]> {
|
|
2026
|
-
const coder = defaultMoveCoder(client.
|
|
2027
|
-
const data = {
|
|
2028
|
-
type_arguments: request.type_arguments,
|
|
2029
|
-
arguments: [],
|
|
2109
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2110
|
+
const data: InputViewRequestData = {
|
|
2030
2111
|
function:
|
|
2031
2112
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::pool_balances_and_weights",
|
|
2113
|
+
functionArguments: [],
|
|
2114
|
+
typeArguments: request.typeArguments,
|
|
2032
2115
|
};
|
|
2033
|
-
const res = await client.view(
|
|
2116
|
+
const res = await client.view({
|
|
2117
|
+
payload: data,
|
|
2118
|
+
options: { ledgerVersion: version },
|
|
2119
|
+
});
|
|
2034
2120
|
const type = await coder.getMoveFunction(
|
|
2035
2121
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::pool_balances_and_weights",
|
|
2036
2122
|
);
|
|
2037
2123
|
return (await coder.decodeArray(res, type.return)) as any;
|
|
2038
2124
|
}
|
|
2039
2125
|
export async function poolInfo(
|
|
2040
|
-
client:
|
|
2126
|
+
client: Aptos,
|
|
2041
2127
|
request: {
|
|
2042
|
-
|
|
2128
|
+
functionArguments: [string];
|
|
2043
2129
|
},
|
|
2044
2130
|
version?: bigint,
|
|
2045
2131
|
): Promise<[bigint[], bigint[], bigint]> {
|
|
2046
|
-
const coder = defaultMoveCoder(client.
|
|
2047
|
-
const data = {
|
|
2048
|
-
type_arguments: [],
|
|
2049
|
-
arguments: coder.encodeArray(request.arguments),
|
|
2132
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2133
|
+
const data: InputViewRequestData = {
|
|
2050
2134
|
function:
|
|
2051
2135
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::pool_info",
|
|
2136
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
2137
|
+
typeArguments: [],
|
|
2052
2138
|
};
|
|
2053
|
-
const res = await client.view(
|
|
2139
|
+
const res = await client.view({
|
|
2140
|
+
payload: data,
|
|
2141
|
+
options: { ledgerVersion: version },
|
|
2142
|
+
});
|
|
2054
2143
|
const type = await coder.getMoveFunction(
|
|
2055
2144
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::pool_info",
|
|
2056
2145
|
);
|
|
@@ -2067,17 +2156,17 @@ export namespace weighted_pool {
|
|
|
2067
2156
|
T6 = any,
|
|
2068
2157
|
T7 = any,
|
|
2069
2158
|
>(
|
|
2070
|
-
client:
|
|
2159
|
+
client: Aptos,
|
|
2071
2160
|
request: {
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2161
|
+
typeArguments: [
|
|
2162
|
+
MoveStructId,
|
|
2163
|
+
MoveStructId,
|
|
2164
|
+
MoveStructId,
|
|
2165
|
+
MoveStructId,
|
|
2166
|
+
MoveStructId,
|
|
2167
|
+
MoveStructId,
|
|
2168
|
+
MoveStructId,
|
|
2169
|
+
MoveStructId,
|
|
2081
2170
|
];
|
|
2082
2171
|
},
|
|
2083
2172
|
version?: bigint,
|
|
@@ -2086,14 +2175,17 @@ export namespace weighted_pool {
|
|
|
2086
2175
|
_0x4dcae85fc5559071906cd5c76b7420fcbb4b0a92f00ab40ffc394aadbbff5ee9.fixed_point64.FixedPoint64,
|
|
2087
2176
|
]
|
|
2088
2177
|
> {
|
|
2089
|
-
const coder = defaultMoveCoder(client.
|
|
2090
|
-
const data = {
|
|
2091
|
-
type_arguments: request.type_arguments,
|
|
2092
|
-
arguments: [],
|
|
2178
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2179
|
+
const data: InputViewRequestData = {
|
|
2093
2180
|
function:
|
|
2094
2181
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::swap_fee_ratio",
|
|
2182
|
+
functionArguments: [],
|
|
2183
|
+
typeArguments: request.typeArguments,
|
|
2095
2184
|
};
|
|
2096
|
-
const res = await client.view(
|
|
2185
|
+
const res = await client.view({
|
|
2186
|
+
payload: data,
|
|
2187
|
+
options: { ledgerVersion: version },
|
|
2188
|
+
});
|
|
2097
2189
|
const type = await coder.getMoveFunction(
|
|
2098
2190
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::swap_fee_ratio",
|
|
2099
2191
|
);
|
|
@@ -2109,29 +2201,32 @@ export namespace weighted_pool {
|
|
|
2109
2201
|
T6 = any,
|
|
2110
2202
|
T7 = any,
|
|
2111
2203
|
>(
|
|
2112
|
-
client:
|
|
2204
|
+
client: Aptos,
|
|
2113
2205
|
request: {
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2206
|
+
typeArguments: [
|
|
2207
|
+
MoveStructId,
|
|
2208
|
+
MoveStructId,
|
|
2209
|
+
MoveStructId,
|
|
2210
|
+
MoveStructId,
|
|
2211
|
+
MoveStructId,
|
|
2212
|
+
MoveStructId,
|
|
2213
|
+
MoveStructId,
|
|
2214
|
+
MoveStructId,
|
|
2123
2215
|
];
|
|
2124
2216
|
},
|
|
2125
2217
|
version?: bigint,
|
|
2126
2218
|
): Promise<[Boolean]> {
|
|
2127
|
-
const coder = defaultMoveCoder(client.
|
|
2128
|
-
const data = {
|
|
2129
|
-
type_arguments: request.type_arguments,
|
|
2130
|
-
arguments: [],
|
|
2219
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2220
|
+
const data: InputViewRequestData = {
|
|
2131
2221
|
function:
|
|
2132
2222
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::weighted_pool_exists",
|
|
2223
|
+
functionArguments: [],
|
|
2224
|
+
typeArguments: request.typeArguments,
|
|
2133
2225
|
};
|
|
2134
|
-
const res = await client.view(
|
|
2226
|
+
const res = await client.view({
|
|
2227
|
+
payload: data,
|
|
2228
|
+
options: { ledgerVersion: version },
|
|
2229
|
+
});
|
|
2135
2230
|
const type = await coder.getMoveFunction(
|
|
2136
2231
|
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::weighted_pool_exists",
|
|
2137
2232
|
);
|
|
@@ -2163,46 +2258,49 @@ export namespace multi_hop_scripts {
|
|
|
2163
2258
|
T17 = any,
|
|
2164
2259
|
T18 = any,
|
|
2165
2260
|
>(
|
|
2166
|
-
client:
|
|
2261
|
+
client: Aptos,
|
|
2167
2262
|
account: AptosAccount,
|
|
2168
2263
|
request: {
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2264
|
+
typeArguments: [
|
|
2265
|
+
MoveStructId,
|
|
2266
|
+
MoveStructId,
|
|
2267
|
+
MoveStructId,
|
|
2268
|
+
MoveStructId,
|
|
2269
|
+
MoveStructId,
|
|
2270
|
+
MoveStructId,
|
|
2271
|
+
MoveStructId,
|
|
2272
|
+
MoveStructId,
|
|
2273
|
+
MoveStructId,
|
|
2274
|
+
MoveStructId,
|
|
2275
|
+
MoveStructId,
|
|
2276
|
+
MoveStructId,
|
|
2277
|
+
MoveStructId,
|
|
2278
|
+
MoveStructId,
|
|
2279
|
+
MoveStructId,
|
|
2280
|
+
MoveStructId,
|
|
2281
|
+
MoveStructId,
|
|
2282
|
+
MoveStructId,
|
|
2283
|
+
MoveStructId,
|
|
2189
2284
|
];
|
|
2190
|
-
|
|
2285
|
+
functionArguments: [bigint, bigint];
|
|
2191
2286
|
},
|
|
2192
|
-
|
|
2193
|
-
): Promise<
|
|
2194
|
-
const coder = defaultMoveCoder(client.
|
|
2195
|
-
const
|
|
2196
|
-
sender: account.
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
return await client.
|
|
2287
|
+
options?: InputGenerateTransactionOptions,
|
|
2288
|
+
): Promise<PendingTransactionResponse> {
|
|
2289
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2290
|
+
const transaction = await client.build.simple({
|
|
2291
|
+
sender: account.accountAddress,
|
|
2292
|
+
data: {
|
|
2293
|
+
function:
|
|
2294
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::multi_hop_scripts::swap_exact_in_2",
|
|
2295
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
2296
|
+
typeArguments: request.typeArguments,
|
|
2297
|
+
},
|
|
2298
|
+
options,
|
|
2299
|
+
});
|
|
2300
|
+
return await client.signAndSubmitTransaction({
|
|
2301
|
+
signer: account,
|
|
2302
|
+
transaction,
|
|
2303
|
+
});
|
|
2206
2304
|
}
|
|
2207
2305
|
export async function swapExactIn3<
|
|
2208
2306
|
T0 = any,
|
|
@@ -2234,55 +2332,58 @@ export namespace multi_hop_scripts {
|
|
|
2234
2332
|
T26 = any,
|
|
2235
2333
|
T27 = any,
|
|
2236
2334
|
>(
|
|
2237
|
-
client:
|
|
2335
|
+
client: Aptos,
|
|
2238
2336
|
account: AptosAccount,
|
|
2239
2337
|
request: {
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2338
|
+
typeArguments: [
|
|
2339
|
+
MoveStructId,
|
|
2340
|
+
MoveStructId,
|
|
2341
|
+
MoveStructId,
|
|
2342
|
+
MoveStructId,
|
|
2343
|
+
MoveStructId,
|
|
2344
|
+
MoveStructId,
|
|
2345
|
+
MoveStructId,
|
|
2346
|
+
MoveStructId,
|
|
2347
|
+
MoveStructId,
|
|
2348
|
+
MoveStructId,
|
|
2349
|
+
MoveStructId,
|
|
2350
|
+
MoveStructId,
|
|
2351
|
+
MoveStructId,
|
|
2352
|
+
MoveStructId,
|
|
2353
|
+
MoveStructId,
|
|
2354
|
+
MoveStructId,
|
|
2355
|
+
MoveStructId,
|
|
2356
|
+
MoveStructId,
|
|
2357
|
+
MoveStructId,
|
|
2358
|
+
MoveStructId,
|
|
2359
|
+
MoveStructId,
|
|
2360
|
+
MoveStructId,
|
|
2361
|
+
MoveStructId,
|
|
2362
|
+
MoveStructId,
|
|
2363
|
+
MoveStructId,
|
|
2364
|
+
MoveStructId,
|
|
2365
|
+
MoveStructId,
|
|
2366
|
+
MoveStructId,
|
|
2269
2367
|
];
|
|
2270
|
-
|
|
2368
|
+
functionArguments: [bigint, bigint];
|
|
2271
2369
|
},
|
|
2272
|
-
|
|
2273
|
-
): Promise<
|
|
2274
|
-
const coder = defaultMoveCoder(client.
|
|
2275
|
-
const
|
|
2276
|
-
sender: account.
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
return await client.
|
|
2370
|
+
options?: InputGenerateTransactionOptions,
|
|
2371
|
+
): Promise<PendingTransactionResponse> {
|
|
2372
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2373
|
+
const transaction = await client.build.simple({
|
|
2374
|
+
sender: account.accountAddress,
|
|
2375
|
+
data: {
|
|
2376
|
+
function:
|
|
2377
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::multi_hop_scripts::swap_exact_in_3",
|
|
2378
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
2379
|
+
typeArguments: request.typeArguments,
|
|
2380
|
+
},
|
|
2381
|
+
options,
|
|
2382
|
+
});
|
|
2383
|
+
return await client.signAndSubmitTransaction({
|
|
2384
|
+
signer: account,
|
|
2385
|
+
transaction,
|
|
2386
|
+
});
|
|
2286
2387
|
}
|
|
2287
2388
|
}
|
|
2288
2389
|
export namespace view {}
|
|
@@ -2291,26 +2392,29 @@ export namespace multi_hop_scripts {
|
|
|
2291
2392
|
export namespace stable_pool_scripts {
|
|
2292
2393
|
export namespace entry {
|
|
2293
2394
|
export async function addLiquidity<T0 = any, T1 = any, T2 = any, T3 = any>(
|
|
2294
|
-
client:
|
|
2395
|
+
client: Aptos,
|
|
2295
2396
|
account: AptosAccount,
|
|
2296
2397
|
request: {
|
|
2297
|
-
|
|
2298
|
-
|
|
2398
|
+
typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
|
|
2399
|
+
functionArguments: [bigint, bigint, bigint, bigint];
|
|
2299
2400
|
},
|
|
2300
|
-
|
|
2301
|
-
): Promise<
|
|
2302
|
-
const coder = defaultMoveCoder(client.
|
|
2303
|
-
const
|
|
2304
|
-
sender: account.
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
return await client.
|
|
2401
|
+
options?: InputGenerateTransactionOptions,
|
|
2402
|
+
): Promise<PendingTransactionResponse> {
|
|
2403
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2404
|
+
const transaction = await client.build.simple({
|
|
2405
|
+
sender: account.accountAddress,
|
|
2406
|
+
data: {
|
|
2407
|
+
function:
|
|
2408
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool_scripts::add_liquidity",
|
|
2409
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
2410
|
+
typeArguments: request.typeArguments,
|
|
2411
|
+
},
|
|
2412
|
+
options,
|
|
2413
|
+
});
|
|
2414
|
+
return await client.signAndSubmitTransaction({
|
|
2415
|
+
signer: account,
|
|
2416
|
+
transaction,
|
|
2417
|
+
});
|
|
2314
2418
|
}
|
|
2315
2419
|
export async function createStablePool<
|
|
2316
2420
|
T0 = any,
|
|
@@ -2318,26 +2422,29 @@ export namespace stable_pool_scripts {
|
|
|
2318
2422
|
T2 = any,
|
|
2319
2423
|
T3 = any,
|
|
2320
2424
|
>(
|
|
2321
|
-
client:
|
|
2425
|
+
client: Aptos,
|
|
2322
2426
|
account: AptosAccount,
|
|
2323
2427
|
request: {
|
|
2324
|
-
|
|
2325
|
-
|
|
2428
|
+
typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
|
|
2429
|
+
functionArguments: [bigint, bigint, bigint, bigint, bigint];
|
|
2326
2430
|
},
|
|
2327
|
-
|
|
2328
|
-
): Promise<
|
|
2329
|
-
const coder = defaultMoveCoder(client.
|
|
2330
|
-
const
|
|
2331
|
-
sender: account.
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
return await client.
|
|
2431
|
+
options?: InputGenerateTransactionOptions,
|
|
2432
|
+
): Promise<PendingTransactionResponse> {
|
|
2433
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2434
|
+
const transaction = await client.build.simple({
|
|
2435
|
+
sender: account.accountAddress,
|
|
2436
|
+
data: {
|
|
2437
|
+
function:
|
|
2438
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool_scripts::create_stable_pool",
|
|
2439
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
2440
|
+
typeArguments: request.typeArguments,
|
|
2441
|
+
},
|
|
2442
|
+
options,
|
|
2443
|
+
});
|
|
2444
|
+
return await client.signAndSubmitTransaction({
|
|
2445
|
+
signer: account,
|
|
2446
|
+
transaction,
|
|
2447
|
+
});
|
|
2341
2448
|
}
|
|
2342
2449
|
export async function removeLiquidity<
|
|
2343
2450
|
T0 = any,
|
|
@@ -2345,26 +2452,29 @@ export namespace stable_pool_scripts {
|
|
|
2345
2452
|
T2 = any,
|
|
2346
2453
|
T3 = any,
|
|
2347
2454
|
>(
|
|
2348
|
-
client:
|
|
2455
|
+
client: Aptos,
|
|
2349
2456
|
account: AptosAccount,
|
|
2350
2457
|
request: {
|
|
2351
|
-
|
|
2352
|
-
|
|
2458
|
+
typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
|
|
2459
|
+
functionArguments: [bigint, bigint, bigint, bigint, bigint];
|
|
2353
2460
|
},
|
|
2354
|
-
|
|
2355
|
-
): Promise<
|
|
2356
|
-
const coder = defaultMoveCoder(client.
|
|
2357
|
-
const
|
|
2358
|
-
sender: account.
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
return await client.
|
|
2461
|
+
options?: InputGenerateTransactionOptions,
|
|
2462
|
+
): Promise<PendingTransactionResponse> {
|
|
2463
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2464
|
+
const transaction = await client.build.simple({
|
|
2465
|
+
sender: account.accountAddress,
|
|
2466
|
+
data: {
|
|
2467
|
+
function:
|
|
2468
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool_scripts::remove_liquidity",
|
|
2469
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
2470
|
+
typeArguments: request.typeArguments,
|
|
2471
|
+
},
|
|
2472
|
+
options,
|
|
2473
|
+
});
|
|
2474
|
+
return await client.signAndSubmitTransaction({
|
|
2475
|
+
signer: account,
|
|
2476
|
+
transaction,
|
|
2477
|
+
});
|
|
2368
2478
|
}
|
|
2369
2479
|
export async function swapExactIn<
|
|
2370
2480
|
T0 = any,
|
|
@@ -2374,26 +2484,36 @@ export namespace stable_pool_scripts {
|
|
|
2374
2484
|
T4 = any,
|
|
2375
2485
|
T5 = any,
|
|
2376
2486
|
>(
|
|
2377
|
-
client:
|
|
2487
|
+
client: Aptos,
|
|
2378
2488
|
account: AptosAccount,
|
|
2379
2489
|
request: {
|
|
2380
|
-
|
|
2381
|
-
|
|
2490
|
+
typeArguments: [
|
|
2491
|
+
MoveStructId,
|
|
2492
|
+
MoveStructId,
|
|
2493
|
+
MoveStructId,
|
|
2494
|
+
MoveStructId,
|
|
2495
|
+
MoveStructId,
|
|
2496
|
+
MoveStructId,
|
|
2497
|
+
];
|
|
2498
|
+
functionArguments: [bigint, bigint];
|
|
2382
2499
|
},
|
|
2383
|
-
|
|
2384
|
-
): Promise<
|
|
2385
|
-
const coder = defaultMoveCoder(client.
|
|
2386
|
-
const
|
|
2387
|
-
sender: account.
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
return await client.
|
|
2500
|
+
options?: InputGenerateTransactionOptions,
|
|
2501
|
+
): Promise<PendingTransactionResponse> {
|
|
2502
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2503
|
+
const transaction = await client.build.simple({
|
|
2504
|
+
sender: account.accountAddress,
|
|
2505
|
+
data: {
|
|
2506
|
+
function:
|
|
2507
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool_scripts::swap_exact_in",
|
|
2508
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
2509
|
+
typeArguments: request.typeArguments,
|
|
2510
|
+
},
|
|
2511
|
+
options,
|
|
2512
|
+
});
|
|
2513
|
+
return await client.signAndSubmitTransaction({
|
|
2514
|
+
signer: account,
|
|
2515
|
+
transaction,
|
|
2516
|
+
});
|
|
2397
2517
|
}
|
|
2398
2518
|
export async function swapExactOut<
|
|
2399
2519
|
T0 = any,
|
|
@@ -2403,26 +2523,36 @@ export namespace stable_pool_scripts {
|
|
|
2403
2523
|
T4 = any,
|
|
2404
2524
|
T5 = any,
|
|
2405
2525
|
>(
|
|
2406
|
-
client:
|
|
2526
|
+
client: Aptos,
|
|
2407
2527
|
account: AptosAccount,
|
|
2408
2528
|
request: {
|
|
2409
|
-
|
|
2410
|
-
|
|
2529
|
+
typeArguments: [
|
|
2530
|
+
MoveStructId,
|
|
2531
|
+
MoveStructId,
|
|
2532
|
+
MoveStructId,
|
|
2533
|
+
MoveStructId,
|
|
2534
|
+
MoveStructId,
|
|
2535
|
+
MoveStructId,
|
|
2536
|
+
];
|
|
2537
|
+
functionArguments: [bigint, bigint];
|
|
2411
2538
|
},
|
|
2412
|
-
|
|
2413
|
-
): Promise<
|
|
2414
|
-
const coder = defaultMoveCoder(client.
|
|
2415
|
-
const
|
|
2416
|
-
sender: account.
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
return await client.
|
|
2539
|
+
options?: InputGenerateTransactionOptions,
|
|
2540
|
+
): Promise<PendingTransactionResponse> {
|
|
2541
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2542
|
+
const transaction = await client.build.simple({
|
|
2543
|
+
sender: account.accountAddress,
|
|
2544
|
+
data: {
|
|
2545
|
+
function:
|
|
2546
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool_scripts::swap_exact_out",
|
|
2547
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
2548
|
+
typeArguments: request.typeArguments,
|
|
2549
|
+
},
|
|
2550
|
+
options,
|
|
2551
|
+
});
|
|
2552
|
+
return await client.signAndSubmitTransaction({
|
|
2553
|
+
signer: account,
|
|
2554
|
+
transaction,
|
|
2555
|
+
});
|
|
2426
2556
|
}
|
|
2427
2557
|
}
|
|
2428
2558
|
export namespace view {}
|
|
@@ -2440,20 +2570,20 @@ export namespace weighted_pool_scripts {
|
|
|
2440
2570
|
T6 = any,
|
|
2441
2571
|
T7 = any,
|
|
2442
2572
|
>(
|
|
2443
|
-
client:
|
|
2573
|
+
client: Aptos,
|
|
2444
2574
|
account: AptosAccount,
|
|
2445
2575
|
request: {
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2576
|
+
typeArguments: [
|
|
2577
|
+
MoveStructId,
|
|
2578
|
+
MoveStructId,
|
|
2579
|
+
MoveStructId,
|
|
2580
|
+
MoveStructId,
|
|
2581
|
+
MoveStructId,
|
|
2582
|
+
MoveStructId,
|
|
2583
|
+
MoveStructId,
|
|
2584
|
+
MoveStructId,
|
|
2455
2585
|
];
|
|
2456
|
-
|
|
2586
|
+
functionArguments: [
|
|
2457
2587
|
bigint,
|
|
2458
2588
|
bigint,
|
|
2459
2589
|
bigint,
|
|
@@ -2464,20 +2594,23 @@ export namespace weighted_pool_scripts {
|
|
|
2464
2594
|
bigint,
|
|
2465
2595
|
];
|
|
2466
2596
|
},
|
|
2467
|
-
|
|
2468
|
-
): Promise<
|
|
2469
|
-
const coder = defaultMoveCoder(client.
|
|
2470
|
-
const
|
|
2471
|
-
sender: account.
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
return await client.
|
|
2597
|
+
options?: InputGenerateTransactionOptions,
|
|
2598
|
+
): Promise<PendingTransactionResponse> {
|
|
2599
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2600
|
+
const transaction = await client.build.simple({
|
|
2601
|
+
sender: account.accountAddress,
|
|
2602
|
+
data: {
|
|
2603
|
+
function:
|
|
2604
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool_scripts::add_liquidity",
|
|
2605
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
2606
|
+
typeArguments: request.typeArguments,
|
|
2607
|
+
},
|
|
2608
|
+
options,
|
|
2609
|
+
});
|
|
2610
|
+
return await client.signAndSubmitTransaction({
|
|
2611
|
+
signer: account,
|
|
2612
|
+
transaction,
|
|
2613
|
+
});
|
|
2481
2614
|
}
|
|
2482
2615
|
export async function createWeightedPool<
|
|
2483
2616
|
T0 = any,
|
|
@@ -2489,35 +2622,38 @@ export namespace weighted_pool_scripts {
|
|
|
2489
2622
|
T6 = any,
|
|
2490
2623
|
T7 = any,
|
|
2491
2624
|
>(
|
|
2492
|
-
client:
|
|
2625
|
+
client: Aptos,
|
|
2493
2626
|
account: AptosAccount,
|
|
2494
2627
|
request: {
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2628
|
+
typeArguments: [
|
|
2629
|
+
MoveStructId,
|
|
2630
|
+
MoveStructId,
|
|
2631
|
+
MoveStructId,
|
|
2632
|
+
MoveStructId,
|
|
2633
|
+
MoveStructId,
|
|
2634
|
+
MoveStructId,
|
|
2635
|
+
MoveStructId,
|
|
2636
|
+
MoveStructId,
|
|
2504
2637
|
];
|
|
2505
|
-
|
|
2638
|
+
functionArguments: [bigint, bigint, bigint, bigint];
|
|
2506
2639
|
},
|
|
2507
|
-
|
|
2508
|
-
): Promise<
|
|
2509
|
-
const coder = defaultMoveCoder(client.
|
|
2510
|
-
const
|
|
2511
|
-
sender: account.
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
return await client.
|
|
2640
|
+
options?: InputGenerateTransactionOptions,
|
|
2641
|
+
): Promise<PendingTransactionResponse> {
|
|
2642
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2643
|
+
const transaction = await client.build.simple({
|
|
2644
|
+
sender: account.accountAddress,
|
|
2645
|
+
data: {
|
|
2646
|
+
function:
|
|
2647
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool_scripts::create_weighted_pool",
|
|
2648
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
2649
|
+
typeArguments: request.typeArguments,
|
|
2650
|
+
},
|
|
2651
|
+
options,
|
|
2652
|
+
});
|
|
2653
|
+
return await client.signAndSubmitTransaction({
|
|
2654
|
+
signer: account,
|
|
2655
|
+
transaction,
|
|
2656
|
+
});
|
|
2521
2657
|
}
|
|
2522
2658
|
export async function removeLiquidity<
|
|
2523
2659
|
T0 = any,
|
|
@@ -2529,35 +2665,38 @@ export namespace weighted_pool_scripts {
|
|
|
2529
2665
|
T6 = any,
|
|
2530
2666
|
T7 = any,
|
|
2531
2667
|
>(
|
|
2532
|
-
client:
|
|
2668
|
+
client: Aptos,
|
|
2533
2669
|
account: AptosAccount,
|
|
2534
2670
|
request: {
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2671
|
+
typeArguments: [
|
|
2672
|
+
MoveStructId,
|
|
2673
|
+
MoveStructId,
|
|
2674
|
+
MoveStructId,
|
|
2675
|
+
MoveStructId,
|
|
2676
|
+
MoveStructId,
|
|
2677
|
+
MoveStructId,
|
|
2678
|
+
MoveStructId,
|
|
2679
|
+
MoveStructId,
|
|
2544
2680
|
];
|
|
2545
|
-
|
|
2681
|
+
functionArguments: [bigint, bigint, bigint, bigint, bigint];
|
|
2546
2682
|
},
|
|
2547
|
-
|
|
2548
|
-
): Promise<
|
|
2549
|
-
const coder = defaultMoveCoder(client.
|
|
2550
|
-
const
|
|
2551
|
-
sender: account.
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
return await client.
|
|
2683
|
+
options?: InputGenerateTransactionOptions,
|
|
2684
|
+
): Promise<PendingTransactionResponse> {
|
|
2685
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2686
|
+
const transaction = await client.build.simple({
|
|
2687
|
+
sender: account.accountAddress,
|
|
2688
|
+
data: {
|
|
2689
|
+
function:
|
|
2690
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool_scripts::remove_liquidity",
|
|
2691
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
2692
|
+
typeArguments: request.typeArguments,
|
|
2693
|
+
},
|
|
2694
|
+
options,
|
|
2695
|
+
});
|
|
2696
|
+
return await client.signAndSubmitTransaction({
|
|
2697
|
+
signer: account,
|
|
2698
|
+
transaction,
|
|
2699
|
+
});
|
|
2561
2700
|
}
|
|
2562
2701
|
export async function swapExactIn<
|
|
2563
2702
|
T0 = any,
|
|
@@ -2571,37 +2710,40 @@ export namespace weighted_pool_scripts {
|
|
|
2571
2710
|
T8 = any,
|
|
2572
2711
|
T9 = any,
|
|
2573
2712
|
>(
|
|
2574
|
-
client:
|
|
2713
|
+
client: Aptos,
|
|
2575
2714
|
account: AptosAccount,
|
|
2576
2715
|
request: {
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2716
|
+
typeArguments: [
|
|
2717
|
+
MoveStructId,
|
|
2718
|
+
MoveStructId,
|
|
2719
|
+
MoveStructId,
|
|
2720
|
+
MoveStructId,
|
|
2721
|
+
MoveStructId,
|
|
2722
|
+
MoveStructId,
|
|
2723
|
+
MoveStructId,
|
|
2724
|
+
MoveStructId,
|
|
2725
|
+
MoveStructId,
|
|
2726
|
+
MoveStructId,
|
|
2588
2727
|
];
|
|
2589
|
-
|
|
2728
|
+
functionArguments: [bigint, bigint];
|
|
2590
2729
|
},
|
|
2591
|
-
|
|
2592
|
-
): Promise<
|
|
2593
|
-
const coder = defaultMoveCoder(client.
|
|
2594
|
-
const
|
|
2595
|
-
sender: account.
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
return await client.
|
|
2730
|
+
options?: InputGenerateTransactionOptions,
|
|
2731
|
+
): Promise<PendingTransactionResponse> {
|
|
2732
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2733
|
+
const transaction = await client.build.simple({
|
|
2734
|
+
sender: account.accountAddress,
|
|
2735
|
+
data: {
|
|
2736
|
+
function:
|
|
2737
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool_scripts::swap_exact_in",
|
|
2738
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
2739
|
+
typeArguments: request.typeArguments,
|
|
2740
|
+
},
|
|
2741
|
+
options,
|
|
2742
|
+
});
|
|
2743
|
+
return await client.signAndSubmitTransaction({
|
|
2744
|
+
signer: account,
|
|
2745
|
+
transaction,
|
|
2746
|
+
});
|
|
2605
2747
|
}
|
|
2606
2748
|
export async function swapExactOut<
|
|
2607
2749
|
T0 = any,
|
|
@@ -2615,37 +2757,40 @@ export namespace weighted_pool_scripts {
|
|
|
2615
2757
|
T8 = any,
|
|
2616
2758
|
T9 = any,
|
|
2617
2759
|
>(
|
|
2618
|
-
client:
|
|
2760
|
+
client: Aptos,
|
|
2619
2761
|
account: AptosAccount,
|
|
2620
2762
|
request: {
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2763
|
+
typeArguments: [
|
|
2764
|
+
MoveStructId,
|
|
2765
|
+
MoveStructId,
|
|
2766
|
+
MoveStructId,
|
|
2767
|
+
MoveStructId,
|
|
2768
|
+
MoveStructId,
|
|
2769
|
+
MoveStructId,
|
|
2770
|
+
MoveStructId,
|
|
2771
|
+
MoveStructId,
|
|
2772
|
+
MoveStructId,
|
|
2773
|
+
MoveStructId,
|
|
2632
2774
|
];
|
|
2633
|
-
|
|
2775
|
+
functionArguments: [bigint, bigint];
|
|
2634
2776
|
},
|
|
2635
|
-
|
|
2636
|
-
): Promise<
|
|
2637
|
-
const coder = defaultMoveCoder(client.
|
|
2638
|
-
const
|
|
2639
|
-
sender: account.
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
return await client.
|
|
2777
|
+
options?: InputGenerateTransactionOptions,
|
|
2778
|
+
): Promise<PendingTransactionResponse> {
|
|
2779
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2780
|
+
const transaction = await client.build.simple({
|
|
2781
|
+
sender: account.accountAddress,
|
|
2782
|
+
data: {
|
|
2783
|
+
function:
|
|
2784
|
+
"0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool_scripts::swap_exact_out",
|
|
2785
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
2786
|
+
typeArguments: request.typeArguments,
|
|
2787
|
+
},
|
|
2788
|
+
options,
|
|
2789
|
+
});
|
|
2790
|
+
return await client.signAndSubmitTransaction({
|
|
2791
|
+
signer: account,
|
|
2792
|
+
transaction,
|
|
2793
|
+
});
|
|
2649
2794
|
}
|
|
2650
2795
|
}
|
|
2651
2796
|
export namespace view {}
|