@typemove/aptos 1.2.9-rc.1 → 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.
Files changed (101) hide show
  1. package/dist/cjs/account-resource-client.d.ts +8 -15
  2. package/dist/cjs/account-resource-client.d.ts.map +1 -1
  3. package/dist/cjs/account-resource-client.js +17 -10
  4. package/dist/cjs/account-resource-client.js.map +1 -1
  5. package/dist/cjs/account-resource-client.test.js.map +1 -1
  6. package/dist/cjs/aptos-chain-adapter.d.ts +3 -4
  7. package/dist/cjs/aptos-chain-adapter.d.ts.map +1 -1
  8. package/dist/cjs/aptos-chain-adapter.js +7 -2
  9. package/dist/cjs/aptos-chain-adapter.js.map +1 -1
  10. package/dist/cjs/builtin/0x1.d.ts +1039 -961
  11. package/dist/cjs/builtin/0x1.d.ts.map +1 -1
  12. package/dist/cjs/builtin/0x1.js +2675 -1458
  13. package/dist/cjs/builtin/0x1.js.map +1 -1
  14. package/dist/cjs/builtin/0x3.d.ts +126 -83
  15. package/dist/cjs/builtin/0x3.d.ts.map +1 -1
  16. package/dist/cjs/builtin/0x3.js +203 -117
  17. package/dist/cjs/builtin/0x3.js.map +1 -1
  18. package/dist/cjs/builtin/0x4.d.ts +139 -135
  19. package/dist/cjs/builtin/0x4.d.ts.map +1 -1
  20. package/dist/cjs/builtin/0x4.js +365 -210
  21. package/dist/cjs/builtin/0x4.js.map +1 -1
  22. package/dist/cjs/client.test.js.map +1 -1
  23. package/dist/cjs/codegen/codegen.d.ts +1 -1
  24. package/dist/cjs/codegen/codegen.d.ts.map +1 -1
  25. package/dist/cjs/codegen/codegen.js +29 -23
  26. package/dist/cjs/codegen/codegen.js.map +1 -1
  27. package/dist/cjs/codegen/types.test.js.map +1 -1
  28. package/dist/cjs/models.d.ts +2 -2
  29. package/dist/cjs/models.d.ts.map +1 -1
  30. package/dist/cjs/move-coder.d.ts +4 -5
  31. package/dist/cjs/move-coder.d.ts.map +1 -1
  32. package/dist/cjs/move-coder.js +6 -3
  33. package/dist/cjs/move-coder.js.map +1 -1
  34. package/dist/cjs/move-types.d.ts +1 -11
  35. package/dist/cjs/move-types.d.ts.map +1 -1
  36. package/dist/cjs/move-types.js +11 -0
  37. package/dist/cjs/move-types.js.map +1 -1
  38. package/dist/cjs/to-internal.d.ts +1 -1
  39. package/dist/cjs/to-internal.d.ts.map +1 -1
  40. package/dist/cjs/to-internal.js +8 -8
  41. package/dist/cjs/to-internal.js.map +1 -1
  42. package/dist/esm/account-resource-client.d.ts +8 -15
  43. package/dist/esm/account-resource-client.d.ts.map +1 -1
  44. package/dist/esm/account-resource-client.js +17 -10
  45. package/dist/esm/account-resource-client.js.map +1 -1
  46. package/dist/esm/account-resource-client.test.js.map +1 -1
  47. package/dist/esm/aptos-chain-adapter.d.ts +3 -4
  48. package/dist/esm/aptos-chain-adapter.d.ts.map +1 -1
  49. package/dist/esm/aptos-chain-adapter.js +7 -2
  50. package/dist/esm/aptos-chain-adapter.js.map +1 -1
  51. package/dist/esm/builtin/0x1.d.ts +1039 -961
  52. package/dist/esm/builtin/0x1.d.ts.map +1 -1
  53. package/dist/esm/builtin/0x1.js +2675 -1458
  54. package/dist/esm/builtin/0x1.js.map +1 -1
  55. package/dist/esm/builtin/0x3.d.ts +126 -83
  56. package/dist/esm/builtin/0x3.d.ts.map +1 -1
  57. package/dist/esm/builtin/0x3.js +203 -117
  58. package/dist/esm/builtin/0x3.js.map +1 -1
  59. package/dist/esm/builtin/0x4.d.ts +139 -135
  60. package/dist/esm/builtin/0x4.d.ts.map +1 -1
  61. package/dist/esm/builtin/0x4.js +365 -210
  62. package/dist/esm/builtin/0x4.js.map +1 -1
  63. package/dist/esm/client.test.js.map +1 -1
  64. package/dist/esm/codegen/codegen.d.ts +1 -1
  65. package/dist/esm/codegen/codegen.d.ts.map +1 -1
  66. package/dist/esm/codegen/codegen.js +29 -23
  67. package/dist/esm/codegen/codegen.js.map +1 -1
  68. package/dist/esm/codegen/run.js +5 -5
  69. package/dist/esm/codegen/run.js.map +1 -1
  70. package/dist/esm/codegen/types.test.js.map +1 -1
  71. package/dist/esm/models.d.ts +2 -2
  72. package/dist/esm/models.d.ts.map +1 -1
  73. package/dist/esm/move-coder.d.ts +4 -5
  74. package/dist/esm/move-coder.d.ts.map +1 -1
  75. package/dist/esm/move-coder.js +6 -3
  76. package/dist/esm/move-coder.js.map +1 -1
  77. package/dist/esm/move-types.d.ts +1 -11
  78. package/dist/esm/move-types.d.ts.map +1 -1
  79. package/dist/esm/move-types.js +11 -0
  80. package/dist/esm/move-types.js.map +1 -1
  81. package/dist/esm/to-internal.d.ts +1 -1
  82. package/dist/esm/to-internal.d.ts.map +1 -1
  83. package/dist/esm/to-internal.js +9 -9
  84. package/dist/esm/to-internal.js.map +1 -1
  85. package/package.json +3 -3
  86. package/src/abis/0x1.json +193 -4
  87. package/src/abis/0x4.json +20 -1
  88. package/src/account-resource-client.ts +30 -19
  89. package/src/aptos-chain-adapter.ts +10 -6
  90. package/src/builtin/0x1.ts +3994 -3160
  91. package/src/builtin/0x3.ts +337 -263
  92. package/src/builtin/0x4.ts +529 -437
  93. package/src/codegen/codegen.ts +29 -26
  94. package/src/codegen/run.ts +5 -5
  95. package/src/models.ts +7 -12
  96. package/src/move-coder.ts +18 -9
  97. package/src/move-types.ts +13 -12
  98. package/src/tests/types/0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af.ts +829 -684
  99. package/src/tests/types/0x4dcae85fc5559071906cd5c76b7420fcbb4b0a92f00ab40ffc394aadbbff5ee9.ts +8 -9
  100. package/src/tests/types/0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541.ts +803 -687
  101. package/src/to-internal.ts +15 -10
@@ -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
- AptosClient,
16
- AptosAccount,
17
- TransactionBuilderRemoteABI,
18
- Types,
19
- TxnBuilderTypes,
20
- OptionalTransactionArgs,
21
- } from "aptos";
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: AptosClient,
29
+ client: Aptos,
31
30
  request: {
32
- type_arguments: [string];
31
+ typeArguments: [MoveStructId];
33
32
  },
34
33
  version?: bigint,
35
34
  ): Promise<[bigint]> {
36
- const coder = defaultMoveCoder(client.nodeUrl);
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(data, version?.toString());
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: AptosClient,
57
+ client: Aptos,
56
58
  account: AptosAccount,
57
59
  request: {
58
- type_arguments: [];
59
- arguments: [];
60
+ typeArguments: [];
61
+ functionArguments: [];
60
62
  },
61
- extraArgs?: OptionalTransactionArgs,
62
- ): Promise<Types.PendingTransaction> {
63
- const coder = defaultMoveCoder(client.nodeUrl);
64
- const builder = new TransactionBuilderRemoteABI(client, {
65
- sender: account.address(),
66
- ...extraArgs,
67
- });
68
- const txn = await builder.build(
69
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::init::initialize",
70
- request.type_arguments,
71
- coder.encodeArray(request.arguments),
72
- );
73
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
74
- return await client.submitSignedBCSTransaction(bcsTxn);
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: AptosClient,
105
+ client: Aptos,
101
106
  account: AptosAccount,
102
107
  request: {
103
- type_arguments: [];
104
- arguments: [string, string[]];
108
+ typeArguments: [];
109
+ functionArguments: [string, string[]];
105
110
  },
106
- extraArgs?: OptionalTransactionArgs,
107
- ): Promise<Types.PendingTransaction> {
108
- const coder = defaultMoveCoder(client.nodeUrl);
109
- const builder = new TransactionBuilderRemoteABI(client, {
110
- sender: account.address(),
111
- ...extraArgs,
112
- });
113
- const txn = await builder.build(
114
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::package::publish_package",
115
- request.type_arguments,
116
- coder.encodeArray(request.arguments),
117
- );
118
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
119
- return await client.submitSignedBCSTransaction(bcsTxn);
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: AptosClient,
192
+ client: Aptos,
185
193
  account: AptosAccount,
186
194
  request: {
187
- type_arguments: [];
188
- arguments: [bigint];
195
+ typeArguments: [];
196
+ functionArguments: [bigint];
189
197
  },
190
- extraArgs?: OptionalTransactionArgs,
191
- ): Promise<Types.PendingTransaction> {
192
- const coder = defaultMoveCoder(client.nodeUrl);
193
- const builder = new TransactionBuilderRemoteABI(client, {
194
- sender: account.address(),
195
- ...extraArgs,
196
- });
197
- const txn = await builder.build(
198
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::base_pool::set_swap_fee_protocol_allocation_bps",
199
- request.type_arguments,
200
- coder.encodeArray(request.arguments),
201
- );
202
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
203
- return await client.submitSignedBCSTransaction(bcsTxn);
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: AptosClient,
219
+ client: Aptos,
209
220
 
210
221
  version?: bigint,
211
222
  ): Promise<[number]> {
212
- const coder = defaultMoveCoder(client.nodeUrl);
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(data, version?.toString());
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: AptosClient,
240
+ client: Aptos,
227
241
  request: {
228
- type_arguments: [string];
242
+ typeArguments: [MoveStructId];
229
243
  },
230
244
  version?: bigint,
231
245
  ): Promise<[bigint]> {
232
- const coder = defaultMoveCoder(client.nodeUrl);
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(data, version?.toString());
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: AptosClient,
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.nodeUrl);
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(data, version?.toString());
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: Address;
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: AptosClient,
695
+ client: Aptos,
676
696
  account: AptosAccount,
677
697
  request: {
678
- type_arguments: [string, string, string, string];
679
- arguments: [bigint];
698
+ typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
699
+ functionArguments: [bigint];
680
700
  },
681
- extraArgs?: OptionalTransactionArgs,
682
- ): Promise<Types.PendingTransaction> {
683
- const coder = defaultMoveCoder(client.nodeUrl);
684
- const builder = new TransactionBuilderRemoteABI(client, {
685
- sender: account.address(),
686
- ...extraArgs,
687
- });
688
- const txn = await builder.build(
689
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::set_amp_factor",
690
- request.type_arguments,
691
- coder.encodeArray(request.arguments),
692
- );
693
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
694
- return await client.submitSignedBCSTransaction(bcsTxn);
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: AptosClient,
720
+ client: Aptos,
698
721
  account: AptosAccount,
699
722
  request: {
700
- type_arguments: [];
701
- arguments: [bigint];
723
+ typeArguments: [];
724
+ functionArguments: [bigint];
702
725
  },
703
- extraArgs?: OptionalTransactionArgs,
704
- ): Promise<Types.PendingTransaction> {
705
- const coder = defaultMoveCoder(client.nodeUrl);
706
- const builder = new TransactionBuilderRemoteABI(client, {
707
- sender: account.address(),
708
- ...extraArgs,
709
- });
710
- const txn = await builder.build(
711
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::set_default_pool_swap_fee_bps",
712
- request.type_arguments,
713
- coder.encodeArray(request.arguments),
714
- );
715
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
716
- return await client.submitSignedBCSTransaction(bcsTxn);
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: AptosClient,
750
+ client: Aptos,
725
751
  account: AptosAccount,
726
752
  request: {
727
- type_arguments: [string, string, string, string];
728
- arguments: [bigint];
753
+ typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
754
+ functionArguments: [bigint];
729
755
  },
730
- extraArgs?: OptionalTransactionArgs,
731
- ): Promise<Types.PendingTransaction> {
732
- const coder = defaultMoveCoder(client.nodeUrl);
733
- const builder = new TransactionBuilderRemoteABI(client, {
734
- sender: account.address(),
735
- ...extraArgs,
736
- });
737
- const txn = await builder.build(
738
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::set_flashloan_fee_bps",
739
- request.type_arguments,
740
- coder.encodeArray(request.arguments),
741
- );
742
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
743
- return await client.submitSignedBCSTransaction(bcsTxn);
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: AptosClient,
780
+ client: Aptos,
752
781
  account: AptosAccount,
753
782
  request: {
754
- type_arguments: [string, string, string, string];
755
- arguments: [bigint];
783
+ typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
784
+ functionArguments: [bigint];
756
785
  },
757
- extraArgs?: OptionalTransactionArgs,
758
- ): Promise<Types.PendingTransaction> {
759
- const coder = defaultMoveCoder(client.nodeUrl);
760
- const builder = new TransactionBuilderRemoteABI(client, {
761
- sender: account.address(),
762
- ...extraArgs,
763
- });
764
- const txn = await builder.build(
765
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::set_pool_swap_fee_bps",
766
- request.type_arguments,
767
- coder.encodeArray(request.arguments),
768
- );
769
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
770
- return await client.submitSignedBCSTransaction(bcsTxn);
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: AptosClient,
812
+ client: Aptos,
781
813
  request: {
782
- type_arguments: [string, string, string, string];
814
+ typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
783
815
  },
784
816
  version?: bigint,
785
817
  ): Promise<[bigint]> {
786
- const coder = defaultMoveCoder(client.nodeUrl);
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(data, version?.toString());
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: AptosClient,
840
+ client: Aptos,
806
841
  request: {
807
- type_arguments: [string, string, string, string];
842
+ typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
808
843
  },
809
844
  version?: bigint,
810
845
  ): Promise<[bigint[]]> {
811
- const coder = defaultMoveCoder(client.nodeUrl);
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(data, version?.toString());
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: AptosClient,
864
+ client: Aptos,
827
865
  request: {
828
- arguments: [bigint];
866
+ functionArguments: [bigint];
829
867
  },
830
868
  version?: bigint,
831
869
  ): Promise<[string]> {
832
- const coder = defaultMoveCoder(client.nodeUrl);
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(data, version?.toString());
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: AptosClient,
887
+ client: Aptos,
847
888
 
848
889
  version?: bigint,
849
890
  ): Promise<[bigint]> {
850
- const coder = defaultMoveCoder(client.nodeUrl);
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(data, version?.toString());
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: AptosClient,
909
+ client: Aptos,
866
910
  request: {
867
- type_arguments: [string, string, string, string];
911
+ typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
868
912
  },
869
913
  version?: bigint,
870
914
  ): Promise<[bigint]> {
871
- const coder = defaultMoveCoder(client.nodeUrl);
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(data, version?.toString());
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: AptosClient,
932
+ client: Aptos,
886
933
  request: {
887
- type_arguments: [string, string, string, string];
934
+ typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
888
935
  },
889
936
  version?: bigint,
890
937
  ): Promise<[bigint[]]> {
891
- const coder = defaultMoveCoder(client.nodeUrl);
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(data, version?.toString());
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: AptosClient,
955
+ client: Aptos,
906
956
  request: {
907
- arguments: [string];
957
+ functionArguments: [string];
908
958
  },
909
959
  version?: bigint,
910
960
  ): Promise<[bigint[], bigint, bigint]> {
911
- const coder = defaultMoveCoder(client.nodeUrl);
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(data, version?.toString());
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: AptosClient,
984
+ client: Aptos,
932
985
  request: {
933
- type_arguments: [string, string, string, string];
986
+ typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
934
987
  },
935
988
  version?: bigint,
936
989
  ): Promise<[Boolean]> {
937
- const coder = defaultMoveCoder(client.nodeUrl);
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(data, version?.toString());
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: AptosClient,
1008
+ client: Aptos,
953
1009
  request: {
954
- type_arguments: [string, string, string, string];
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.nodeUrl);
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(data, version?.toString());
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: AptosClient,
1040
+ client: Aptos,
982
1041
  account: AptosAccount,
983
1042
  request: {
984
- type_arguments: [string];
985
- arguments: [Address, bigint];
1043
+ typeArguments: [MoveStructId];
1044
+ functionArguments: [MoveAddressType, bigint];
986
1045
  },
987
- extraArgs?: OptionalTransactionArgs,
988
- ): Promise<Types.PendingTransaction> {
989
- const coder = defaultMoveCoder(client.nodeUrl);
990
- const builder = new TransactionBuilderRemoteABI(client, {
991
- sender: account.address(),
992
- ...extraArgs,
993
- });
994
- const txn = await builder.build(
995
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::fees_scripts::transfer_fee",
996
- request.type_arguments,
997
- coder.encodeArray(request.arguments),
998
- );
999
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
1000
- return await client.submitSignedBCSTransaction(bcsTxn);
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: Address;
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: AptosClient,
1862
+ client: Aptos,
1801
1863
  account: AptosAccount,
1802
1864
  request: {
1803
- type_arguments: [];
1804
- arguments: [bigint];
1865
+ typeArguments: [];
1866
+ functionArguments: [bigint];
1805
1867
  },
1806
- extraArgs?: OptionalTransactionArgs,
1807
- ): Promise<Types.PendingTransaction> {
1808
- const coder = defaultMoveCoder(client.nodeUrl);
1809
- const builder = new TransactionBuilderRemoteABI(client, {
1810
- sender: account.address(),
1811
- ...extraArgs,
1812
- });
1813
- const txn = await builder.build(
1814
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::set_default_pool_swap_fee_bps",
1815
- request.type_arguments,
1816
- coder.encodeArray(request.arguments),
1817
- );
1818
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
1819
- return await client.submitSignedBCSTransaction(bcsTxn);
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: AptosClient,
1896
+ client: Aptos,
1832
1897
  account: AptosAccount,
1833
1898
  request: {
1834
- type_arguments: [
1835
- string,
1836
- string,
1837
- string,
1838
- string,
1839
- string,
1840
- string,
1841
- string,
1842
- string,
1899
+ typeArguments: [
1900
+ MoveStructId,
1901
+ MoveStructId,
1902
+ MoveStructId,
1903
+ MoveStructId,
1904
+ MoveStructId,
1905
+ MoveStructId,
1906
+ MoveStructId,
1907
+ MoveStructId,
1843
1908
  ];
1844
- arguments: [bigint];
1909
+ functionArguments: [bigint];
1845
1910
  },
1846
- extraArgs?: OptionalTransactionArgs,
1847
- ): Promise<Types.PendingTransaction> {
1848
- const coder = defaultMoveCoder(client.nodeUrl);
1849
- const builder = new TransactionBuilderRemoteABI(client, {
1850
- sender: account.address(),
1851
- ...extraArgs,
1852
- });
1853
- const txn = await builder.build(
1854
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::set_flashloan_fee_bps",
1855
- request.type_arguments,
1856
- coder.encodeArray(request.arguments),
1857
- );
1858
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
1859
- return await client.submitSignedBCSTransaction(bcsTxn);
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: AptosClient,
1939
+ client: Aptos,
1872
1940
  account: AptosAccount,
1873
1941
  request: {
1874
- type_arguments: [
1875
- string,
1876
- string,
1877
- string,
1878
- string,
1879
- string,
1880
- string,
1881
- string,
1882
- string,
1942
+ typeArguments: [
1943
+ MoveStructId,
1944
+ MoveStructId,
1945
+ MoveStructId,
1946
+ MoveStructId,
1947
+ MoveStructId,
1948
+ MoveStructId,
1949
+ MoveStructId,
1950
+ MoveStructId,
1883
1951
  ];
1884
- arguments: [bigint];
1952
+ functionArguments: [bigint];
1885
1953
  },
1886
- extraArgs?: OptionalTransactionArgs,
1887
- ): Promise<Types.PendingTransaction> {
1888
- const coder = defaultMoveCoder(client.nodeUrl);
1889
- const builder = new TransactionBuilderRemoteABI(client, {
1890
- sender: account.address(),
1891
- ...extraArgs,
1892
- });
1893
- const txn = await builder.build(
1894
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::set_pool_swap_fee_bps",
1895
- request.type_arguments,
1896
- coder.encodeArray(request.arguments),
1897
- );
1898
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
1899
- return await client.submitSignedBCSTransaction(bcsTxn);
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: AptosClient,
1984
+ client: Aptos,
1914
1985
  request: {
1915
- type_arguments: [
1916
- string,
1917
- string,
1918
- string,
1919
- string,
1920
- string,
1921
- string,
1922
- string,
1923
- string,
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.nodeUrl);
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(data, version?.toString());
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: AptosClient,
2016
+ client: Aptos,
1943
2017
  request: {
1944
- type_arguments: [string];
2018
+ typeArguments: [MoveStructId];
1945
2019
  },
1946
2020
  version?: bigint,
1947
2021
  ): Promise<[bigint]> {
1948
- const coder = defaultMoveCoder(client.nodeUrl);
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(data, version?.toString());
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: AptosClient,
2040
+ client: Aptos,
1964
2041
  request: {
1965
- arguments: [bigint];
2042
+ functionArguments: [bigint];
1966
2043
  },
1967
2044
  version?: bigint,
1968
2045
  ): Promise<[string]> {
1969
- const coder = defaultMoveCoder(client.nodeUrl);
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(data, version?.toString());
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: AptosClient,
2063
+ client: Aptos,
1984
2064
 
1985
2065
  version?: bigint,
1986
2066
  ): Promise<[bigint]> {
1987
- const coder = defaultMoveCoder(client.nodeUrl);
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(data, version?.toString());
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: AptosClient,
2094
+ client: Aptos,
2012
2095
  request: {
2013
- type_arguments: [
2014
- string,
2015
- string,
2016
- string,
2017
- string,
2018
- string,
2019
- string,
2020
- string,
2021
- string,
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.nodeUrl);
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(data, version?.toString());
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: AptosClient,
2126
+ client: Aptos,
2041
2127
  request: {
2042
- arguments: [string];
2128
+ functionArguments: [string];
2043
2129
  },
2044
2130
  version?: bigint,
2045
2131
  ): Promise<[bigint[], bigint[], bigint]> {
2046
- const coder = defaultMoveCoder(client.nodeUrl);
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(data, version?.toString());
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: AptosClient,
2159
+ client: Aptos,
2071
2160
  request: {
2072
- type_arguments: [
2073
- string,
2074
- string,
2075
- string,
2076
- string,
2077
- string,
2078
- string,
2079
- string,
2080
- string,
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.nodeUrl);
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(data, version?.toString());
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: AptosClient,
2204
+ client: Aptos,
2113
2205
  request: {
2114
- type_arguments: [
2115
- string,
2116
- string,
2117
- string,
2118
- string,
2119
- string,
2120
- string,
2121
- string,
2122
- string,
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.nodeUrl);
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(data, version?.toString());
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: AptosClient,
2261
+ client: Aptos,
2167
2262
  account: AptosAccount,
2168
2263
  request: {
2169
- type_arguments: [
2170
- string,
2171
- string,
2172
- string,
2173
- string,
2174
- string,
2175
- string,
2176
- string,
2177
- string,
2178
- string,
2179
- string,
2180
- string,
2181
- string,
2182
- string,
2183
- string,
2184
- string,
2185
- string,
2186
- string,
2187
- string,
2188
- string,
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
- arguments: [bigint, bigint];
2285
+ functionArguments: [bigint, bigint];
2191
2286
  },
2192
- extraArgs?: OptionalTransactionArgs,
2193
- ): Promise<Types.PendingTransaction> {
2194
- const coder = defaultMoveCoder(client.nodeUrl);
2195
- const builder = new TransactionBuilderRemoteABI(client, {
2196
- sender: account.address(),
2197
- ...extraArgs,
2198
- });
2199
- const txn = await builder.build(
2200
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::multi_hop_scripts::swap_exact_in_2",
2201
- request.type_arguments,
2202
- coder.encodeArray(request.arguments),
2203
- );
2204
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
2205
- return await client.submitSignedBCSTransaction(bcsTxn);
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: AptosClient,
2335
+ client: Aptos,
2238
2336
  account: AptosAccount,
2239
2337
  request: {
2240
- type_arguments: [
2241
- string,
2242
- string,
2243
- string,
2244
- string,
2245
- string,
2246
- string,
2247
- string,
2248
- string,
2249
- string,
2250
- string,
2251
- string,
2252
- string,
2253
- string,
2254
- string,
2255
- string,
2256
- string,
2257
- string,
2258
- string,
2259
- string,
2260
- string,
2261
- string,
2262
- string,
2263
- string,
2264
- string,
2265
- string,
2266
- string,
2267
- string,
2268
- string,
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
- arguments: [bigint, bigint];
2368
+ functionArguments: [bigint, bigint];
2271
2369
  },
2272
- extraArgs?: OptionalTransactionArgs,
2273
- ): Promise<Types.PendingTransaction> {
2274
- const coder = defaultMoveCoder(client.nodeUrl);
2275
- const builder = new TransactionBuilderRemoteABI(client, {
2276
- sender: account.address(),
2277
- ...extraArgs,
2278
- });
2279
- const txn = await builder.build(
2280
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::multi_hop_scripts::swap_exact_in_3",
2281
- request.type_arguments,
2282
- coder.encodeArray(request.arguments),
2283
- );
2284
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
2285
- return await client.submitSignedBCSTransaction(bcsTxn);
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: AptosClient,
2395
+ client: Aptos,
2295
2396
  account: AptosAccount,
2296
2397
  request: {
2297
- type_arguments: [string, string, string, string];
2298
- arguments: [bigint, bigint, bigint, bigint];
2398
+ typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
2399
+ functionArguments: [bigint, bigint, bigint, bigint];
2299
2400
  },
2300
- extraArgs?: OptionalTransactionArgs,
2301
- ): Promise<Types.PendingTransaction> {
2302
- const coder = defaultMoveCoder(client.nodeUrl);
2303
- const builder = new TransactionBuilderRemoteABI(client, {
2304
- sender: account.address(),
2305
- ...extraArgs,
2306
- });
2307
- const txn = await builder.build(
2308
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool_scripts::add_liquidity",
2309
- request.type_arguments,
2310
- coder.encodeArray(request.arguments),
2311
- );
2312
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
2313
- return await client.submitSignedBCSTransaction(bcsTxn);
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: AptosClient,
2425
+ client: Aptos,
2322
2426
  account: AptosAccount,
2323
2427
  request: {
2324
- type_arguments: [string, string, string, string];
2325
- arguments: [bigint, bigint, bigint, bigint, bigint];
2428
+ typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
2429
+ functionArguments: [bigint, bigint, bigint, bigint, bigint];
2326
2430
  },
2327
- extraArgs?: OptionalTransactionArgs,
2328
- ): Promise<Types.PendingTransaction> {
2329
- const coder = defaultMoveCoder(client.nodeUrl);
2330
- const builder = new TransactionBuilderRemoteABI(client, {
2331
- sender: account.address(),
2332
- ...extraArgs,
2333
- });
2334
- const txn = await builder.build(
2335
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool_scripts::create_stable_pool",
2336
- request.type_arguments,
2337
- coder.encodeArray(request.arguments),
2338
- );
2339
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
2340
- return await client.submitSignedBCSTransaction(bcsTxn);
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: AptosClient,
2455
+ client: Aptos,
2349
2456
  account: AptosAccount,
2350
2457
  request: {
2351
- type_arguments: [string, string, string, string];
2352
- arguments: [bigint, bigint, bigint, bigint, bigint];
2458
+ typeArguments: [MoveStructId, MoveStructId, MoveStructId, MoveStructId];
2459
+ functionArguments: [bigint, bigint, bigint, bigint, bigint];
2353
2460
  },
2354
- extraArgs?: OptionalTransactionArgs,
2355
- ): Promise<Types.PendingTransaction> {
2356
- const coder = defaultMoveCoder(client.nodeUrl);
2357
- const builder = new TransactionBuilderRemoteABI(client, {
2358
- sender: account.address(),
2359
- ...extraArgs,
2360
- });
2361
- const txn = await builder.build(
2362
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool_scripts::remove_liquidity",
2363
- request.type_arguments,
2364
- coder.encodeArray(request.arguments),
2365
- );
2366
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
2367
- return await client.submitSignedBCSTransaction(bcsTxn);
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: AptosClient,
2487
+ client: Aptos,
2378
2488
  account: AptosAccount,
2379
2489
  request: {
2380
- type_arguments: [string, string, string, string, string, string];
2381
- arguments: [bigint, bigint];
2490
+ typeArguments: [
2491
+ MoveStructId,
2492
+ MoveStructId,
2493
+ MoveStructId,
2494
+ MoveStructId,
2495
+ MoveStructId,
2496
+ MoveStructId,
2497
+ ];
2498
+ functionArguments: [bigint, bigint];
2382
2499
  },
2383
- extraArgs?: OptionalTransactionArgs,
2384
- ): Promise<Types.PendingTransaction> {
2385
- const coder = defaultMoveCoder(client.nodeUrl);
2386
- const builder = new TransactionBuilderRemoteABI(client, {
2387
- sender: account.address(),
2388
- ...extraArgs,
2389
- });
2390
- const txn = await builder.build(
2391
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool_scripts::swap_exact_in",
2392
- request.type_arguments,
2393
- coder.encodeArray(request.arguments),
2394
- );
2395
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
2396
- return await client.submitSignedBCSTransaction(bcsTxn);
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: AptosClient,
2526
+ client: Aptos,
2407
2527
  account: AptosAccount,
2408
2528
  request: {
2409
- type_arguments: [string, string, string, string, string, string];
2410
- arguments: [bigint, bigint];
2529
+ typeArguments: [
2530
+ MoveStructId,
2531
+ MoveStructId,
2532
+ MoveStructId,
2533
+ MoveStructId,
2534
+ MoveStructId,
2535
+ MoveStructId,
2536
+ ];
2537
+ functionArguments: [bigint, bigint];
2411
2538
  },
2412
- extraArgs?: OptionalTransactionArgs,
2413
- ): Promise<Types.PendingTransaction> {
2414
- const coder = defaultMoveCoder(client.nodeUrl);
2415
- const builder = new TransactionBuilderRemoteABI(client, {
2416
- sender: account.address(),
2417
- ...extraArgs,
2418
- });
2419
- const txn = await builder.build(
2420
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool_scripts::swap_exact_out",
2421
- request.type_arguments,
2422
- coder.encodeArray(request.arguments),
2423
- );
2424
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
2425
- return await client.submitSignedBCSTransaction(bcsTxn);
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: AptosClient,
2573
+ client: Aptos,
2444
2574
  account: AptosAccount,
2445
2575
  request: {
2446
- type_arguments: [
2447
- string,
2448
- string,
2449
- string,
2450
- string,
2451
- string,
2452
- string,
2453
- string,
2454
- string,
2576
+ typeArguments: [
2577
+ MoveStructId,
2578
+ MoveStructId,
2579
+ MoveStructId,
2580
+ MoveStructId,
2581
+ MoveStructId,
2582
+ MoveStructId,
2583
+ MoveStructId,
2584
+ MoveStructId,
2455
2585
  ];
2456
- arguments: [
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
- extraArgs?: OptionalTransactionArgs,
2468
- ): Promise<Types.PendingTransaction> {
2469
- const coder = defaultMoveCoder(client.nodeUrl);
2470
- const builder = new TransactionBuilderRemoteABI(client, {
2471
- sender: account.address(),
2472
- ...extraArgs,
2473
- });
2474
- const txn = await builder.build(
2475
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool_scripts::add_liquidity",
2476
- request.type_arguments,
2477
- coder.encodeArray(request.arguments),
2478
- );
2479
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
2480
- return await client.submitSignedBCSTransaction(bcsTxn);
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: AptosClient,
2625
+ client: Aptos,
2493
2626
  account: AptosAccount,
2494
2627
  request: {
2495
- type_arguments: [
2496
- string,
2497
- string,
2498
- string,
2499
- string,
2500
- string,
2501
- string,
2502
- string,
2503
- string,
2628
+ typeArguments: [
2629
+ MoveStructId,
2630
+ MoveStructId,
2631
+ MoveStructId,
2632
+ MoveStructId,
2633
+ MoveStructId,
2634
+ MoveStructId,
2635
+ MoveStructId,
2636
+ MoveStructId,
2504
2637
  ];
2505
- arguments: [bigint, bigint, bigint, bigint];
2638
+ functionArguments: [bigint, bigint, bigint, bigint];
2506
2639
  },
2507
- extraArgs?: OptionalTransactionArgs,
2508
- ): Promise<Types.PendingTransaction> {
2509
- const coder = defaultMoveCoder(client.nodeUrl);
2510
- const builder = new TransactionBuilderRemoteABI(client, {
2511
- sender: account.address(),
2512
- ...extraArgs,
2513
- });
2514
- const txn = await builder.build(
2515
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool_scripts::create_weighted_pool",
2516
- request.type_arguments,
2517
- coder.encodeArray(request.arguments),
2518
- );
2519
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
2520
- return await client.submitSignedBCSTransaction(bcsTxn);
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: AptosClient,
2668
+ client: Aptos,
2533
2669
  account: AptosAccount,
2534
2670
  request: {
2535
- type_arguments: [
2536
- string,
2537
- string,
2538
- string,
2539
- string,
2540
- string,
2541
- string,
2542
- string,
2543
- string,
2671
+ typeArguments: [
2672
+ MoveStructId,
2673
+ MoveStructId,
2674
+ MoveStructId,
2675
+ MoveStructId,
2676
+ MoveStructId,
2677
+ MoveStructId,
2678
+ MoveStructId,
2679
+ MoveStructId,
2544
2680
  ];
2545
- arguments: [bigint, bigint, bigint, bigint, bigint];
2681
+ functionArguments: [bigint, bigint, bigint, bigint, bigint];
2546
2682
  },
2547
- extraArgs?: OptionalTransactionArgs,
2548
- ): Promise<Types.PendingTransaction> {
2549
- const coder = defaultMoveCoder(client.nodeUrl);
2550
- const builder = new TransactionBuilderRemoteABI(client, {
2551
- sender: account.address(),
2552
- ...extraArgs,
2553
- });
2554
- const txn = await builder.build(
2555
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool_scripts::remove_liquidity",
2556
- request.type_arguments,
2557
- coder.encodeArray(request.arguments),
2558
- );
2559
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
2560
- return await client.submitSignedBCSTransaction(bcsTxn);
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: AptosClient,
2713
+ client: Aptos,
2575
2714
  account: AptosAccount,
2576
2715
  request: {
2577
- type_arguments: [
2578
- string,
2579
- string,
2580
- string,
2581
- string,
2582
- string,
2583
- string,
2584
- string,
2585
- string,
2586
- string,
2587
- string,
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
- arguments: [bigint, bigint];
2728
+ functionArguments: [bigint, bigint];
2590
2729
  },
2591
- extraArgs?: OptionalTransactionArgs,
2592
- ): Promise<Types.PendingTransaction> {
2593
- const coder = defaultMoveCoder(client.nodeUrl);
2594
- const builder = new TransactionBuilderRemoteABI(client, {
2595
- sender: account.address(),
2596
- ...extraArgs,
2597
- });
2598
- const txn = await builder.build(
2599
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool_scripts::swap_exact_in",
2600
- request.type_arguments,
2601
- coder.encodeArray(request.arguments),
2602
- );
2603
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
2604
- return await client.submitSignedBCSTransaction(bcsTxn);
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: AptosClient,
2760
+ client: Aptos,
2619
2761
  account: AptosAccount,
2620
2762
  request: {
2621
- type_arguments: [
2622
- string,
2623
- string,
2624
- string,
2625
- string,
2626
- string,
2627
- string,
2628
- string,
2629
- string,
2630
- string,
2631
- string,
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
- arguments: [bigint, bigint];
2775
+ functionArguments: [bigint, bigint];
2634
2776
  },
2635
- extraArgs?: OptionalTransactionArgs,
2636
- ): Promise<Types.PendingTransaction> {
2637
- const coder = defaultMoveCoder(client.nodeUrl);
2638
- const builder = new TransactionBuilderRemoteABI(client, {
2639
- sender: account.address(),
2640
- ...extraArgs,
2641
- });
2642
- const txn = await builder.build(
2643
- "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool_scripts::swap_exact_out",
2644
- request.type_arguments,
2645
- coder.encodeArray(request.arguments),
2646
- );
2647
- const bcsTxn = AptosClient.generateBCSTransaction(account, txn);
2648
- return await client.submitSignedBCSTransaction(bcsTxn);
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 {}