@typemove/aptos 1.2.9 → 1.3.0-rc.1
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/0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541.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
|
|
|
@@ -149,7 +148,7 @@ export namespace amm {
|
|
|
149
148
|
}
|
|
150
149
|
|
|
151
150
|
export interface SwapEvent {
|
|
152
|
-
sender_addr:
|
|
151
|
+
sender_addr: MoveAddressType;
|
|
153
152
|
timestamp: bigint;
|
|
154
153
|
in_coin_type: string;
|
|
155
154
|
out_coin_type: string;
|
|
@@ -178,297 +177,336 @@ export namespace amm {
|
|
|
178
177
|
|
|
179
178
|
export namespace entry {
|
|
180
179
|
export async function addApproximateLiquidity<T0 = any, T1 = any>(
|
|
181
|
-
client:
|
|
180
|
+
client: Aptos,
|
|
182
181
|
account: AptosAccount,
|
|
183
182
|
request: {
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
184
|
+
functionArguments: [bigint, bigint, bigint, bigint, bigint, bigint];
|
|
186
185
|
},
|
|
187
|
-
|
|
188
|
-
): Promise<
|
|
189
|
-
const coder = defaultMoveCoder(client.
|
|
190
|
-
const
|
|
191
|
-
sender: account.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
return await client.
|
|
186
|
+
options?: InputGenerateTransactionOptions,
|
|
187
|
+
): Promise<PendingTransactionResponse> {
|
|
188
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
189
|
+
const transaction = await client.build.simple({
|
|
190
|
+
sender: account.accountAddress,
|
|
191
|
+
data: {
|
|
192
|
+
function:
|
|
193
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::amm::add_approximate_liquidity",
|
|
194
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
195
|
+
typeArguments: request.typeArguments,
|
|
196
|
+
},
|
|
197
|
+
options,
|
|
198
|
+
});
|
|
199
|
+
return await client.signAndSubmitTransaction({
|
|
200
|
+
signer: account,
|
|
201
|
+
transaction,
|
|
202
|
+
});
|
|
201
203
|
}
|
|
202
204
|
export async function addExactLiquidity<T0 = any, T1 = any>(
|
|
203
|
-
client:
|
|
205
|
+
client: Aptos,
|
|
204
206
|
account: AptosAccount,
|
|
205
207
|
request: {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
209
|
+
functionArguments: [bigint, bigint];
|
|
208
210
|
},
|
|
209
|
-
|
|
210
|
-
): Promise<
|
|
211
|
-
const coder = defaultMoveCoder(client.
|
|
212
|
-
const
|
|
213
|
-
sender: account.
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
return await client.
|
|
211
|
+
options?: InputGenerateTransactionOptions,
|
|
212
|
+
): Promise<PendingTransactionResponse> {
|
|
213
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
214
|
+
const transaction = await client.build.simple({
|
|
215
|
+
sender: account.accountAddress,
|
|
216
|
+
data: {
|
|
217
|
+
function:
|
|
218
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::amm::add_exact_liquidity",
|
|
219
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
220
|
+
typeArguments: request.typeArguments,
|
|
221
|
+
},
|
|
222
|
+
options,
|
|
223
|
+
});
|
|
224
|
+
return await client.signAndSubmitTransaction({
|
|
225
|
+
signer: account,
|
|
226
|
+
transaction,
|
|
227
|
+
});
|
|
223
228
|
}
|
|
224
229
|
export async function addLiquidity<T0 = any, T1 = any>(
|
|
225
|
-
client:
|
|
230
|
+
client: Aptos,
|
|
226
231
|
account: AptosAccount,
|
|
227
232
|
request: {
|
|
228
|
-
|
|
229
|
-
|
|
233
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
234
|
+
functionArguments: [bigint, bigint, bigint];
|
|
230
235
|
},
|
|
231
|
-
|
|
232
|
-
): Promise<
|
|
233
|
-
const coder = defaultMoveCoder(client.
|
|
234
|
-
const
|
|
235
|
-
sender: account.
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
return await client.
|
|
236
|
+
options?: InputGenerateTransactionOptions,
|
|
237
|
+
): Promise<PendingTransactionResponse> {
|
|
238
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
239
|
+
const transaction = await client.build.simple({
|
|
240
|
+
sender: account.accountAddress,
|
|
241
|
+
data: {
|
|
242
|
+
function:
|
|
243
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::amm::add_liquidity",
|
|
244
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
245
|
+
typeArguments: request.typeArguments,
|
|
246
|
+
},
|
|
247
|
+
options,
|
|
248
|
+
});
|
|
249
|
+
return await client.signAndSubmitTransaction({
|
|
250
|
+
signer: account,
|
|
251
|
+
transaction,
|
|
252
|
+
});
|
|
245
253
|
}
|
|
246
254
|
export async function addLiquidityWithAuxAccount<T0 = any, T1 = any>(
|
|
247
|
-
client:
|
|
255
|
+
client: Aptos,
|
|
248
256
|
account: AptosAccount,
|
|
249
257
|
request: {
|
|
250
|
-
|
|
251
|
-
|
|
258
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
259
|
+
functionArguments: [bigint, bigint, bigint];
|
|
252
260
|
},
|
|
253
|
-
|
|
254
|
-
): Promise<
|
|
255
|
-
const coder = defaultMoveCoder(client.
|
|
256
|
-
const
|
|
257
|
-
sender: account.
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
return await client.
|
|
261
|
+
options?: InputGenerateTransactionOptions,
|
|
262
|
+
): Promise<PendingTransactionResponse> {
|
|
263
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
264
|
+
const transaction = await client.build.simple({
|
|
265
|
+
sender: account.accountAddress,
|
|
266
|
+
data: {
|
|
267
|
+
function:
|
|
268
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::amm::add_liquidity_with_aux_account",
|
|
269
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
270
|
+
typeArguments: request.typeArguments,
|
|
271
|
+
},
|
|
272
|
+
options,
|
|
273
|
+
});
|
|
274
|
+
return await client.signAndSubmitTransaction({
|
|
275
|
+
signer: account,
|
|
276
|
+
transaction,
|
|
277
|
+
});
|
|
267
278
|
}
|
|
268
279
|
|
|
269
280
|
export async function createPool<T0 = any, T1 = any>(
|
|
270
|
-
client:
|
|
281
|
+
client: Aptos,
|
|
271
282
|
account: AptosAccount,
|
|
272
283
|
request: {
|
|
273
|
-
|
|
274
|
-
|
|
284
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
285
|
+
functionArguments: [bigint];
|
|
275
286
|
},
|
|
276
|
-
|
|
277
|
-
): Promise<
|
|
278
|
-
const coder = defaultMoveCoder(client.
|
|
279
|
-
const
|
|
280
|
-
sender: account.
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
return await client.
|
|
287
|
+
options?: InputGenerateTransactionOptions,
|
|
288
|
+
): Promise<PendingTransactionResponse> {
|
|
289
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
290
|
+
const transaction = await client.build.simple({
|
|
291
|
+
sender: account.accountAddress,
|
|
292
|
+
data: {
|
|
293
|
+
function:
|
|
294
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::amm::create_pool",
|
|
295
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
296
|
+
typeArguments: request.typeArguments,
|
|
297
|
+
},
|
|
298
|
+
options,
|
|
299
|
+
});
|
|
300
|
+
return await client.signAndSubmitTransaction({
|
|
301
|
+
signer: account,
|
|
302
|
+
transaction,
|
|
303
|
+
});
|
|
290
304
|
}
|
|
291
305
|
|
|
292
306
|
export async function removeLiquidity<T0 = any, T1 = any>(
|
|
293
|
-
client:
|
|
307
|
+
client: Aptos,
|
|
294
308
|
account: AptosAccount,
|
|
295
309
|
request: {
|
|
296
|
-
|
|
297
|
-
|
|
310
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
311
|
+
functionArguments: [bigint];
|
|
298
312
|
},
|
|
299
|
-
|
|
300
|
-
): Promise<
|
|
301
|
-
const coder = defaultMoveCoder(client.
|
|
302
|
-
const
|
|
303
|
-
sender: account.
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
return await client.
|
|
313
|
+
options?: InputGenerateTransactionOptions,
|
|
314
|
+
): Promise<PendingTransactionResponse> {
|
|
315
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
316
|
+
const transaction = await client.build.simple({
|
|
317
|
+
sender: account.accountAddress,
|
|
318
|
+
data: {
|
|
319
|
+
function:
|
|
320
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::amm::remove_liquidity",
|
|
321
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
322
|
+
typeArguments: request.typeArguments,
|
|
323
|
+
},
|
|
324
|
+
options,
|
|
325
|
+
});
|
|
326
|
+
return await client.signAndSubmitTransaction({
|
|
327
|
+
signer: account,
|
|
328
|
+
transaction,
|
|
329
|
+
});
|
|
313
330
|
}
|
|
314
331
|
export async function removeLiquidityWithAuxAccount<T0 = any, T1 = any>(
|
|
315
|
-
client:
|
|
332
|
+
client: Aptos,
|
|
316
333
|
account: AptosAccount,
|
|
317
334
|
request: {
|
|
318
|
-
|
|
319
|
-
|
|
335
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
336
|
+
functionArguments: [bigint];
|
|
320
337
|
},
|
|
321
|
-
|
|
322
|
-
): Promise<
|
|
323
|
-
const coder = defaultMoveCoder(client.
|
|
324
|
-
const
|
|
325
|
-
sender: account.
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
return await client.
|
|
338
|
+
options?: InputGenerateTransactionOptions,
|
|
339
|
+
): Promise<PendingTransactionResponse> {
|
|
340
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
341
|
+
const transaction = await client.build.simple({
|
|
342
|
+
sender: account.accountAddress,
|
|
343
|
+
data: {
|
|
344
|
+
function:
|
|
345
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::amm::remove_liquidity_with_aux_account",
|
|
346
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
347
|
+
typeArguments: request.typeArguments,
|
|
348
|
+
},
|
|
349
|
+
options,
|
|
350
|
+
});
|
|
351
|
+
return await client.signAndSubmitTransaction({
|
|
352
|
+
signer: account,
|
|
353
|
+
transaction,
|
|
354
|
+
});
|
|
335
355
|
}
|
|
336
356
|
|
|
337
357
|
export async function resetPool<T0 = any, T1 = any>(
|
|
338
|
-
client:
|
|
358
|
+
client: Aptos,
|
|
339
359
|
account: AptosAccount,
|
|
340
360
|
request: {
|
|
341
|
-
|
|
342
|
-
|
|
361
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
362
|
+
functionArguments: [];
|
|
343
363
|
},
|
|
344
|
-
|
|
345
|
-
): Promise<
|
|
346
|
-
const coder = defaultMoveCoder(client.
|
|
347
|
-
const
|
|
348
|
-
sender: account.
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
return await client.
|
|
364
|
+
options?: InputGenerateTransactionOptions,
|
|
365
|
+
): Promise<PendingTransactionResponse> {
|
|
366
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
367
|
+
const transaction = await client.build.simple({
|
|
368
|
+
sender: account.accountAddress,
|
|
369
|
+
data: {
|
|
370
|
+
function:
|
|
371
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::amm::reset_pool",
|
|
372
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
373
|
+
typeArguments: request.typeArguments,
|
|
374
|
+
},
|
|
375
|
+
options,
|
|
376
|
+
});
|
|
377
|
+
return await client.signAndSubmitTransaction({
|
|
378
|
+
signer: account,
|
|
379
|
+
transaction,
|
|
380
|
+
});
|
|
358
381
|
}
|
|
359
382
|
|
|
360
383
|
export async function swapCoinForExactCoinLimit<T0 = any, T1 = any>(
|
|
361
|
-
client:
|
|
384
|
+
client: Aptos,
|
|
362
385
|
account: AptosAccount,
|
|
363
386
|
request: {
|
|
364
|
-
|
|
365
|
-
|
|
387
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
388
|
+
functionArguments: [bigint, bigint, bigint, bigint];
|
|
366
389
|
},
|
|
367
|
-
|
|
368
|
-
): Promise<
|
|
369
|
-
const coder = defaultMoveCoder(client.
|
|
370
|
-
const
|
|
371
|
-
sender: account.
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
return await client.
|
|
390
|
+
options?: InputGenerateTransactionOptions,
|
|
391
|
+
): Promise<PendingTransactionResponse> {
|
|
392
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
393
|
+
const transaction = await client.build.simple({
|
|
394
|
+
sender: account.accountAddress,
|
|
395
|
+
data: {
|
|
396
|
+
function:
|
|
397
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::amm::swap_coin_for_exact_coin_limit",
|
|
398
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
399
|
+
typeArguments: request.typeArguments,
|
|
400
|
+
},
|
|
401
|
+
options,
|
|
402
|
+
});
|
|
403
|
+
return await client.signAndSubmitTransaction({
|
|
404
|
+
signer: account,
|
|
405
|
+
transaction,
|
|
406
|
+
});
|
|
381
407
|
}
|
|
382
408
|
|
|
383
409
|
export async function swapCoinForExactCoinWithSigner<T0 = any, T1 = any>(
|
|
384
|
-
client:
|
|
410
|
+
client: Aptos,
|
|
385
411
|
account: AptosAccount,
|
|
386
412
|
request: {
|
|
387
|
-
|
|
388
|
-
|
|
413
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
414
|
+
functionArguments: [bigint, bigint];
|
|
389
415
|
},
|
|
390
|
-
|
|
391
|
-
): Promise<
|
|
392
|
-
const coder = defaultMoveCoder(client.
|
|
393
|
-
const
|
|
394
|
-
sender: account.
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
return await client.
|
|
416
|
+
options?: InputGenerateTransactionOptions,
|
|
417
|
+
): Promise<PendingTransactionResponse> {
|
|
418
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
419
|
+
const transaction = await client.build.simple({
|
|
420
|
+
sender: account.accountAddress,
|
|
421
|
+
data: {
|
|
422
|
+
function:
|
|
423
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::amm::swap_coin_for_exact_coin_with_signer",
|
|
424
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
425
|
+
typeArguments: request.typeArguments,
|
|
426
|
+
},
|
|
427
|
+
options,
|
|
428
|
+
});
|
|
429
|
+
return await client.signAndSubmitTransaction({
|
|
430
|
+
signer: account,
|
|
431
|
+
transaction,
|
|
432
|
+
});
|
|
404
433
|
}
|
|
405
434
|
|
|
406
435
|
export async function swapExactCoinForCoinLimit<T0 = any, T1 = any>(
|
|
407
|
-
client:
|
|
436
|
+
client: Aptos,
|
|
408
437
|
account: AptosAccount,
|
|
409
438
|
request: {
|
|
410
|
-
|
|
411
|
-
|
|
439
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
440
|
+
functionArguments: [bigint, bigint, bigint];
|
|
412
441
|
},
|
|
413
|
-
|
|
414
|
-
): Promise<
|
|
415
|
-
const coder = defaultMoveCoder(client.
|
|
416
|
-
const
|
|
417
|
-
sender: account.
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
return await client.
|
|
442
|
+
options?: InputGenerateTransactionOptions,
|
|
443
|
+
): Promise<PendingTransactionResponse> {
|
|
444
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
445
|
+
const transaction = await client.build.simple({
|
|
446
|
+
sender: account.accountAddress,
|
|
447
|
+
data: {
|
|
448
|
+
function:
|
|
449
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::amm::swap_exact_coin_for_coin_limit",
|
|
450
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
451
|
+
typeArguments: request.typeArguments,
|
|
452
|
+
},
|
|
453
|
+
options,
|
|
454
|
+
});
|
|
455
|
+
return await client.signAndSubmitTransaction({
|
|
456
|
+
signer: account,
|
|
457
|
+
transaction,
|
|
458
|
+
});
|
|
427
459
|
}
|
|
428
460
|
|
|
429
461
|
export async function swapExactCoinForCoinWithSigner<T0 = any, T1 = any>(
|
|
430
|
-
client:
|
|
462
|
+
client: Aptos,
|
|
431
463
|
account: AptosAccount,
|
|
432
464
|
request: {
|
|
433
|
-
|
|
434
|
-
|
|
465
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
466
|
+
functionArguments: [bigint, bigint];
|
|
435
467
|
},
|
|
436
|
-
|
|
437
|
-
): Promise<
|
|
438
|
-
const coder = defaultMoveCoder(client.
|
|
439
|
-
const
|
|
440
|
-
sender: account.
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
return await client.
|
|
468
|
+
options?: InputGenerateTransactionOptions,
|
|
469
|
+
): Promise<PendingTransactionResponse> {
|
|
470
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
471
|
+
const transaction = await client.build.simple({
|
|
472
|
+
sender: account.accountAddress,
|
|
473
|
+
data: {
|
|
474
|
+
function:
|
|
475
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::amm::swap_exact_coin_for_coin_with_signer",
|
|
476
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
477
|
+
typeArguments: request.typeArguments,
|
|
478
|
+
},
|
|
479
|
+
options,
|
|
480
|
+
});
|
|
481
|
+
return await client.signAndSubmitTransaction({
|
|
482
|
+
signer: account,
|
|
483
|
+
transaction,
|
|
484
|
+
});
|
|
450
485
|
}
|
|
451
486
|
export async function updateFee<T0 = any, T1 = any>(
|
|
452
|
-
client:
|
|
487
|
+
client: Aptos,
|
|
453
488
|
account: AptosAccount,
|
|
454
489
|
request: {
|
|
455
|
-
|
|
456
|
-
|
|
490
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
491
|
+
functionArguments: [bigint];
|
|
457
492
|
},
|
|
458
|
-
|
|
459
|
-
): Promise<
|
|
460
|
-
const coder = defaultMoveCoder(client.
|
|
461
|
-
const
|
|
462
|
-
sender: account.
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
return await client.
|
|
493
|
+
options?: InputGenerateTransactionOptions,
|
|
494
|
+
): Promise<PendingTransactionResponse> {
|
|
495
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
496
|
+
const transaction = await client.build.simple({
|
|
497
|
+
sender: account.accountAddress,
|
|
498
|
+
data: {
|
|
499
|
+
function:
|
|
500
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::amm::update_fee",
|
|
501
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
502
|
+
typeArguments: request.typeArguments,
|
|
503
|
+
},
|
|
504
|
+
options,
|
|
505
|
+
});
|
|
506
|
+
return await client.signAndSubmitTransaction({
|
|
507
|
+
signer: account,
|
|
508
|
+
transaction,
|
|
509
|
+
});
|
|
472
510
|
}
|
|
473
511
|
}
|
|
474
512
|
export namespace view {}
|
|
@@ -522,7 +560,7 @@ export namespace util {
|
|
|
522
560
|
|
|
523
561
|
export namespace vault {
|
|
524
562
|
export interface AuxUserAccount {
|
|
525
|
-
authorized_traders: _0x1.table.Table<
|
|
563
|
+
authorized_traders: _0x1.table.Table<MoveAddressType, vault.Nothing>;
|
|
526
564
|
}
|
|
527
565
|
|
|
528
566
|
export namespace AuxUserAccount {
|
|
@@ -573,8 +611,8 @@ export namespace vault {
|
|
|
573
611
|
|
|
574
612
|
export interface DepositEvent {
|
|
575
613
|
coinType: string;
|
|
576
|
-
depositor:
|
|
577
|
-
to:
|
|
614
|
+
depositor: MoveAddressType;
|
|
615
|
+
to: MoveAddressType;
|
|
578
616
|
amount_au: bigint;
|
|
579
617
|
}
|
|
580
618
|
|
|
@@ -617,8 +655,8 @@ export namespace vault {
|
|
|
617
655
|
|
|
618
656
|
export interface TransferEvent {
|
|
619
657
|
coinType: string;
|
|
620
|
-
from:
|
|
621
|
-
to:
|
|
658
|
+
from: MoveAddressType;
|
|
659
|
+
to: MoveAddressType;
|
|
622
660
|
amount_au: bigint;
|
|
623
661
|
}
|
|
624
662
|
|
|
@@ -658,7 +696,7 @@ export namespace vault {
|
|
|
658
696
|
|
|
659
697
|
export interface WithdrawEvent {
|
|
660
698
|
coinType: string;
|
|
661
|
-
owner:
|
|
699
|
+
owner: MoveAddressType;
|
|
662
700
|
amount_au: bigint;
|
|
663
701
|
}
|
|
664
702
|
|
|
@@ -681,161 +719,182 @@ export namespace vault {
|
|
|
681
719
|
|
|
682
720
|
export namespace entry {
|
|
683
721
|
export async function addAuthorizedTrader(
|
|
684
|
-
client:
|
|
722
|
+
client: Aptos,
|
|
685
723
|
account: AptosAccount,
|
|
686
724
|
request: {
|
|
687
|
-
|
|
688
|
-
|
|
725
|
+
typeArguments: [];
|
|
726
|
+
functionArguments: [MoveAddressType];
|
|
689
727
|
},
|
|
690
|
-
|
|
691
|
-
): Promise<
|
|
692
|
-
const coder = defaultMoveCoder(client.
|
|
693
|
-
const
|
|
694
|
-
sender: account.
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
return await client.
|
|
728
|
+
options?: InputGenerateTransactionOptions,
|
|
729
|
+
): Promise<PendingTransactionResponse> {
|
|
730
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
731
|
+
const transaction = await client.build.simple({
|
|
732
|
+
sender: account.accountAddress,
|
|
733
|
+
data: {
|
|
734
|
+
function:
|
|
735
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::vault::add_authorized_trader",
|
|
736
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
737
|
+
typeArguments: [],
|
|
738
|
+
},
|
|
739
|
+
options,
|
|
740
|
+
});
|
|
741
|
+
return await client.signAndSubmitTransaction({
|
|
742
|
+
signer: account,
|
|
743
|
+
transaction,
|
|
744
|
+
});
|
|
704
745
|
}
|
|
705
746
|
|
|
706
747
|
export async function createAuxAccount(
|
|
707
|
-
client:
|
|
748
|
+
client: Aptos,
|
|
708
749
|
account: AptosAccount,
|
|
709
750
|
request: {
|
|
710
|
-
|
|
711
|
-
|
|
751
|
+
typeArguments: [];
|
|
752
|
+
functionArguments: [];
|
|
712
753
|
},
|
|
713
|
-
|
|
714
|
-
): Promise<
|
|
715
|
-
const coder = defaultMoveCoder(client.
|
|
716
|
-
const
|
|
717
|
-
sender: account.
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
return await client.
|
|
754
|
+
options?: InputGenerateTransactionOptions,
|
|
755
|
+
): Promise<PendingTransactionResponse> {
|
|
756
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
757
|
+
const transaction = await client.build.simple({
|
|
758
|
+
sender: account.accountAddress,
|
|
759
|
+
data: {
|
|
760
|
+
function:
|
|
761
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::vault::create_aux_account",
|
|
762
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
763
|
+
typeArguments: [],
|
|
764
|
+
},
|
|
765
|
+
options,
|
|
766
|
+
});
|
|
767
|
+
return await client.signAndSubmitTransaction({
|
|
768
|
+
signer: account,
|
|
769
|
+
transaction,
|
|
770
|
+
});
|
|
727
771
|
}
|
|
728
772
|
export async function createVault(
|
|
729
|
-
client:
|
|
773
|
+
client: Aptos,
|
|
730
774
|
account: AptosAccount,
|
|
731
775
|
request: {
|
|
732
|
-
|
|
733
|
-
|
|
776
|
+
typeArguments: [];
|
|
777
|
+
functionArguments: [];
|
|
734
778
|
},
|
|
735
|
-
|
|
736
|
-
): Promise<
|
|
737
|
-
const coder = defaultMoveCoder(client.
|
|
738
|
-
const
|
|
739
|
-
sender: account.
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
return await client.
|
|
779
|
+
options?: InputGenerateTransactionOptions,
|
|
780
|
+
): Promise<PendingTransactionResponse> {
|
|
781
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
782
|
+
const transaction = await client.build.simple({
|
|
783
|
+
sender: account.accountAddress,
|
|
784
|
+
data: {
|
|
785
|
+
function:
|
|
786
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::vault::create_vault",
|
|
787
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
788
|
+
typeArguments: [],
|
|
789
|
+
},
|
|
790
|
+
options,
|
|
791
|
+
});
|
|
792
|
+
return await client.signAndSubmitTransaction({
|
|
793
|
+
signer: account,
|
|
794
|
+
transaction,
|
|
795
|
+
});
|
|
749
796
|
}
|
|
750
797
|
|
|
751
798
|
export async function deposit<T0 = any>(
|
|
752
|
-
client:
|
|
799
|
+
client: Aptos,
|
|
753
800
|
account: AptosAccount,
|
|
754
801
|
request: {
|
|
755
|
-
|
|
756
|
-
|
|
802
|
+
typeArguments: [MoveStructId];
|
|
803
|
+
functionArguments: [MoveAddressType, bigint];
|
|
757
804
|
},
|
|
758
|
-
|
|
759
|
-
): Promise<
|
|
760
|
-
const coder = defaultMoveCoder(client.
|
|
761
|
-
const
|
|
762
|
-
sender: account.
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
return await client.
|
|
805
|
+
options?: InputGenerateTransactionOptions,
|
|
806
|
+
): Promise<PendingTransactionResponse> {
|
|
807
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
808
|
+
const transaction = await client.build.simple({
|
|
809
|
+
sender: account.accountAddress,
|
|
810
|
+
data: {
|
|
811
|
+
function:
|
|
812
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::vault::deposit",
|
|
813
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
814
|
+
typeArguments: request.typeArguments,
|
|
815
|
+
},
|
|
816
|
+
options,
|
|
817
|
+
});
|
|
818
|
+
return await client.signAndSubmitTransaction({
|
|
819
|
+
signer: account,
|
|
820
|
+
transaction,
|
|
821
|
+
});
|
|
772
822
|
}
|
|
773
823
|
|
|
774
824
|
export async function removeAuthorizedTrader(
|
|
775
|
-
client:
|
|
825
|
+
client: Aptos,
|
|
776
826
|
account: AptosAccount,
|
|
777
827
|
request: {
|
|
778
|
-
|
|
779
|
-
|
|
828
|
+
typeArguments: [];
|
|
829
|
+
functionArguments: [MoveAddressType];
|
|
780
830
|
},
|
|
781
|
-
|
|
782
|
-
): Promise<
|
|
783
|
-
const coder = defaultMoveCoder(client.
|
|
784
|
-
const
|
|
785
|
-
sender: account.
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
return await client.
|
|
831
|
+
options?: InputGenerateTransactionOptions,
|
|
832
|
+
): Promise<PendingTransactionResponse> {
|
|
833
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
834
|
+
const transaction = await client.build.simple({
|
|
835
|
+
sender: account.accountAddress,
|
|
836
|
+
data: {
|
|
837
|
+
function:
|
|
838
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::vault::remove_authorized_trader",
|
|
839
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
840
|
+
typeArguments: [],
|
|
841
|
+
},
|
|
842
|
+
options,
|
|
843
|
+
});
|
|
844
|
+
return await client.signAndSubmitTransaction({
|
|
845
|
+
signer: account,
|
|
846
|
+
transaction,
|
|
847
|
+
});
|
|
795
848
|
}
|
|
796
849
|
export async function transfer<T0 = any>(
|
|
797
|
-
client:
|
|
850
|
+
client: Aptos,
|
|
798
851
|
account: AptosAccount,
|
|
799
852
|
request: {
|
|
800
|
-
|
|
801
|
-
|
|
853
|
+
typeArguments: [MoveStructId];
|
|
854
|
+
functionArguments: [MoveAddressType, bigint];
|
|
802
855
|
},
|
|
803
|
-
|
|
804
|
-
): Promise<
|
|
805
|
-
const coder = defaultMoveCoder(client.
|
|
806
|
-
const
|
|
807
|
-
sender: account.
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
return await client.
|
|
856
|
+
options?: InputGenerateTransactionOptions,
|
|
857
|
+
): Promise<PendingTransactionResponse> {
|
|
858
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
859
|
+
const transaction = await client.build.simple({
|
|
860
|
+
sender: account.accountAddress,
|
|
861
|
+
data: {
|
|
862
|
+
function:
|
|
863
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::vault::transfer",
|
|
864
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
865
|
+
typeArguments: request.typeArguments,
|
|
866
|
+
},
|
|
867
|
+
options,
|
|
868
|
+
});
|
|
869
|
+
return await client.signAndSubmitTransaction({
|
|
870
|
+
signer: account,
|
|
871
|
+
transaction,
|
|
872
|
+
});
|
|
817
873
|
}
|
|
818
874
|
export async function withdraw<T0 = any>(
|
|
819
|
-
client:
|
|
875
|
+
client: Aptos,
|
|
820
876
|
account: AptosAccount,
|
|
821
877
|
request: {
|
|
822
|
-
|
|
823
|
-
|
|
878
|
+
typeArguments: [MoveStructId];
|
|
879
|
+
functionArguments: [bigint];
|
|
824
880
|
},
|
|
825
|
-
|
|
826
|
-
): Promise<
|
|
827
|
-
const coder = defaultMoveCoder(client.
|
|
828
|
-
const
|
|
829
|
-
sender: account.
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
return await client.
|
|
881
|
+
options?: InputGenerateTransactionOptions,
|
|
882
|
+
): Promise<PendingTransactionResponse> {
|
|
883
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
884
|
+
const transaction = await client.build.simple({
|
|
885
|
+
sender: account.accountAddress,
|
|
886
|
+
data: {
|
|
887
|
+
function:
|
|
888
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::vault::withdraw",
|
|
889
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
890
|
+
typeArguments: request.typeArguments,
|
|
891
|
+
},
|
|
892
|
+
options,
|
|
893
|
+
});
|
|
894
|
+
return await client.signAndSubmitTransaction({
|
|
895
|
+
signer: account,
|
|
896
|
+
transaction,
|
|
897
|
+
});
|
|
839
898
|
}
|
|
840
899
|
}
|
|
841
900
|
export namespace view {}
|
|
@@ -844,49 +903,55 @@ export namespace vault {
|
|
|
844
903
|
export namespace router {
|
|
845
904
|
export namespace entry {
|
|
846
905
|
export async function swapCoinForExactCoinWithSigner<T0 = any, T1 = any>(
|
|
847
|
-
client:
|
|
906
|
+
client: Aptos,
|
|
848
907
|
account: AptosAccount,
|
|
849
908
|
request: {
|
|
850
|
-
|
|
851
|
-
|
|
909
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
910
|
+
functionArguments: [bigint, bigint];
|
|
852
911
|
},
|
|
853
|
-
|
|
854
|
-
): Promise<
|
|
855
|
-
const coder = defaultMoveCoder(client.
|
|
856
|
-
const
|
|
857
|
-
sender: account.
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
return await client.
|
|
912
|
+
options?: InputGenerateTransactionOptions,
|
|
913
|
+
): Promise<PendingTransactionResponse> {
|
|
914
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
915
|
+
const transaction = await client.build.simple({
|
|
916
|
+
sender: account.accountAddress,
|
|
917
|
+
data: {
|
|
918
|
+
function:
|
|
919
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::router::swap_coin_for_exact_coin_with_signer",
|
|
920
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
921
|
+
typeArguments: request.typeArguments,
|
|
922
|
+
},
|
|
923
|
+
options,
|
|
924
|
+
});
|
|
925
|
+
return await client.signAndSubmitTransaction({
|
|
926
|
+
signer: account,
|
|
927
|
+
transaction,
|
|
928
|
+
});
|
|
867
929
|
}
|
|
868
930
|
|
|
869
931
|
export async function swapExactCoinForCoinWithSigner<T0 = any, T1 = any>(
|
|
870
|
-
client:
|
|
932
|
+
client: Aptos,
|
|
871
933
|
account: AptosAccount,
|
|
872
934
|
request: {
|
|
873
|
-
|
|
874
|
-
|
|
935
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
936
|
+
functionArguments: [bigint, bigint];
|
|
875
937
|
},
|
|
876
|
-
|
|
877
|
-
): Promise<
|
|
878
|
-
const coder = defaultMoveCoder(client.
|
|
879
|
-
const
|
|
880
|
-
sender: account.
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
return await client.
|
|
938
|
+
options?: InputGenerateTransactionOptions,
|
|
939
|
+
): Promise<PendingTransactionResponse> {
|
|
940
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
941
|
+
const transaction = await client.build.simple({
|
|
942
|
+
sender: account.accountAddress,
|
|
943
|
+
data: {
|
|
944
|
+
function:
|
|
945
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::router::swap_exact_coin_for_coin_with_signer",
|
|
946
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
947
|
+
typeArguments: request.typeArguments,
|
|
948
|
+
},
|
|
949
|
+
options,
|
|
950
|
+
});
|
|
951
|
+
return await client.signAndSubmitTransaction({
|
|
952
|
+
signer: account,
|
|
953
|
+
transaction,
|
|
954
|
+
});
|
|
890
955
|
}
|
|
891
956
|
}
|
|
892
957
|
export namespace view {}
|
|
@@ -1012,70 +1077,79 @@ export namespace aux_coin {
|
|
|
1012
1077
|
|
|
1013
1078
|
export namespace entry {
|
|
1014
1079
|
export async function initializeAuxCoin(
|
|
1015
|
-
client:
|
|
1080
|
+
client: Aptos,
|
|
1016
1081
|
account: AptosAccount,
|
|
1017
1082
|
request: {
|
|
1018
|
-
|
|
1019
|
-
|
|
1083
|
+
typeArguments: [];
|
|
1084
|
+
functionArguments: [];
|
|
1020
1085
|
},
|
|
1021
|
-
|
|
1022
|
-
): Promise<
|
|
1023
|
-
const coder = defaultMoveCoder(client.
|
|
1024
|
-
const
|
|
1025
|
-
sender: account.
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
return await client.
|
|
1086
|
+
options?: InputGenerateTransactionOptions,
|
|
1087
|
+
): Promise<PendingTransactionResponse> {
|
|
1088
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
1089
|
+
const transaction = await client.build.simple({
|
|
1090
|
+
sender: account.accountAddress,
|
|
1091
|
+
data: {
|
|
1092
|
+
function:
|
|
1093
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::aux_coin::initialize_aux_coin",
|
|
1094
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
1095
|
+
typeArguments: [],
|
|
1096
|
+
},
|
|
1097
|
+
options,
|
|
1098
|
+
});
|
|
1099
|
+
return await client.signAndSubmitTransaction({
|
|
1100
|
+
signer: account,
|
|
1101
|
+
transaction,
|
|
1102
|
+
});
|
|
1035
1103
|
}
|
|
1036
1104
|
export async function mint(
|
|
1037
|
-
client:
|
|
1105
|
+
client: Aptos,
|
|
1038
1106
|
account: AptosAccount,
|
|
1039
1107
|
request: {
|
|
1040
|
-
|
|
1041
|
-
|
|
1108
|
+
typeArguments: [];
|
|
1109
|
+
functionArguments: [MoveAddressType, bigint];
|
|
1042
1110
|
},
|
|
1043
|
-
|
|
1044
|
-
): Promise<
|
|
1045
|
-
const coder = defaultMoveCoder(client.
|
|
1046
|
-
const
|
|
1047
|
-
sender: account.
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
return await client.
|
|
1111
|
+
options?: InputGenerateTransactionOptions,
|
|
1112
|
+
): Promise<PendingTransactionResponse> {
|
|
1113
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
1114
|
+
const transaction = await client.build.simple({
|
|
1115
|
+
sender: account.accountAddress,
|
|
1116
|
+
data: {
|
|
1117
|
+
function:
|
|
1118
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::aux_coin::mint",
|
|
1119
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
1120
|
+
typeArguments: [],
|
|
1121
|
+
},
|
|
1122
|
+
options,
|
|
1123
|
+
});
|
|
1124
|
+
return await client.signAndSubmitTransaction({
|
|
1125
|
+
signer: account,
|
|
1126
|
+
transaction,
|
|
1127
|
+
});
|
|
1057
1128
|
}
|
|
1058
1129
|
export async function registerAccount(
|
|
1059
|
-
client:
|
|
1130
|
+
client: Aptos,
|
|
1060
1131
|
account: AptosAccount,
|
|
1061
1132
|
request: {
|
|
1062
|
-
|
|
1063
|
-
|
|
1133
|
+
typeArguments: [];
|
|
1134
|
+
functionArguments: [];
|
|
1064
1135
|
},
|
|
1065
|
-
|
|
1066
|
-
): Promise<
|
|
1067
|
-
const coder = defaultMoveCoder(client.
|
|
1068
|
-
const
|
|
1069
|
-
sender: account.
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
return await client.
|
|
1136
|
+
options?: InputGenerateTransactionOptions,
|
|
1137
|
+
): Promise<PendingTransactionResponse> {
|
|
1138
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
1139
|
+
const transaction = await client.build.simple({
|
|
1140
|
+
sender: account.accountAddress,
|
|
1141
|
+
data: {
|
|
1142
|
+
function:
|
|
1143
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::aux_coin::register_account",
|
|
1144
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
1145
|
+
typeArguments: [],
|
|
1146
|
+
},
|
|
1147
|
+
options,
|
|
1148
|
+
});
|
|
1149
|
+
return await client.signAndSubmitTransaction({
|
|
1150
|
+
signer: account,
|
|
1151
|
+
transaction,
|
|
1152
|
+
});
|
|
1079
1153
|
}
|
|
1080
1154
|
}
|
|
1081
1155
|
export namespace view {}
|
|
@@ -1084,7 +1158,7 @@ export namespace aux_coin {
|
|
|
1084
1158
|
export namespace authority {
|
|
1085
1159
|
export interface Authority {
|
|
1086
1160
|
signer_capability: _0x1.account.SignerCapability;
|
|
1087
|
-
owner_address:
|
|
1161
|
+
owner_address: MoveAddressType;
|
|
1088
1162
|
}
|
|
1089
1163
|
|
|
1090
1164
|
export namespace Authority {
|
|
@@ -1291,92 +1365,104 @@ export namespace fake_coin {
|
|
|
1291
1365
|
|
|
1292
1366
|
export namespace entry {
|
|
1293
1367
|
export async function burn<T0 = any>(
|
|
1294
|
-
client:
|
|
1368
|
+
client: Aptos,
|
|
1295
1369
|
account: AptosAccount,
|
|
1296
1370
|
request: {
|
|
1297
|
-
|
|
1298
|
-
|
|
1371
|
+
typeArguments: [MoveStructId];
|
|
1372
|
+
functionArguments: [bigint];
|
|
1299
1373
|
},
|
|
1300
|
-
|
|
1301
|
-
): Promise<
|
|
1302
|
-
const coder = defaultMoveCoder(client.
|
|
1303
|
-
const
|
|
1304
|
-
sender: account.
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
return await client.
|
|
1374
|
+
options?: InputGenerateTransactionOptions,
|
|
1375
|
+
): Promise<PendingTransactionResponse> {
|
|
1376
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
1377
|
+
const transaction = await client.build.simple({
|
|
1378
|
+
sender: account.accountAddress,
|
|
1379
|
+
data: {
|
|
1380
|
+
function:
|
|
1381
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::fake_coin::burn",
|
|
1382
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
1383
|
+
typeArguments: request.typeArguments,
|
|
1384
|
+
},
|
|
1385
|
+
options,
|
|
1386
|
+
});
|
|
1387
|
+
return await client.signAndSubmitTransaction({
|
|
1388
|
+
signer: account,
|
|
1389
|
+
transaction,
|
|
1390
|
+
});
|
|
1314
1391
|
}
|
|
1315
1392
|
export async function mint<T0 = any>(
|
|
1316
|
-
client:
|
|
1393
|
+
client: Aptos,
|
|
1317
1394
|
account: AptosAccount,
|
|
1318
1395
|
request: {
|
|
1319
|
-
|
|
1320
|
-
|
|
1396
|
+
typeArguments: [MoveStructId];
|
|
1397
|
+
functionArguments: [bigint];
|
|
1321
1398
|
},
|
|
1322
|
-
|
|
1323
|
-
): Promise<
|
|
1324
|
-
const coder = defaultMoveCoder(client.
|
|
1325
|
-
const
|
|
1326
|
-
sender: account.
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
return await client.
|
|
1399
|
+
options?: InputGenerateTransactionOptions,
|
|
1400
|
+
): Promise<PendingTransactionResponse> {
|
|
1401
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
1402
|
+
const transaction = await client.build.simple({
|
|
1403
|
+
sender: account.accountAddress,
|
|
1404
|
+
data: {
|
|
1405
|
+
function:
|
|
1406
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::fake_coin::mint",
|
|
1407
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
1408
|
+
typeArguments: request.typeArguments,
|
|
1409
|
+
},
|
|
1410
|
+
options,
|
|
1411
|
+
});
|
|
1412
|
+
return await client.signAndSubmitTransaction({
|
|
1413
|
+
signer: account,
|
|
1414
|
+
transaction,
|
|
1415
|
+
});
|
|
1336
1416
|
}
|
|
1337
1417
|
export async function register<T0 = any>(
|
|
1338
|
-
client:
|
|
1418
|
+
client: Aptos,
|
|
1339
1419
|
account: AptosAccount,
|
|
1340
1420
|
request: {
|
|
1341
|
-
|
|
1342
|
-
|
|
1421
|
+
typeArguments: [MoveStructId];
|
|
1422
|
+
functionArguments: [];
|
|
1343
1423
|
},
|
|
1344
|
-
|
|
1345
|
-
): Promise<
|
|
1346
|
-
const coder = defaultMoveCoder(client.
|
|
1347
|
-
const
|
|
1348
|
-
sender: account.
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
return await client.
|
|
1424
|
+
options?: InputGenerateTransactionOptions,
|
|
1425
|
+
): Promise<PendingTransactionResponse> {
|
|
1426
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
1427
|
+
const transaction = await client.build.simple({
|
|
1428
|
+
sender: account.accountAddress,
|
|
1429
|
+
data: {
|
|
1430
|
+
function:
|
|
1431
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::fake_coin::register",
|
|
1432
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
1433
|
+
typeArguments: request.typeArguments,
|
|
1434
|
+
},
|
|
1435
|
+
options,
|
|
1436
|
+
});
|
|
1437
|
+
return await client.signAndSubmitTransaction({
|
|
1438
|
+
signer: account,
|
|
1439
|
+
transaction,
|
|
1440
|
+
});
|
|
1358
1441
|
}
|
|
1359
1442
|
export async function registerAndMint<T0 = any>(
|
|
1360
|
-
client:
|
|
1443
|
+
client: Aptos,
|
|
1361
1444
|
account: AptosAccount,
|
|
1362
1445
|
request: {
|
|
1363
|
-
|
|
1364
|
-
|
|
1446
|
+
typeArguments: [MoveStructId];
|
|
1447
|
+
functionArguments: [bigint];
|
|
1365
1448
|
},
|
|
1366
|
-
|
|
1367
|
-
): Promise<
|
|
1368
|
-
const coder = defaultMoveCoder(client.
|
|
1369
|
-
const
|
|
1370
|
-
sender: account.
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
return await client.
|
|
1449
|
+
options?: InputGenerateTransactionOptions,
|
|
1450
|
+
): Promise<PendingTransactionResponse> {
|
|
1451
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
1452
|
+
const transaction = await client.build.simple({
|
|
1453
|
+
sender: account.accountAddress,
|
|
1454
|
+
data: {
|
|
1455
|
+
function:
|
|
1456
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::fake_coin::register_and_mint",
|
|
1457
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
1458
|
+
typeArguments: request.typeArguments,
|
|
1459
|
+
},
|
|
1460
|
+
options,
|
|
1461
|
+
});
|
|
1462
|
+
return await client.signAndSubmitTransaction({
|
|
1463
|
+
signer: account,
|
|
1464
|
+
transaction,
|
|
1465
|
+
});
|
|
1380
1466
|
}
|
|
1381
1467
|
}
|
|
1382
1468
|
export namespace view {}
|
|
@@ -1559,7 +1645,7 @@ export namespace clob_market {
|
|
|
1559
1645
|
quantity: bigint;
|
|
1560
1646
|
aux_au_to_burn_per_lot: bigint;
|
|
1561
1647
|
is_bid: Boolean;
|
|
1562
|
-
owner_id:
|
|
1648
|
+
owner_id: MoveAddressType;
|
|
1563
1649
|
timeout_timestamp: bigint;
|
|
1564
1650
|
order_type: bigint;
|
|
1565
1651
|
timestamp: bigint;
|
|
@@ -1636,7 +1722,7 @@ export namespace clob_market {
|
|
|
1636
1722
|
quantity: bigint;
|
|
1637
1723
|
aux_au_to_burn_per_lot: bigint;
|
|
1638
1724
|
is_bid: Boolean;
|
|
1639
|
-
owner_id:
|
|
1725
|
+
owner_id: MoveAddressType;
|
|
1640
1726
|
timeout_timestamp: bigint;
|
|
1641
1727
|
order_type: bigint;
|
|
1642
1728
|
timestamp: bigint;
|
|
@@ -1656,7 +1742,7 @@ export namespace clob_market {
|
|
|
1656
1742
|
export interface OrderCancelEvent {
|
|
1657
1743
|
order_id: bigint;
|
|
1658
1744
|
client_order_id: bigint;
|
|
1659
|
-
owner:
|
|
1745
|
+
owner: MoveAddressType;
|
|
1660
1746
|
cancel_qty: bigint;
|
|
1661
1747
|
timestamp: bigint;
|
|
1662
1748
|
order_type: bigint;
|
|
@@ -1685,7 +1771,7 @@ export namespace clob_market {
|
|
|
1685
1771
|
order_id: bigint;
|
|
1686
1772
|
client_order_id: bigint;
|
|
1687
1773
|
is_bid: Boolean;
|
|
1688
|
-
owner:
|
|
1774
|
+
owner: MoveAddressType;
|
|
1689
1775
|
base_qty: bigint;
|
|
1690
1776
|
price: bigint;
|
|
1691
1777
|
fee: bigint;
|
|
@@ -1714,7 +1800,7 @@ export namespace clob_market {
|
|
|
1714
1800
|
export interface OrderPlacedEvent {
|
|
1715
1801
|
order_id: bigint;
|
|
1716
1802
|
client_order_id: bigint;
|
|
1717
|
-
owner:
|
|
1803
|
+
owner: MoveAddressType;
|
|
1718
1804
|
is_bid: Boolean;
|
|
1719
1805
|
qty: bigint;
|
|
1720
1806
|
price: bigint;
|
|
@@ -1742,189 +1828,213 @@ export namespace clob_market {
|
|
|
1742
1828
|
|
|
1743
1829
|
export namespace entry {
|
|
1744
1830
|
export async function cancelAll<T0 = any, T1 = any>(
|
|
1745
|
-
client:
|
|
1831
|
+
client: Aptos,
|
|
1746
1832
|
account: AptosAccount,
|
|
1747
1833
|
request: {
|
|
1748
|
-
|
|
1749
|
-
|
|
1834
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
1835
|
+
functionArguments: [MoveAddressType];
|
|
1750
1836
|
},
|
|
1751
|
-
|
|
1752
|
-
): Promise<
|
|
1753
|
-
const coder = defaultMoveCoder(client.
|
|
1754
|
-
const
|
|
1755
|
-
sender: account.
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
return await client.
|
|
1837
|
+
options?: InputGenerateTransactionOptions,
|
|
1838
|
+
): Promise<PendingTransactionResponse> {
|
|
1839
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
1840
|
+
const transaction = await client.build.simple({
|
|
1841
|
+
sender: account.accountAddress,
|
|
1842
|
+
data: {
|
|
1843
|
+
function:
|
|
1844
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::clob_market::cancel_all",
|
|
1845
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
1846
|
+
typeArguments: request.typeArguments,
|
|
1847
|
+
},
|
|
1848
|
+
options,
|
|
1849
|
+
});
|
|
1850
|
+
return await client.signAndSubmitTransaction({
|
|
1851
|
+
signer: account,
|
|
1852
|
+
transaction,
|
|
1853
|
+
});
|
|
1765
1854
|
}
|
|
1766
1855
|
export async function cancelOrder<T0 = any, T1 = any>(
|
|
1767
|
-
client:
|
|
1856
|
+
client: Aptos,
|
|
1768
1857
|
account: AptosAccount,
|
|
1769
1858
|
request: {
|
|
1770
|
-
|
|
1771
|
-
|
|
1859
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
1860
|
+
functionArguments: [MoveAddressType, bigint];
|
|
1772
1861
|
},
|
|
1773
|
-
|
|
1774
|
-
): Promise<
|
|
1775
|
-
const coder = defaultMoveCoder(client.
|
|
1776
|
-
const
|
|
1777
|
-
sender: account.
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
return await client.
|
|
1862
|
+
options?: InputGenerateTransactionOptions,
|
|
1863
|
+
): Promise<PendingTransactionResponse> {
|
|
1864
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
1865
|
+
const transaction = await client.build.simple({
|
|
1866
|
+
sender: account.accountAddress,
|
|
1867
|
+
data: {
|
|
1868
|
+
function:
|
|
1869
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::clob_market::cancel_order",
|
|
1870
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
1871
|
+
typeArguments: request.typeArguments,
|
|
1872
|
+
},
|
|
1873
|
+
options,
|
|
1874
|
+
});
|
|
1875
|
+
return await client.signAndSubmitTransaction({
|
|
1876
|
+
signer: account,
|
|
1877
|
+
transaction,
|
|
1878
|
+
});
|
|
1787
1879
|
}
|
|
1788
1880
|
export async function createMarket<T0 = any, T1 = any>(
|
|
1789
|
-
client:
|
|
1881
|
+
client: Aptos,
|
|
1790
1882
|
account: AptosAccount,
|
|
1791
1883
|
request: {
|
|
1792
|
-
|
|
1793
|
-
|
|
1884
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
1885
|
+
functionArguments: [bigint, bigint];
|
|
1794
1886
|
},
|
|
1795
|
-
|
|
1796
|
-
): Promise<
|
|
1797
|
-
const coder = defaultMoveCoder(client.
|
|
1798
|
-
const
|
|
1799
|
-
sender: account.
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
return await client.
|
|
1887
|
+
options?: InputGenerateTransactionOptions,
|
|
1888
|
+
): Promise<PendingTransactionResponse> {
|
|
1889
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
1890
|
+
const transaction = await client.build.simple({
|
|
1891
|
+
sender: account.accountAddress,
|
|
1892
|
+
data: {
|
|
1893
|
+
function:
|
|
1894
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::clob_market::create_market",
|
|
1895
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
1896
|
+
typeArguments: request.typeArguments,
|
|
1897
|
+
},
|
|
1898
|
+
options,
|
|
1899
|
+
});
|
|
1900
|
+
return await client.signAndSubmitTransaction({
|
|
1901
|
+
signer: account,
|
|
1902
|
+
transaction,
|
|
1903
|
+
});
|
|
1809
1904
|
}
|
|
1810
1905
|
export async function fastCancelOrder<T0 = any, T1 = any>(
|
|
1811
|
-
client:
|
|
1906
|
+
client: Aptos,
|
|
1812
1907
|
account: AptosAccount,
|
|
1813
1908
|
request: {
|
|
1814
|
-
|
|
1815
|
-
|
|
1909
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
1910
|
+
functionArguments: [MoveAddressType, bigint, bigint, Boolean];
|
|
1816
1911
|
},
|
|
1817
|
-
|
|
1818
|
-
): Promise<
|
|
1819
|
-
const coder = defaultMoveCoder(client.
|
|
1820
|
-
const
|
|
1821
|
-
sender: account.
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
return await client.
|
|
1912
|
+
options?: InputGenerateTransactionOptions,
|
|
1913
|
+
): Promise<PendingTransactionResponse> {
|
|
1914
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
1915
|
+
const transaction = await client.build.simple({
|
|
1916
|
+
sender: account.accountAddress,
|
|
1917
|
+
data: {
|
|
1918
|
+
function:
|
|
1919
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::clob_market::fast_cancel_order",
|
|
1920
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
1921
|
+
typeArguments: request.typeArguments,
|
|
1922
|
+
},
|
|
1923
|
+
options,
|
|
1924
|
+
});
|
|
1925
|
+
return await client.signAndSubmitTransaction({
|
|
1926
|
+
signer: account,
|
|
1927
|
+
transaction,
|
|
1928
|
+
});
|
|
1831
1929
|
}
|
|
1832
1930
|
export async function loadAllOrdersIntoEvent<T0 = any, T1 = any>(
|
|
1833
|
-
client:
|
|
1931
|
+
client: Aptos,
|
|
1834
1932
|
account: AptosAccount,
|
|
1835
1933
|
request: {
|
|
1836
|
-
|
|
1837
|
-
|
|
1934
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
1935
|
+
functionArguments: [];
|
|
1838
1936
|
},
|
|
1839
|
-
|
|
1840
|
-
): Promise<
|
|
1841
|
-
const coder = defaultMoveCoder(client.
|
|
1842
|
-
const
|
|
1843
|
-
sender: account.
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
return await client.
|
|
1937
|
+
options?: InputGenerateTransactionOptions,
|
|
1938
|
+
): Promise<PendingTransactionResponse> {
|
|
1939
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
1940
|
+
const transaction = await client.build.simple({
|
|
1941
|
+
sender: account.accountAddress,
|
|
1942
|
+
data: {
|
|
1943
|
+
function:
|
|
1944
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::clob_market::load_all_orders_into_event",
|
|
1945
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
1946
|
+
typeArguments: request.typeArguments,
|
|
1947
|
+
},
|
|
1948
|
+
options,
|
|
1949
|
+
});
|
|
1950
|
+
return await client.signAndSubmitTransaction({
|
|
1951
|
+
signer: account,
|
|
1952
|
+
transaction,
|
|
1953
|
+
});
|
|
1853
1954
|
}
|
|
1854
1955
|
export async function loadMarketIntoEvent<T0 = any, T1 = any>(
|
|
1855
|
-
client:
|
|
1956
|
+
client: Aptos,
|
|
1856
1957
|
account: AptosAccount,
|
|
1857
1958
|
request: {
|
|
1858
|
-
|
|
1859
|
-
|
|
1959
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
1960
|
+
functionArguments: [];
|
|
1860
1961
|
},
|
|
1861
|
-
|
|
1862
|
-
): Promise<
|
|
1863
|
-
const coder = defaultMoveCoder(client.
|
|
1864
|
-
const
|
|
1865
|
-
sender: account.
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
return await client.
|
|
1962
|
+
options?: InputGenerateTransactionOptions,
|
|
1963
|
+
): Promise<PendingTransactionResponse> {
|
|
1964
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
1965
|
+
const transaction = await client.build.simple({
|
|
1966
|
+
sender: account.accountAddress,
|
|
1967
|
+
data: {
|
|
1968
|
+
function:
|
|
1969
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::clob_market::load_market_into_event",
|
|
1970
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
1971
|
+
typeArguments: request.typeArguments,
|
|
1972
|
+
},
|
|
1973
|
+
options,
|
|
1974
|
+
});
|
|
1975
|
+
return await client.signAndSubmitTransaction({
|
|
1976
|
+
signer: account,
|
|
1977
|
+
transaction,
|
|
1978
|
+
});
|
|
1875
1979
|
}
|
|
1876
1980
|
export async function loadOpenOrdersIntoEvent<T0 = any, T1 = any>(
|
|
1877
|
-
client:
|
|
1981
|
+
client: Aptos,
|
|
1878
1982
|
account: AptosAccount,
|
|
1879
1983
|
request: {
|
|
1880
|
-
|
|
1881
|
-
|
|
1984
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
1985
|
+
functionArguments: [];
|
|
1882
1986
|
},
|
|
1883
|
-
|
|
1884
|
-
): Promise<
|
|
1885
|
-
const coder = defaultMoveCoder(client.
|
|
1886
|
-
const
|
|
1887
|
-
sender: account.
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
return await client.
|
|
1987
|
+
options?: InputGenerateTransactionOptions,
|
|
1988
|
+
): Promise<PendingTransactionResponse> {
|
|
1989
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
1990
|
+
const transaction = await client.build.simple({
|
|
1991
|
+
sender: account.accountAddress,
|
|
1992
|
+
data: {
|
|
1993
|
+
function:
|
|
1994
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::clob_market::load_open_orders_into_event",
|
|
1995
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
1996
|
+
typeArguments: request.typeArguments,
|
|
1997
|
+
},
|
|
1998
|
+
options,
|
|
1999
|
+
});
|
|
2000
|
+
return await client.signAndSubmitTransaction({
|
|
2001
|
+
signer: account,
|
|
2002
|
+
transaction,
|
|
2003
|
+
});
|
|
1897
2004
|
}
|
|
1898
2005
|
export async function loadOpenOrdersIntoEventForAddress<T0 = any, T1 = any>(
|
|
1899
|
-
client:
|
|
2006
|
+
client: Aptos,
|
|
1900
2007
|
account: AptosAccount,
|
|
1901
2008
|
request: {
|
|
1902
|
-
|
|
1903
|
-
|
|
2009
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
2010
|
+
functionArguments: [MoveAddressType];
|
|
1904
2011
|
},
|
|
1905
|
-
|
|
1906
|
-
): Promise<
|
|
1907
|
-
const coder = defaultMoveCoder(client.
|
|
1908
|
-
const
|
|
1909
|
-
sender: account.
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
return await client.
|
|
2012
|
+
options?: InputGenerateTransactionOptions,
|
|
2013
|
+
): Promise<PendingTransactionResponse> {
|
|
2014
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2015
|
+
const transaction = await client.build.simple({
|
|
2016
|
+
sender: account.accountAddress,
|
|
2017
|
+
data: {
|
|
2018
|
+
function:
|
|
2019
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::clob_market::load_open_orders_into_event_for_address",
|
|
2020
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
2021
|
+
typeArguments: request.typeArguments,
|
|
2022
|
+
},
|
|
2023
|
+
options,
|
|
2024
|
+
});
|
|
2025
|
+
return await client.signAndSubmitTransaction({
|
|
2026
|
+
signer: account,
|
|
2027
|
+
transaction,
|
|
2028
|
+
});
|
|
1919
2029
|
}
|
|
1920
2030
|
|
|
1921
2031
|
export async function placeOrder<T0 = any, T1 = any>(
|
|
1922
|
-
client:
|
|
2032
|
+
client: Aptos,
|
|
1923
2033
|
account: AptosAccount,
|
|
1924
2034
|
request: {
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
2035
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
2036
|
+
functionArguments: [
|
|
2037
|
+
MoveAddressType,
|
|
1928
2038
|
Boolean,
|
|
1929
2039
|
bigint,
|
|
1930
2040
|
bigint,
|
|
@@ -1937,43 +2047,49 @@ export namespace clob_market {
|
|
|
1937
2047
|
bigint,
|
|
1938
2048
|
];
|
|
1939
2049
|
},
|
|
1940
|
-
|
|
1941
|
-
): Promise<
|
|
1942
|
-
const coder = defaultMoveCoder(client.
|
|
1943
|
-
const
|
|
1944
|
-
sender: account.
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
return await client.
|
|
2050
|
+
options?: InputGenerateTransactionOptions,
|
|
2051
|
+
): Promise<PendingTransactionResponse> {
|
|
2052
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2053
|
+
const transaction = await client.build.simple({
|
|
2054
|
+
sender: account.accountAddress,
|
|
2055
|
+
data: {
|
|
2056
|
+
function:
|
|
2057
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::clob_market::place_order",
|
|
2058
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
2059
|
+
typeArguments: request.typeArguments,
|
|
2060
|
+
},
|
|
2061
|
+
options,
|
|
2062
|
+
});
|
|
2063
|
+
return await client.signAndSubmitTransaction({
|
|
2064
|
+
signer: account,
|
|
2065
|
+
transaction,
|
|
2066
|
+
});
|
|
1954
2067
|
}
|
|
1955
2068
|
|
|
1956
2069
|
export async function updateMarketParameter<T0 = any, T1 = any>(
|
|
1957
|
-
client:
|
|
2070
|
+
client: Aptos,
|
|
1958
2071
|
account: AptosAccount,
|
|
1959
2072
|
request: {
|
|
1960
|
-
|
|
1961
|
-
|
|
2073
|
+
typeArguments: [MoveStructId, MoveStructId];
|
|
2074
|
+
functionArguments: [bigint, bigint];
|
|
1962
2075
|
},
|
|
1963
|
-
|
|
1964
|
-
): Promise<
|
|
1965
|
-
const coder = defaultMoveCoder(client.
|
|
1966
|
-
const
|
|
1967
|
-
sender: account.
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
return await client.
|
|
2076
|
+
options?: InputGenerateTransactionOptions,
|
|
2077
|
+
): Promise<PendingTransactionResponse> {
|
|
2078
|
+
const coder = defaultMoveCoder(client.config.fullnode);
|
|
2079
|
+
const transaction = await client.build.simple({
|
|
2080
|
+
sender: account.accountAddress,
|
|
2081
|
+
data: {
|
|
2082
|
+
function:
|
|
2083
|
+
"0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541::clob_market::update_market_parameter",
|
|
2084
|
+
functionArguments: coder.encodeArray(request.functionArguments),
|
|
2085
|
+
typeArguments: request.typeArguments,
|
|
2086
|
+
},
|
|
2087
|
+
options,
|
|
2088
|
+
});
|
|
2089
|
+
return await client.signAndSubmitTransaction({
|
|
2090
|
+
signer: account,
|
|
2091
|
+
transaction,
|
|
2092
|
+
});
|
|
1977
2093
|
}
|
|
1978
2094
|
}
|
|
1979
2095
|
export namespace view {}
|
|
@@ -2002,7 +2118,7 @@ export namespace fake_markets {
|
|
|
2002
2118
|
export namespace onchain_signer {
|
|
2003
2119
|
export interface OnchainSigner {
|
|
2004
2120
|
signer_capability: _0x1.account.SignerCapability;
|
|
2005
|
-
account_address:
|
|
2121
|
+
account_address: MoveAddressType;
|
|
2006
2122
|
}
|
|
2007
2123
|
|
|
2008
2124
|
export namespace OnchainSigner {
|