@sentio/sdk 1.20.2 → 1.21.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 (189) hide show
  1. package/lib/aptos/aptos-processor.d.ts +16 -15
  2. package/lib/aptos/aptos-processor.js +65 -13
  3. package/lib/aptos/aptos-processor.js.map +1 -1
  4. package/lib/aptos/bind-options.d.ts +0 -6
  5. package/lib/aptos/bind-options.js +1 -8
  6. package/lib/aptos/bind-options.js.map +1 -1
  7. package/lib/aptos/context.d.ts +5 -4
  8. package/lib/aptos/context.js +9 -6
  9. package/lib/aptos/context.js.map +1 -1
  10. package/lib/aptos/index.d.ts +3 -2
  11. package/lib/aptos/index.js +1 -2
  12. package/lib/aptos/index.js.map +1 -1
  13. package/lib/aptos/runtime.d.ts +2 -0
  14. package/lib/aptos/runtime.js +16 -0
  15. package/lib/aptos/runtime.js.map +1 -0
  16. package/lib/aptos/types.d.ts +28 -0
  17. package/lib/aptos/types.js +159 -0
  18. package/lib/aptos/types.js.map +1 -0
  19. package/lib/aptos/utils.d.ts +6 -0
  20. package/lib/aptos/utils.js +19 -0
  21. package/lib/aptos/utils.js.map +1 -0
  22. package/lib/aptos-codegen/codegen.d.ts +5 -2
  23. package/lib/aptos-codegen/codegen.js +195 -17
  24. package/lib/aptos-codegen/codegen.js.map +1 -1
  25. package/lib/aptos-codegen/typegen.d.ts +18 -0
  26. package/lib/aptos-codegen/typegen.js +196 -0
  27. package/lib/aptos-codegen/typegen.js.map +1 -0
  28. package/lib/binds.d.ts +2 -3
  29. package/lib/binds.js +6 -33
  30. package/lib/binds.js.map +1 -1
  31. package/lib/builtin/aptos/0x1.d.ts +1624 -0
  32. package/lib/builtin/aptos/0x1.js +2570 -0
  33. package/lib/builtin/aptos/0x1.js.map +1 -0
  34. package/lib/builtin/aptos/0x3.d.ts +414 -0
  35. package/lib/builtin/aptos/0x3.js +474 -0
  36. package/lib/builtin/aptos/0x3.js.map +1 -0
  37. package/lib/builtin/internal/eacaggregatorproxy_processor.d.ts +2 -2
  38. package/lib/builtin/internal/eacaggregatorproxy_processor.js +12 -11
  39. package/lib/builtin/internal/eacaggregatorproxy_processor.js.map +1 -1
  40. package/lib/builtin/internal/erc20_processor.d.ts +2 -2
  41. package/lib/builtin/internal/erc20_processor.js +12 -11
  42. package/lib/builtin/internal/erc20_processor.js.map +1 -1
  43. package/lib/builtin/internal/erc20bytes_processor.d.ts +2 -2
  44. package/lib/builtin/internal/erc20bytes_processor.js +12 -11
  45. package/lib/builtin/internal/erc20bytes_processor.js.map +1 -1
  46. package/lib/builtin/internal/weth9_processor.d.ts +2 -2
  47. package/lib/builtin/internal/weth9_processor.js +12 -11
  48. package/lib/builtin/internal/weth9_processor.js.map +1 -1
  49. package/lib/builtin/solana/types.d.ts +5 -5
  50. package/lib/builtin/solana/wormhole-processor.d.ts +6 -6
  51. package/lib/builtin/solana/wormhole-processor.js +15 -12
  52. package/lib/builtin/solana/wormhole-processor.js.map +1 -1
  53. package/lib/cli/build.js +17 -16
  54. package/lib/cli/build.js.map +1 -1
  55. package/lib/core/base-processor-template.d.ts +7 -7
  56. package/lib/core/base-processor-template.js.map +1 -1
  57. package/lib/core/base-processor.d.ts +5 -6
  58. package/lib/core/base-processor.js +6 -4
  59. package/lib/core/base-processor.js.map +1 -1
  60. package/lib/core/big-decimal.d.ts +1 -0
  61. package/lib/core/big-decimal.js +6 -0
  62. package/lib/core/big-decimal.js.map +1 -0
  63. package/lib/core/bind-options.d.ts +0 -2
  64. package/lib/core/bind-options.js +4 -4
  65. package/lib/core/bind-options.js.map +1 -1
  66. package/lib/core/context.d.ts +14 -11
  67. package/lib/core/context.js +28 -19
  68. package/lib/core/context.js.map +1 -1
  69. package/lib/core/generic-processor.js +5 -5
  70. package/lib/core/generic-processor.js.map +1 -1
  71. package/lib/core/index.d.ts +5 -5
  72. package/lib/core/index.js +6 -6
  73. package/lib/core/index.js.map +1 -1
  74. package/lib/core/logger.d.ts +2 -3
  75. package/lib/core/logger.js +6 -6
  76. package/lib/core/logger.js.map +1 -1
  77. package/lib/core/metadata.d.ts +7 -4
  78. package/lib/core/metadata.js +13 -10
  79. package/lib/core/metadata.js.map +1 -1
  80. package/lib/core/meter.d.ts +4 -7
  81. package/lib/core/meter.js +12 -13
  82. package/lib/core/meter.js.map +1 -1
  83. package/lib/core/solana-processor.d.ts +7 -4
  84. package/lib/core/solana-processor.js +14 -20
  85. package/lib/core/solana-processor.js.map +1 -1
  86. package/lib/core/sui-processor.d.ts +5 -4
  87. package/lib/core/sui-processor.js +10 -17
  88. package/lib/core/sui-processor.js.map +1 -1
  89. package/lib/error.d.ts +2 -2
  90. package/lib/error.js.map +1 -1
  91. package/lib/gen/processor/protos/processor.d.ts +24 -12
  92. package/lib/gen/processor/protos/processor.js +147 -58
  93. package/lib/gen/processor/protos/processor.js.map +1 -1
  94. package/lib/index.d.ts +1 -2
  95. package/lib/index.js +1 -4
  96. package/lib/index.js.map +1 -1
  97. package/lib/processor-state.d.ts +1 -1
  98. package/lib/processor-state.js.map +1 -1
  99. package/lib/service.js +15 -13
  100. package/lib/service.js.map +1 -1
  101. package/lib/target-ethers-sentio/codegen.js +14 -15
  102. package/lib/target-ethers-sentio/codegen.js.map +1 -1
  103. package/lib/test-abi-code-gen.js.map +1 -1
  104. package/lib/testing/metric-utils.js +2 -2
  105. package/lib/testing/metric-utils.js.map +1 -1
  106. package/lib/tests/aptos.test.js +95 -2
  107. package/lib/tests/aptos.test.js.map +1 -1
  108. package/lib/tests/erc20.js +1 -1
  109. package/lib/tests/erc20.js.map +1 -1
  110. package/lib/tests/erc20.test.js +3 -4
  111. package/lib/tests/erc20.test.js.map +1 -1
  112. package/lib/tests/solana.test.js +5 -1
  113. package/lib/tests/solana.test.js.map +1 -1
  114. package/lib/tests/souffl3.js +17 -4
  115. package/lib/tests/souffl3.js.map +1 -1
  116. package/lib/tests/sui.test.js +1 -4
  117. package/lib/tests/sui.test.js.map +1 -1
  118. package/lib/tests/types/aptos/souffle.d.ts +311 -22
  119. package/lib/tests/types/aptos/souffle.js +172 -20
  120. package/lib/tests/types/aptos/souffle.js.map +1 -1
  121. package/lib/tests/types/solana/basic_1_processor.d.ts +2 -2
  122. package/lib/tests/types/solana/basic_1_processor.js +4 -4
  123. package/lib/tests/types/solana/basic_1_processor.js.map +1 -1
  124. package/lib/tests/wormhole-token-bridge.js +2 -1
  125. package/lib/tests/wormhole-token-bridge.js.map +1 -1
  126. package/lib/utils/chain.d.ts +1 -0
  127. package/lib/utils/chain.js +15 -1
  128. package/lib/utils/chain.js.map +1 -1
  129. package/lib/utils/conversion.d.ts +1 -1
  130. package/lib/utils/conversion.js.map +1 -1
  131. package/package.json +3 -2
  132. package/src/abis/aptos/0x1.json +9205 -0
  133. package/src/abis/aptos/0x3.json +1515 -0
  134. package/src/aptos/aptos-processor.ts +89 -25
  135. package/src/aptos/bind-options.ts +0 -7
  136. package/src/aptos/context.ts +11 -8
  137. package/src/aptos/index.ts +3 -2
  138. package/src/aptos/runtime.ts +13 -0
  139. package/src/aptos/types.ts +203 -0
  140. package/src/aptos/utils.ts +18 -0
  141. package/src/aptos-codegen/codegen.ts +222 -18
  142. package/src/aptos-codegen/typegen.test.ts +29 -0
  143. package/src/aptos-codegen/typegen.ts +216 -0
  144. package/src/binds.ts +5 -39
  145. package/src/builtin/aptos/0x1.ts +3917 -0
  146. package/src/builtin/aptos/0x3.ts +824 -0
  147. package/src/builtin/internal/eacaggregatorproxy_processor.ts +14 -31
  148. package/src/builtin/internal/erc20_processor.ts +14 -25
  149. package/src/builtin/internal/erc20bytes_processor.ts +14 -25
  150. package/src/builtin/internal/weth9_processor.ts +14 -25
  151. package/src/builtin/solana/wormhole-processor.ts +21 -18
  152. package/src/cli/build.ts +19 -17
  153. package/src/core/base-processor-template.ts +7 -7
  154. package/src/core/base-processor.ts +30 -9
  155. package/src/core/big-decimal.ts +1 -0
  156. package/src/core/bind-options.ts +3 -2
  157. package/src/core/context.ts +40 -24
  158. package/src/core/generic-processor.ts +6 -7
  159. package/src/core/index.ts +5 -5
  160. package/src/core/logger.ts +7 -7
  161. package/src/core/metadata.ts +14 -12
  162. package/src/core/meter.ts +12 -14
  163. package/src/core/solana-processor.ts +24 -21
  164. package/src/core/sui-processor.ts +10 -21
  165. package/src/error.ts +2 -2
  166. package/src/gen/processor/protos/processor.ts +177 -69
  167. package/src/index.ts +1 -2
  168. package/src/processor-state.ts +1 -1
  169. package/src/service.ts +23 -16
  170. package/src/target-ethers-sentio/codegen.ts +14 -15
  171. package/src/test-abi-code-gen.ts +1 -0
  172. package/src/testing/metric-utils.ts +2 -2
  173. package/src/tests/aptos.test.ts +102 -3
  174. package/src/tests/erc20.test.ts +3 -4
  175. package/src/tests/erc20.ts +1 -1
  176. package/src/tests/solana.test.ts +5 -1
  177. package/src/tests/souffl3.ts +21 -6
  178. package/src/tests/sui.test.ts +1 -4
  179. package/src/tests/types/aptos/souffle.ts +470 -56
  180. package/src/tests/types/solana/basic_1_processor.ts +6 -6
  181. package/src/tests/wormhole-token-bridge.ts +2 -1
  182. package/src/types/global.d.ts +1 -1
  183. package/src/utils/chain.ts +14 -0
  184. package/src/utils/conversion.ts +1 -1
  185. package/lib/contract-namer.d.ts +0 -6
  186. package/lib/contract-namer.js +0 -20
  187. package/lib/contract-namer.js.map +0 -1
  188. package/src/aptos-codegen/codgen.test.ts +0 -11
  189. package/src/contract-namer.ts +0 -17
@@ -0,0 +1,824 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ /* Generated modules for account 0x3 */
6
+
7
+ import { aptos } from "@sentio/sdk";
8
+ import { Address, MoveModule } from "aptos/src/generated";
9
+
10
+ import { table, event, simple_map, type_info } from "./0x1";
11
+
12
+ export class token extends aptos.AptosBaseProcessor {
13
+ constructor(options: aptos.AptosBindOptions) {
14
+ super("token", options);
15
+ }
16
+ static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
17
+ address: "0x3",
18
+ network: aptos.AptosNetwork.TEST_NET,
19
+ };
20
+
21
+ static bind(options: Partial<aptos.AptosBindOptions> = {}): token {
22
+ return new token({ ...token.DEFAULT_OPTIONS, ...options });
23
+ }
24
+
25
+ onEntryBurn(
26
+ func: (call: token.BurnPayload, ctx: aptos.AptosContext) => void,
27
+ filter?: aptos.CallFilter
28
+ ): token {
29
+ this.onEntryFunctionCall(func, {
30
+ ...filter,
31
+ function: "token::burn",
32
+ });
33
+ return this;
34
+ }
35
+
36
+ onEntryBurnByCreator(
37
+ func: (call: token.BurnByCreatorPayload, ctx: aptos.AptosContext) => void,
38
+ filter?: aptos.CallFilter
39
+ ): token {
40
+ this.onEntryFunctionCall(func, {
41
+ ...filter,
42
+ function: "token::burn_by_creator",
43
+ });
44
+ return this;
45
+ }
46
+
47
+ onEntryCreateCollectionScript(
48
+ func: (
49
+ call: token.CreateCollectionScriptPayload,
50
+ ctx: aptos.AptosContext
51
+ ) => void,
52
+ filter?: aptos.CallFilter
53
+ ): token {
54
+ this.onEntryFunctionCall(func, {
55
+ ...filter,
56
+ function: "token::create_collection_script",
57
+ });
58
+ return this;
59
+ }
60
+
61
+ onEntryCreateTokenScript(
62
+ func: (
63
+ call: token.CreateTokenScriptPayload,
64
+ ctx: aptos.AptosContext
65
+ ) => void,
66
+ filter?: aptos.CallFilter
67
+ ): token {
68
+ this.onEntryFunctionCall(func, {
69
+ ...filter,
70
+ function: "token::create_token_script",
71
+ });
72
+ return this;
73
+ }
74
+
75
+ onEntryDirectTransferScript(
76
+ func: (
77
+ call: token.DirectTransferScriptPayload,
78
+ ctx: aptos.AptosContext
79
+ ) => void,
80
+ filter?: aptos.CallFilter
81
+ ): token {
82
+ this.onEntryFunctionCall(func, {
83
+ ...filter,
84
+ function: "token::direct_transfer_script",
85
+ });
86
+ return this;
87
+ }
88
+
89
+ onEntryInitializeTokenScript(
90
+ func: (
91
+ call: token.InitializeTokenScriptPayload,
92
+ ctx: aptos.AptosContext
93
+ ) => void,
94
+ filter?: aptos.CallFilter
95
+ ): token {
96
+ this.onEntryFunctionCall(func, {
97
+ ...filter,
98
+ function: "token::initialize_token_script",
99
+ });
100
+ return this;
101
+ }
102
+
103
+ onEntryMintScript(
104
+ func: (call: token.MintScriptPayload, ctx: aptos.AptosContext) => void,
105
+ filter?: aptos.CallFilter
106
+ ): token {
107
+ this.onEntryFunctionCall(func, {
108
+ ...filter,
109
+ function: "token::mint_script",
110
+ });
111
+ return this;
112
+ }
113
+
114
+ onEntryMutateTokenProperties(
115
+ func: (
116
+ call: token.MutateTokenPropertiesPayload,
117
+ ctx: aptos.AptosContext
118
+ ) => void,
119
+ filter?: aptos.CallFilter
120
+ ): token {
121
+ this.onEntryFunctionCall(func, {
122
+ ...filter,
123
+ function: "token::mutate_token_properties",
124
+ });
125
+ return this;
126
+ }
127
+
128
+ onEntryOptInDirectTransfer(
129
+ func: (
130
+ call: token.OptInDirectTransferPayload,
131
+ ctx: aptos.AptosContext
132
+ ) => void,
133
+ filter?: aptos.CallFilter
134
+ ): token {
135
+ this.onEntryFunctionCall(func, {
136
+ ...filter,
137
+ function: "token::opt_in_direct_transfer",
138
+ });
139
+ return this;
140
+ }
141
+
142
+ onEventBurnTokenEvent(
143
+ func: (event: token.BurnTokenEventInstance, ctx: aptos.AptosContext) => void
144
+ ): token {
145
+ this.onEvent(func, {
146
+ type: "token::BurnTokenEvent",
147
+ });
148
+ return this;
149
+ }
150
+
151
+ onEventCreateCollectionEvent(
152
+ func: (
153
+ event: token.CreateCollectionEventInstance,
154
+ ctx: aptos.AptosContext
155
+ ) => void
156
+ ): token {
157
+ this.onEvent(func, {
158
+ type: "token::CreateCollectionEvent",
159
+ });
160
+ return this;
161
+ }
162
+
163
+ onEventCreateTokenDataEvent(
164
+ func: (
165
+ event: token.CreateTokenDataEventInstance,
166
+ ctx: aptos.AptosContext
167
+ ) => void
168
+ ): token {
169
+ this.onEvent(func, {
170
+ type: "token::CreateTokenDataEvent",
171
+ });
172
+ return this;
173
+ }
174
+
175
+ onEventDepositEvent(
176
+ func: (event: token.DepositEventInstance, ctx: aptos.AptosContext) => void
177
+ ): token {
178
+ this.onEvent(func, {
179
+ type: "token::DepositEvent",
180
+ });
181
+ return this;
182
+ }
183
+
184
+ onEventMintTokenEvent(
185
+ func: (event: token.MintTokenEventInstance, ctx: aptos.AptosContext) => void
186
+ ): token {
187
+ this.onEvent(func, {
188
+ type: "token::MintTokenEvent",
189
+ });
190
+ return this;
191
+ }
192
+
193
+ onEventMutateTokenPropertyMapEvent(
194
+ func: (
195
+ event: token.MutateTokenPropertyMapEventInstance,
196
+ ctx: aptos.AptosContext
197
+ ) => void
198
+ ): token {
199
+ this.onEvent(func, {
200
+ type: "token::MutateTokenPropertyMapEvent",
201
+ });
202
+ return this;
203
+ }
204
+
205
+ onEventWithdrawEvent(
206
+ func: (event: token.WithdrawEventInstance, ctx: aptos.AptosContext) => void
207
+ ): token {
208
+ this.onEvent(func, {
209
+ type: "token::WithdrawEvent",
210
+ });
211
+ return this;
212
+ }
213
+
214
+ loadTypesInternal(registry: aptos.TypeRegistry) {
215
+ loadAllTypes(registry);
216
+ }
217
+ }
218
+
219
+ export namespace token {
220
+ export class BurnTokenEvent {
221
+ id: token.TokenId;
222
+ amount: bigint;
223
+ }
224
+
225
+ export interface BurnTokenEventInstance
226
+ extends aptos.TypedEventInstance<BurnTokenEvent> {
227
+ data_typed: BurnTokenEvent;
228
+ }
229
+
230
+ export class CollectionData {
231
+ description: string;
232
+ name: string;
233
+ uri: string;
234
+ supply: bigint;
235
+ maximum: bigint;
236
+ mutability_config: token.CollectionMutabilityConfig;
237
+ }
238
+
239
+ export class CollectionMutabilityConfig {
240
+ description: Boolean;
241
+ uri: Boolean;
242
+ maximum: Boolean;
243
+ }
244
+
245
+ export class Collections {
246
+ collection_data: table.Table<string, token.CollectionData>;
247
+ token_data: table.Table<token.TokenDataId, token.TokenData>;
248
+ create_collection_events: event.EventHandle<token.CreateCollectionEvent>;
249
+ create_token_data_events: event.EventHandle<token.CreateTokenDataEvent>;
250
+ mint_token_events: event.EventHandle<token.MintTokenEvent>;
251
+ }
252
+
253
+ export class CreateCollectionEvent {
254
+ creator: Address;
255
+ collection_name: string;
256
+ uri: string;
257
+ description: string;
258
+ maximum: bigint;
259
+ }
260
+
261
+ export interface CreateCollectionEventInstance
262
+ extends aptos.TypedEventInstance<CreateCollectionEvent> {
263
+ data_typed: CreateCollectionEvent;
264
+ }
265
+
266
+ export class CreateTokenDataEvent {
267
+ id: token.TokenDataId;
268
+ description: string;
269
+ maximum: bigint;
270
+ uri: string;
271
+ royalty_payee_address: Address;
272
+ royalty_points_denominator: bigint;
273
+ royalty_points_numerator: bigint;
274
+ name: string;
275
+ mutability_config: token.TokenMutabilityConfig;
276
+ property_keys: string[];
277
+ property_values: string[];
278
+ property_types: string[];
279
+ }
280
+
281
+ export interface CreateTokenDataEventInstance
282
+ extends aptos.TypedEventInstance<CreateTokenDataEvent> {
283
+ data_typed: CreateTokenDataEvent;
284
+ }
285
+
286
+ export class DepositEvent {
287
+ id: token.TokenId;
288
+ amount: bigint;
289
+ }
290
+
291
+ export interface DepositEventInstance
292
+ extends aptos.TypedEventInstance<DepositEvent> {
293
+ data_typed: DepositEvent;
294
+ }
295
+
296
+ export class MintTokenEvent {
297
+ id: token.TokenDataId;
298
+ amount: bigint;
299
+ }
300
+
301
+ export interface MintTokenEventInstance
302
+ extends aptos.TypedEventInstance<MintTokenEvent> {
303
+ data_typed: MintTokenEvent;
304
+ }
305
+
306
+ export class MutateTokenPropertyMapEvent {
307
+ old_id: token.TokenId;
308
+ new_id: token.TokenId;
309
+ keys: string[];
310
+ values: string[];
311
+ types: string[];
312
+ }
313
+
314
+ export interface MutateTokenPropertyMapEventInstance
315
+ extends aptos.TypedEventInstance<MutateTokenPropertyMapEvent> {
316
+ data_typed: MutateTokenPropertyMapEvent;
317
+ }
318
+
319
+ export class Royalty {
320
+ royalty_points_numerator: bigint;
321
+ royalty_points_denominator: bigint;
322
+ payee_address: Address;
323
+ }
324
+
325
+ export class Token {
326
+ id: token.TokenId;
327
+ amount: bigint;
328
+ token_properties: property_map.PropertyMap;
329
+ }
330
+
331
+ export class TokenData {
332
+ maximum: bigint;
333
+ largest_property_version: bigint;
334
+ supply: bigint;
335
+ uri: string;
336
+ royalty: token.Royalty;
337
+ name: string;
338
+ description: string;
339
+ default_properties: property_map.PropertyMap;
340
+ mutability_config: token.TokenMutabilityConfig;
341
+ }
342
+
343
+ export class TokenDataId {
344
+ creator: Address;
345
+ collection: string;
346
+ name: string;
347
+ }
348
+
349
+ export class TokenId {
350
+ token_data_id: token.TokenDataId;
351
+ property_version: bigint;
352
+ }
353
+
354
+ export class TokenMutabilityConfig {
355
+ maximum: Boolean;
356
+ uri: Boolean;
357
+ royalty: Boolean;
358
+ description: Boolean;
359
+ properties: Boolean;
360
+ }
361
+
362
+ export class TokenStore {
363
+ tokens: table.Table<token.TokenId, token.Token>;
364
+ direct_transfer: Boolean;
365
+ deposit_events: event.EventHandle<token.DepositEvent>;
366
+ withdraw_events: event.EventHandle<token.WithdrawEvent>;
367
+ burn_events: event.EventHandle<token.BurnTokenEvent>;
368
+ mutate_token_property_events: event.EventHandle<token.MutateTokenPropertyMapEvent>;
369
+ }
370
+
371
+ export class WithdrawCapability {
372
+ token_owner: Address;
373
+ token_id: token.TokenId;
374
+ amount: bigint;
375
+ expiration_sec: bigint;
376
+ }
377
+
378
+ export class WithdrawEvent {
379
+ id: token.TokenId;
380
+ amount: bigint;
381
+ }
382
+
383
+ export interface WithdrawEventInstance
384
+ extends aptos.TypedEventInstance<WithdrawEvent> {
385
+ data_typed: WithdrawEvent;
386
+ }
387
+
388
+ export interface BurnPayload
389
+ extends aptos.TypedEntryFunctionPayload<
390
+ [Address, string, string, bigint, bigint]
391
+ > {
392
+ arguments_typed: [Address, string, string, bigint, bigint];
393
+ }
394
+
395
+ export interface BurnByCreatorPayload
396
+ extends aptos.TypedEntryFunctionPayload<
397
+ [Address, string, string, bigint, bigint]
398
+ > {
399
+ arguments_typed: [Address, string, string, bigint, bigint];
400
+ }
401
+
402
+ export interface CreateCollectionScriptPayload
403
+ extends aptos.TypedEntryFunctionPayload<
404
+ [string, string, string, bigint, Boolean[]]
405
+ > {
406
+ arguments_typed: [string, string, string, bigint, Boolean[]];
407
+ }
408
+
409
+ export interface CreateTokenScriptPayload
410
+ extends aptos.TypedEntryFunctionPayload<
411
+ [
412
+ string,
413
+ string,
414
+ string,
415
+ bigint,
416
+ bigint,
417
+ string,
418
+ Address,
419
+ bigint,
420
+ bigint,
421
+ Boolean[],
422
+ string[],
423
+ string[],
424
+ string[]
425
+ ]
426
+ > {
427
+ arguments_typed: [
428
+ string,
429
+ string,
430
+ string,
431
+ bigint,
432
+ bigint,
433
+ string,
434
+ Address,
435
+ bigint,
436
+ bigint,
437
+ Boolean[],
438
+ string[],
439
+ string[],
440
+ string[]
441
+ ];
442
+ }
443
+
444
+ export interface DirectTransferScriptPayload
445
+ extends aptos.TypedEntryFunctionPayload<
446
+ [Address, Address, string, string, bigint, bigint]
447
+ > {
448
+ arguments_typed: [Address, Address, string, string, bigint, bigint];
449
+ }
450
+
451
+ export interface InitializeTokenScriptPayload
452
+ extends aptos.TypedEntryFunctionPayload<[]> {
453
+ arguments_typed: [];
454
+ }
455
+
456
+ export interface MintScriptPayload
457
+ extends aptos.TypedEntryFunctionPayload<[Address, string, string, bigint]> {
458
+ arguments_typed: [Address, string, string, bigint];
459
+ }
460
+
461
+ export interface MutateTokenPropertiesPayload
462
+ extends aptos.TypedEntryFunctionPayload<
463
+ [
464
+ Address,
465
+ Address,
466
+ string,
467
+ string,
468
+ bigint,
469
+ bigint,
470
+ string[],
471
+ string[],
472
+ string[]
473
+ ]
474
+ > {
475
+ arguments_typed: [
476
+ Address,
477
+ Address,
478
+ string,
479
+ string,
480
+ bigint,
481
+ bigint,
482
+ string[],
483
+ string[],
484
+ string[]
485
+ ];
486
+ }
487
+
488
+ export interface OptInDirectTransferPayload
489
+ extends aptos.TypedEntryFunctionPayload<[Boolean]> {
490
+ arguments_typed: [Boolean];
491
+ }
492
+
493
+ export function loadTypes(registry: aptos.TypeRegistry) {
494
+ loadAllTypes(registry);
495
+ }
496
+ export const ABI: MoveModule = JSON.parse(
497
+ '{"address":"0x3","name":"token","friends":[],"exposed_functions":[{"name":"balance_of","visibility":"public","is_entry":false,"generic_type_params":[],"params":["address","0x3::token::TokenId"],"return":["u64"]},{"name":"burn","visibility":"public","is_entry":true,"generic_type_params":[],"params":["&signer","address","0x1::string::String","0x1::string::String","u64","u64"],"return":[]},{"name":"burn_by_creator","visibility":"public","is_entry":true,"generic_type_params":[],"params":["&signer","address","0x1::string::String","0x1::string::String","u64","u64"],"return":[]},{"name":"check_collection_exists","visibility":"public","is_entry":false,"generic_type_params":[],"params":["address","0x1::string::String"],"return":["bool"]},{"name":"check_tokendata_exists","visibility":"public","is_entry":false,"generic_type_params":[],"params":["address","0x1::string::String","0x1::string::String"],"return":["bool"]},{"name":"create_collection","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&signer","0x1::string::String","0x1::string::String","0x1::string::String","u64","vector<bool>"],"return":[]},{"name":"create_collection_mutability_config","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&vector<bool>"],"return":["0x3::token::CollectionMutabilityConfig"]},{"name":"create_collection_script","visibility":"public","is_entry":true,"generic_type_params":[],"params":["&signer","0x1::string::String","0x1::string::String","0x1::string::String","u64","vector<bool>"],"return":[]},{"name":"create_token_data_id","visibility":"public","is_entry":false,"generic_type_params":[],"params":["address","0x1::string::String","0x1::string::String"],"return":["0x3::token::TokenDataId"]},{"name":"create_token_id","visibility":"public","is_entry":false,"generic_type_params":[],"params":["0x3::token::TokenDataId","u64"],"return":["0x3::token::TokenId"]},{"name":"create_token_id_raw","visibility":"public","is_entry":false,"generic_type_params":[],"params":["address","0x1::string::String","0x1::string::String","u64"],"return":["0x3::token::TokenId"]},{"name":"create_token_mutability_config","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&vector<bool>"],"return":["0x3::token::TokenMutabilityConfig"]},{"name":"create_token_script","visibility":"public","is_entry":true,"generic_type_params":[],"params":["&signer","0x1::string::String","0x1::string::String","0x1::string::String","u64","u64","0x1::string::String","address","u64","u64","vector<bool>","vector<0x1::string::String>","vector<vector<u8>>","vector<0x1::string::String>"],"return":[]},{"name":"create_tokendata","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&signer","0x1::string::String","0x1::string::String","0x1::string::String","u64","0x1::string::String","address","u64","u64","0x3::token::TokenMutabilityConfig","vector<0x1::string::String>","vector<vector<u8>>","vector<0x1::string::String>"],"return":["0x3::token::TokenDataId"]},{"name":"create_withdraw_capability","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&signer","0x3::token::TokenId","u64","u64"],"return":["0x3::token::WithdrawCapability"]},{"name":"deposit_token","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&signer","0x3::token::Token"],"return":[]},{"name":"direct_deposit_with_opt_in","visibility":"public","is_entry":false,"generic_type_params":[],"params":["address","0x3::token::Token"],"return":[]},{"name":"direct_transfer","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&signer","&signer","0x3::token::TokenId","u64"],"return":[]},{"name":"direct_transfer_script","visibility":"public","is_entry":true,"generic_type_params":[],"params":["&signer","&signer","address","0x1::string::String","0x1::string::String","u64","u64"],"return":[]},{"name":"get_collection_supply","visibility":"public","is_entry":false,"generic_type_params":[],"params":["address","0x1::string::String"],"return":["0x1::option::Option<u64>"]},{"name":"get_property_map","visibility":"public","is_entry":false,"generic_type_params":[],"params":["address","0x3::token::TokenId"],"return":["0x3::property_map::PropertyMap"]},{"name":"get_royalty","visibility":"public","is_entry":false,"generic_type_params":[],"params":["0x3::token::TokenId"],"return":["0x3::token::Royalty"]},{"name":"get_royalty_denominator","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&0x3::token::Royalty"],"return":["u64"]},{"name":"get_royalty_numerator","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&0x3::token::Royalty"],"return":["u64"]},{"name":"get_royalty_payee","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&0x3::token::Royalty"],"return":["address"]},{"name":"get_token_amount","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&0x3::token::Token"],"return":["u64"]},{"name":"get_token_data_id_fields","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&0x3::token::TokenDataId"],"return":["address","0x1::string::String","0x1::string::String"]},{"name":"get_token_id","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&0x3::token::Token"],"return":["0x3::token::TokenId"]},{"name":"get_token_id_fields","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&0x3::token::TokenId"],"return":["address","0x1::string::String","0x1::string::String","u64"]},{"name":"get_token_supply","visibility":"public","is_entry":false,"generic_type_params":[],"params":["address","0x3::token::TokenDataId"],"return":["0x1::option::Option<u64>"]},{"name":"get_tokendata_largest_property_version","visibility":"public","is_entry":false,"generic_type_params":[],"params":["address","0x3::token::TokenDataId"],"return":["u64"]},{"name":"get_tokendata_uri","visibility":"public","is_entry":false,"generic_type_params":[],"params":["address","0x3::token::TokenDataId"],"return":["0x1::string::String"]},{"name":"has_token_store","visibility":"public","is_entry":false,"generic_type_params":[],"params":["address"],"return":["bool"]},{"name":"initialize_token","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&signer","0x3::token::TokenId"],"return":[]},{"name":"initialize_token_script","visibility":"public","is_entry":true,"generic_type_params":[],"params":["&signer"],"return":[]},{"name":"initialize_token_store","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&signer"],"return":[]},{"name":"merge","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&mut 0x3::token::Token","0x3::token::Token"],"return":[]},{"name":"mint_script","visibility":"public","is_entry":true,"generic_type_params":[],"params":["&signer","address","0x1::string::String","0x1::string::String","u64"],"return":[]},{"name":"mint_token","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&signer","0x3::token::TokenDataId","u64"],"return":["0x3::token::TokenId"]},{"name":"mint_token_to","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&signer","address","0x3::token::TokenDataId","u64"],"return":[]},{"name":"mutate_one_token","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&signer","address","0x3::token::TokenId","vector<0x1::string::String>","vector<vector<u8>>","vector<0x1::string::String>"],"return":["0x3::token::TokenId"]},{"name":"mutate_token_properties","visibility":"public","is_entry":true,"generic_type_params":[],"params":["&signer","address","address","0x1::string::String","0x1::string::String","u64","u64","vector<0x1::string::String>","vector<vector<u8>>","vector<0x1::string::String>"],"return":[]},{"name":"mutate_tokendata_property","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&signer","0x3::token::TokenDataId","vector<0x1::string::String>","vector<vector<u8>>","vector<0x1::string::String>"],"return":[]},{"name":"mutate_tokendata_uri","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&signer","0x3::token::TokenDataId","0x1::string::String"],"return":[]},{"name":"opt_in_direct_transfer","visibility":"public","is_entry":true,"generic_type_params":[],"params":["&signer","bool"],"return":[]},{"name":"split","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&mut 0x3::token::Token","u64"],"return":["0x3::token::Token"]},{"name":"token_id","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&0x3::token::Token"],"return":["&0x3::token::TokenId"]},{"name":"transfer","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&signer","0x3::token::TokenId","address","u64"],"return":[]},{"name":"withdraw_token","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&signer","0x3::token::TokenId","u64"],"return":["0x3::token::Token"]},{"name":"withdraw_with_capability","visibility":"public","is_entry":false,"generic_type_params":[],"params":["0x3::token::WithdrawCapability"],"return":["0x3::token::Token"]}],"structs":[{"name":"BurnTokenEvent","is_native":false,"abilities":["drop","store"],"generic_type_params":[],"fields":[{"name":"id","type":"0x3::token::TokenId"},{"name":"amount","type":"u64"}]},{"name":"CollectionData","is_native":false,"abilities":["store"],"generic_type_params":[],"fields":[{"name":"description","type":"0x1::string::String"},{"name":"name","type":"0x1::string::String"},{"name":"uri","type":"0x1::string::String"},{"name":"supply","type":"u64"},{"name":"maximum","type":"u64"},{"name":"mutability_config","type":"0x3::token::CollectionMutabilityConfig"}]},{"name":"CollectionMutabilityConfig","is_native":false,"abilities":["copy","drop","store"],"generic_type_params":[],"fields":[{"name":"description","type":"bool"},{"name":"uri","type":"bool"},{"name":"maximum","type":"bool"}]},{"name":"Collections","is_native":false,"abilities":["key"],"generic_type_params":[],"fields":[{"name":"collection_data","type":"0x1::table::Table<0x1::string::String, 0x3::token::CollectionData>"},{"name":"token_data","type":"0x1::table::Table<0x3::token::TokenDataId, 0x3::token::TokenData>"},{"name":"create_collection_events","type":"0x1::event::EventHandle<0x3::token::CreateCollectionEvent>"},{"name":"create_token_data_events","type":"0x1::event::EventHandle<0x3::token::CreateTokenDataEvent>"},{"name":"mint_token_events","type":"0x1::event::EventHandle<0x3::token::MintTokenEvent>"}]},{"name":"CreateCollectionEvent","is_native":false,"abilities":["drop","store"],"generic_type_params":[],"fields":[{"name":"creator","type":"address"},{"name":"collection_name","type":"0x1::string::String"},{"name":"uri","type":"0x1::string::String"},{"name":"description","type":"0x1::string::String"},{"name":"maximum","type":"u64"}]},{"name":"CreateTokenDataEvent","is_native":false,"abilities":["drop","store"],"generic_type_params":[],"fields":[{"name":"id","type":"0x3::token::TokenDataId"},{"name":"description","type":"0x1::string::String"},{"name":"maximum","type":"u64"},{"name":"uri","type":"0x1::string::String"},{"name":"royalty_payee_address","type":"address"},{"name":"royalty_points_denominator","type":"u64"},{"name":"royalty_points_numerator","type":"u64"},{"name":"name","type":"0x1::string::String"},{"name":"mutability_config","type":"0x3::token::TokenMutabilityConfig"},{"name":"property_keys","type":"vector<0x1::string::String>"},{"name":"property_values","type":"vector<vector<u8>>"},{"name":"property_types","type":"vector<0x1::string::String>"}]},{"name":"DepositEvent","is_native":false,"abilities":["drop","store"],"generic_type_params":[],"fields":[{"name":"id","type":"0x3::token::TokenId"},{"name":"amount","type":"u64"}]},{"name":"MintTokenEvent","is_native":false,"abilities":["drop","store"],"generic_type_params":[],"fields":[{"name":"id","type":"0x3::token::TokenDataId"},{"name":"amount","type":"u64"}]},{"name":"MutateTokenPropertyMapEvent","is_native":false,"abilities":["drop","store"],"generic_type_params":[],"fields":[{"name":"old_id","type":"0x3::token::TokenId"},{"name":"new_id","type":"0x3::token::TokenId"},{"name":"keys","type":"vector<0x1::string::String>"},{"name":"values","type":"vector<vector<u8>>"},{"name":"types","type":"vector<0x1::string::String>"}]},{"name":"Royalty","is_native":false,"abilities":["copy","drop","store"],"generic_type_params":[],"fields":[{"name":"royalty_points_numerator","type":"u64"},{"name":"royalty_points_denominator","type":"u64"},{"name":"payee_address","type":"address"}]},{"name":"Token","is_native":false,"abilities":["store"],"generic_type_params":[],"fields":[{"name":"id","type":"0x3::token::TokenId"},{"name":"amount","type":"u64"},{"name":"token_properties","type":"0x3::property_map::PropertyMap"}]},{"name":"TokenData","is_native":false,"abilities":["store"],"generic_type_params":[],"fields":[{"name":"maximum","type":"u64"},{"name":"largest_property_version","type":"u64"},{"name":"supply","type":"u64"},{"name":"uri","type":"0x1::string::String"},{"name":"royalty","type":"0x3::token::Royalty"},{"name":"name","type":"0x1::string::String"},{"name":"description","type":"0x1::string::String"},{"name":"default_properties","type":"0x3::property_map::PropertyMap"},{"name":"mutability_config","type":"0x3::token::TokenMutabilityConfig"}]},{"name":"TokenDataId","is_native":false,"abilities":["copy","drop","store"],"generic_type_params":[],"fields":[{"name":"creator","type":"address"},{"name":"collection","type":"0x1::string::String"},{"name":"name","type":"0x1::string::String"}]},{"name":"TokenId","is_native":false,"abilities":["copy","drop","store"],"generic_type_params":[],"fields":[{"name":"token_data_id","type":"0x3::token::TokenDataId"},{"name":"property_version","type":"u64"}]},{"name":"TokenMutabilityConfig","is_native":false,"abilities":["copy","drop","store"],"generic_type_params":[],"fields":[{"name":"maximum","type":"bool"},{"name":"uri","type":"bool"},{"name":"royalty","type":"bool"},{"name":"description","type":"bool"},{"name":"properties","type":"bool"}]},{"name":"TokenStore","is_native":false,"abilities":["key"],"generic_type_params":[],"fields":[{"name":"tokens","type":"0x1::table::Table<0x3::token::TokenId, 0x3::token::Token>"},{"name":"direct_transfer","type":"bool"},{"name":"deposit_events","type":"0x1::event::EventHandle<0x3::token::DepositEvent>"},{"name":"withdraw_events","type":"0x1::event::EventHandle<0x3::token::WithdrawEvent>"},{"name":"burn_events","type":"0x1::event::EventHandle<0x3::token::BurnTokenEvent>"},{"name":"mutate_token_property_events","type":"0x1::event::EventHandle<0x3::token::MutateTokenPropertyMapEvent>"}]},{"name":"WithdrawCapability","is_native":false,"abilities":["drop","store"],"generic_type_params":[],"fields":[{"name":"token_owner","type":"address"},{"name":"token_id","type":"0x3::token::TokenId"},{"name":"amount","type":"u64"},{"name":"expiration_sec","type":"u64"}]},{"name":"WithdrawEvent","is_native":false,"abilities":["drop","store"],"generic_type_params":[],"fields":[{"name":"id","type":"0x3::token::TokenId"},{"name":"amount","type":"u64"}]}]}'
498
+ );
499
+ }
500
+
501
+ export namespace property_map {
502
+ export class PropertyMap {
503
+ map: simple_map.SimpleMap<string, property_map.PropertyValue>;
504
+ }
505
+
506
+ export class PropertyValue {
507
+ value: string;
508
+ type: string;
509
+ }
510
+
511
+ export function loadTypes(registry: aptos.TypeRegistry) {
512
+ loadAllTypes(registry);
513
+ }
514
+ export const ABI: MoveModule = JSON.parse(
515
+ '{"address":"0x3","name":"property_map","friends":[],"exposed_functions":[{"name":"add","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&mut 0x3::property_map::PropertyMap","0x1::string::String","0x3::property_map::PropertyValue"],"return":[]},{"name":"borrow","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&0x3::property_map::PropertyMap","&0x1::string::String"],"return":["&0x3::property_map::PropertyValue"]},{"name":"borrow_type","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&0x3::property_map::PropertyValue"],"return":["0x1::string::String"]},{"name":"borrow_value","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&0x3::property_map::PropertyValue"],"return":["vector<u8>"]},{"name":"contains_key","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&0x3::property_map::PropertyMap","&0x1::string::String"],"return":["bool"]},{"name":"create_property_value","visibility":"public","is_entry":false,"generic_type_params":[{"constraints":["copy"]}],"params":["&T0"],"return":["0x3::property_map::PropertyValue"]},{"name":"create_property_value_raw","visibility":"public","is_entry":false,"generic_type_params":[],"params":["vector<u8>","0x1::string::String"],"return":["0x3::property_map::PropertyValue"]},{"name":"empty","visibility":"public","is_entry":false,"generic_type_params":[],"params":[],"return":["0x3::property_map::PropertyMap"]},{"name":"length","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&0x3::property_map::PropertyMap"],"return":["u64"]},{"name":"new","visibility":"public","is_entry":false,"generic_type_params":[],"params":["vector<0x1::string::String>","vector<vector<u8>>","vector<0x1::string::String>"],"return":["0x3::property_map::PropertyMap"]},{"name":"read_address","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&0x3::property_map::PropertyMap","&0x1::string::String"],"return":["address"]},{"name":"read_bool","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&0x3::property_map::PropertyMap","&0x1::string::String"],"return":["bool"]},{"name":"read_string","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&0x3::property_map::PropertyMap","&0x1::string::String"],"return":["0x1::string::String"]},{"name":"read_u128","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&0x3::property_map::PropertyMap","&0x1::string::String"],"return":["u128"]},{"name":"read_u64","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&0x3::property_map::PropertyMap","&0x1::string::String"],"return":["u64"]},{"name":"read_u8","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&0x3::property_map::PropertyMap","&0x1::string::String"],"return":["u8"]},{"name":"remove","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&mut 0x3::property_map::PropertyMap","&0x1::string::String"],"return":["0x1::string::String","0x3::property_map::PropertyValue"]},{"name":"update_property_map","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&mut 0x3::property_map::PropertyMap","vector<0x1::string::String>","vector<vector<u8>>","vector<0x1::string::String>"],"return":[]},{"name":"update_property_value","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&mut 0x3::property_map::PropertyMap","&0x1::string::String","0x3::property_map::PropertyValue"],"return":[]}],"structs":[{"name":"PropertyMap","is_native":false,"abilities":["copy","drop","store"],"generic_type_params":[],"fields":[{"name":"map","type":"0x1::simple_map::SimpleMap<0x1::string::String, 0x3::property_map::PropertyValue>"}]},{"name":"PropertyValue","is_native":false,"abilities":["copy","drop","store"],"generic_type_params":[],"fields":[{"name":"value","type":"vector<u8>"},{"name":"type","type":"0x1::string::String"}]}]}'
516
+ );
517
+ }
518
+
519
+ export class token_coin_swap extends aptos.AptosBaseProcessor {
520
+ constructor(options: aptos.AptosBindOptions) {
521
+ super("token_coin_swap", options);
522
+ }
523
+ static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
524
+ address: "0x3",
525
+ network: aptos.AptosNetwork.TEST_NET,
526
+ };
527
+
528
+ static bind(options: Partial<aptos.AptosBindOptions> = {}): token_coin_swap {
529
+ return new token_coin_swap({
530
+ ...token_coin_swap.DEFAULT_OPTIONS,
531
+ ...options,
532
+ });
533
+ }
534
+
535
+ onEntryListTokenForSwap<T0>(
536
+ func: (
537
+ call: token_coin_swap.ListTokenForSwapPayload<T0>,
538
+ ctx: aptos.AptosContext
539
+ ) => void,
540
+ filter?: aptos.CallFilter
541
+ ): token_coin_swap {
542
+ this.onEntryFunctionCall(func, {
543
+ ...filter,
544
+ function: "token_coin_swap::list_token_for_swap",
545
+ });
546
+ return this;
547
+ }
548
+
549
+ onEventTokenListingEvent(
550
+ func: (
551
+ event: token_coin_swap.TokenListingEventInstance,
552
+ ctx: aptos.AptosContext
553
+ ) => void
554
+ ): token_coin_swap {
555
+ this.onEvent(func, {
556
+ type: "token_coin_swap::TokenListingEvent",
557
+ });
558
+ return this;
559
+ }
560
+
561
+ onEventTokenSwapEvent(
562
+ func: (
563
+ event: token_coin_swap.TokenSwapEventInstance,
564
+ ctx: aptos.AptosContext
565
+ ) => void
566
+ ): token_coin_swap {
567
+ this.onEvent(func, {
568
+ type: "token_coin_swap::TokenSwapEvent",
569
+ });
570
+ return this;
571
+ }
572
+
573
+ loadTypesInternal(registry: aptos.TypeRegistry) {
574
+ loadAllTypes(registry);
575
+ }
576
+ }
577
+
578
+ export namespace token_coin_swap {
579
+ export class TokenCoinSwap<T0> {
580
+ token_amount: bigint;
581
+ min_price_per_token: bigint;
582
+ }
583
+
584
+ export class TokenEscrow {
585
+ token: token.Token;
586
+ locked_until_secs: bigint;
587
+ }
588
+
589
+ export class TokenListingEvent {
590
+ token_id: token.TokenId;
591
+ amount: bigint;
592
+ min_price: bigint;
593
+ locked_until_secs: bigint;
594
+ coin_type_info: type_info.TypeInfo;
595
+ }
596
+
597
+ export interface TokenListingEventInstance
598
+ extends aptos.TypedEventInstance<TokenListingEvent> {
599
+ data_typed: TokenListingEvent;
600
+ }
601
+
602
+ export class TokenListings<T0> {
603
+ listings: table.Table<token.TokenId, token_coin_swap.TokenCoinSwap<T0>>;
604
+ listing_events: event.EventHandle<token_coin_swap.TokenListingEvent>;
605
+ swap_events: event.EventHandle<token_coin_swap.TokenSwapEvent>;
606
+ }
607
+
608
+ export class TokenStoreEscrow {
609
+ token_escrows: table.Table<token.TokenId, token_coin_swap.TokenEscrow>;
610
+ }
611
+
612
+ export class TokenSwapEvent {
613
+ token_id: token.TokenId;
614
+ token_buyer: Address;
615
+ token_amount: bigint;
616
+ coin_amount: bigint;
617
+ coin_type_info: type_info.TypeInfo;
618
+ }
619
+
620
+ export interface TokenSwapEventInstance
621
+ extends aptos.TypedEventInstance<TokenSwapEvent> {
622
+ data_typed: TokenSwapEvent;
623
+ }
624
+
625
+ export interface ListTokenForSwapPayload<T0>
626
+ extends aptos.TypedEntryFunctionPayload<
627
+ [Address, string, string, bigint, bigint, bigint, bigint]
628
+ > {
629
+ arguments_typed: [Address, string, string, bigint, bigint, bigint, bigint];
630
+ }
631
+
632
+ export function loadTypes(registry: aptos.TypeRegistry) {
633
+ loadAllTypes(registry);
634
+ }
635
+ export const ABI: MoveModule = JSON.parse(
636
+ '{"address":"0x3","name":"token_coin_swap","friends":[],"exposed_functions":[{"name":"cancel_token_listing","visibility":"public","is_entry":false,"generic_type_params":[{"constraints":[]}],"params":["&signer","0x3::token::TokenId","u64"],"return":[]},{"name":"deposit_token_to_escrow","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&signer","0x3::token::TokenId","0x3::token::Token","u64"],"return":[]},{"name":"does_listing_exist","visibility":"public","is_entry":false,"generic_type_params":[{"constraints":[]}],"params":["address","0x3::token::TokenId"],"return":["bool"]},{"name":"exchange_coin_for_token","visibility":"public","is_entry":false,"generic_type_params":[{"constraints":[]}],"params":["&signer","u64","address","address","0x1::string::String","0x1::string::String","u64","u64"],"return":[]},{"name":"list_token_for_swap","visibility":"public","is_entry":true,"generic_type_params":[{"constraints":[]}],"params":["&signer","address","0x1::string::String","0x1::string::String","u64","u64","u64","u64"],"return":[]},{"name":"withdraw_token_from_escrow","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&signer","0x3::token::TokenId","u64"],"return":["0x3::token::Token"]}],"structs":[{"name":"TokenCoinSwap","is_native":false,"abilities":["drop","store"],"generic_type_params":[{"constraints":[]}],"fields":[{"name":"token_amount","type":"u64"},{"name":"min_price_per_token","type":"u64"}]},{"name":"TokenEscrow","is_native":false,"abilities":["store"],"generic_type_params":[],"fields":[{"name":"token","type":"0x3::token::Token"},{"name":"locked_until_secs","type":"u64"}]},{"name":"TokenListingEvent","is_native":false,"abilities":["drop","store"],"generic_type_params":[],"fields":[{"name":"token_id","type":"0x3::token::TokenId"},{"name":"amount","type":"u64"},{"name":"min_price","type":"u64"},{"name":"locked_until_secs","type":"u64"},{"name":"coin_type_info","type":"0x1::type_info::TypeInfo"}]},{"name":"TokenListings","is_native":false,"abilities":["key"],"generic_type_params":[{"constraints":[]}],"fields":[{"name":"listings","type":"0x1::table::Table<0x3::token::TokenId, 0x3::token_coin_swap::TokenCoinSwap<T0>>"},{"name":"listing_events","type":"0x1::event::EventHandle<0x3::token_coin_swap::TokenListingEvent>"},{"name":"swap_events","type":"0x1::event::EventHandle<0x3::token_coin_swap::TokenSwapEvent>"}]},{"name":"TokenStoreEscrow","is_native":false,"abilities":["key"],"generic_type_params":[],"fields":[{"name":"token_escrows","type":"0x1::table::Table<0x3::token::TokenId, 0x3::token_coin_swap::TokenEscrow>"}]},{"name":"TokenSwapEvent","is_native":false,"abilities":["drop","store"],"generic_type_params":[],"fields":[{"name":"token_id","type":"0x3::token::TokenId"},{"name":"token_buyer","type":"address"},{"name":"token_amount","type":"u64"},{"name":"coin_amount","type":"u64"},{"name":"coin_type_info","type":"0x1::type_info::TypeInfo"}]}]}'
637
+ );
638
+ }
639
+
640
+ export class token_transfers extends aptos.AptosBaseProcessor {
641
+ constructor(options: aptos.AptosBindOptions) {
642
+ super("token_transfers", options);
643
+ }
644
+ static DEFAULT_OPTIONS: aptos.AptosBindOptions = {
645
+ address: "0x3",
646
+ network: aptos.AptosNetwork.TEST_NET,
647
+ };
648
+
649
+ static bind(options: Partial<aptos.AptosBindOptions> = {}): token_transfers {
650
+ return new token_transfers({
651
+ ...token_transfers.DEFAULT_OPTIONS,
652
+ ...options,
653
+ });
654
+ }
655
+
656
+ onEntryCancelOfferScript(
657
+ func: (
658
+ call: token_transfers.CancelOfferScriptPayload,
659
+ ctx: aptos.AptosContext
660
+ ) => void,
661
+ filter?: aptos.CallFilter
662
+ ): token_transfers {
663
+ this.onEntryFunctionCall(func, {
664
+ ...filter,
665
+ function: "token_transfers::cancel_offer_script",
666
+ });
667
+ return this;
668
+ }
669
+
670
+ onEntryClaimScript(
671
+ func: (
672
+ call: token_transfers.ClaimScriptPayload,
673
+ ctx: aptos.AptosContext
674
+ ) => void,
675
+ filter?: aptos.CallFilter
676
+ ): token_transfers {
677
+ this.onEntryFunctionCall(func, {
678
+ ...filter,
679
+ function: "token_transfers::claim_script",
680
+ });
681
+ return this;
682
+ }
683
+
684
+ onEntryOfferScript(
685
+ func: (
686
+ call: token_transfers.OfferScriptPayload,
687
+ ctx: aptos.AptosContext
688
+ ) => void,
689
+ filter?: aptos.CallFilter
690
+ ): token_transfers {
691
+ this.onEntryFunctionCall(func, {
692
+ ...filter,
693
+ function: "token_transfers::offer_script",
694
+ });
695
+ return this;
696
+ }
697
+
698
+ onEventTokenCancelOfferEvent(
699
+ func: (
700
+ event: token_transfers.TokenCancelOfferEventInstance,
701
+ ctx: aptos.AptosContext
702
+ ) => void
703
+ ): token_transfers {
704
+ this.onEvent(func, {
705
+ type: "token_transfers::TokenCancelOfferEvent",
706
+ });
707
+ return this;
708
+ }
709
+
710
+ onEventTokenClaimEvent(
711
+ func: (
712
+ event: token_transfers.TokenClaimEventInstance,
713
+ ctx: aptos.AptosContext
714
+ ) => void
715
+ ): token_transfers {
716
+ this.onEvent(func, {
717
+ type: "token_transfers::TokenClaimEvent",
718
+ });
719
+ return this;
720
+ }
721
+
722
+ onEventTokenOfferEvent(
723
+ func: (
724
+ event: token_transfers.TokenOfferEventInstance,
725
+ ctx: aptos.AptosContext
726
+ ) => void
727
+ ): token_transfers {
728
+ this.onEvent(func, {
729
+ type: "token_transfers::TokenOfferEvent",
730
+ });
731
+ return this;
732
+ }
733
+
734
+ loadTypesInternal(registry: aptos.TypeRegistry) {
735
+ loadAllTypes(registry);
736
+ }
737
+ }
738
+
739
+ export namespace token_transfers {
740
+ export class PendingClaims {
741
+ pending_claims: table.Table<token_transfers.TokenOfferId, token.Token>;
742
+ offer_events: event.EventHandle<token_transfers.TokenOfferEvent>;
743
+ cancel_offer_events: event.EventHandle<token_transfers.TokenCancelOfferEvent>;
744
+ claim_events: event.EventHandle<token_transfers.TokenClaimEvent>;
745
+ }
746
+
747
+ export class TokenCancelOfferEvent {
748
+ to_address: Address;
749
+ token_id: token.TokenId;
750
+ amount: bigint;
751
+ }
752
+
753
+ export interface TokenCancelOfferEventInstance
754
+ extends aptos.TypedEventInstance<TokenCancelOfferEvent> {
755
+ data_typed: TokenCancelOfferEvent;
756
+ }
757
+
758
+ export class TokenClaimEvent {
759
+ to_address: Address;
760
+ token_id: token.TokenId;
761
+ amount: bigint;
762
+ }
763
+
764
+ export interface TokenClaimEventInstance
765
+ extends aptos.TypedEventInstance<TokenClaimEvent> {
766
+ data_typed: TokenClaimEvent;
767
+ }
768
+
769
+ export class TokenOfferEvent {
770
+ to_address: Address;
771
+ token_id: token.TokenId;
772
+ amount: bigint;
773
+ }
774
+
775
+ export interface TokenOfferEventInstance
776
+ extends aptos.TypedEventInstance<TokenOfferEvent> {
777
+ data_typed: TokenOfferEvent;
778
+ }
779
+
780
+ export class TokenOfferId {
781
+ to_addr: Address;
782
+ token_id: token.TokenId;
783
+ }
784
+
785
+ export interface CancelOfferScriptPayload
786
+ extends aptos.TypedEntryFunctionPayload<
787
+ [Address, Address, string, string, bigint]
788
+ > {
789
+ arguments_typed: [Address, Address, string, string, bigint];
790
+ }
791
+
792
+ export interface ClaimScriptPayload
793
+ extends aptos.TypedEntryFunctionPayload<
794
+ [Address, Address, string, string, bigint]
795
+ > {
796
+ arguments_typed: [Address, Address, string, string, bigint];
797
+ }
798
+
799
+ export interface OfferScriptPayload
800
+ extends aptos.TypedEntryFunctionPayload<
801
+ [Address, Address, string, string, bigint, bigint]
802
+ > {
803
+ arguments_typed: [Address, Address, string, string, bigint, bigint];
804
+ }
805
+
806
+ export function loadTypes(registry: aptos.TypeRegistry) {
807
+ loadAllTypes(registry);
808
+ }
809
+ export const ABI: MoveModule = JSON.parse(
810
+ '{"address":"0x3","name":"token_transfers","friends":[],"exposed_functions":[{"name":"cancel_offer","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&signer","address","0x3::token::TokenId"],"return":[]},{"name":"cancel_offer_script","visibility":"public","is_entry":true,"generic_type_params":[],"params":["signer","address","address","0x1::string::String","0x1::string::String","u64"],"return":[]},{"name":"claim","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&signer","address","0x3::token::TokenId"],"return":[]},{"name":"claim_script","visibility":"public","is_entry":true,"generic_type_params":[],"params":["signer","address","address","0x1::string::String","0x1::string::String","u64"],"return":[]},{"name":"offer","visibility":"public","is_entry":false,"generic_type_params":[],"params":["&signer","address","0x3::token::TokenId","u64"],"return":[]},{"name":"offer_script","visibility":"public","is_entry":true,"generic_type_params":[],"params":["signer","address","address","0x1::string::String","0x1::string::String","u64","u64"],"return":[]}],"structs":[{"name":"PendingClaims","is_native":false,"abilities":["key"],"generic_type_params":[],"fields":[{"name":"pending_claims","type":"0x1::table::Table<0x3::token_transfers::TokenOfferId, 0x3::token::Token>"},{"name":"offer_events","type":"0x1::event::EventHandle<0x3::token_transfers::TokenOfferEvent>"},{"name":"cancel_offer_events","type":"0x1::event::EventHandle<0x3::token_transfers::TokenCancelOfferEvent>"},{"name":"claim_events","type":"0x1::event::EventHandle<0x3::token_transfers::TokenClaimEvent>"}]},{"name":"TokenCancelOfferEvent","is_native":false,"abilities":["drop","store"],"generic_type_params":[],"fields":[{"name":"to_address","type":"address"},{"name":"token_id","type":"0x3::token::TokenId"},{"name":"amount","type":"u64"}]},{"name":"TokenClaimEvent","is_native":false,"abilities":["drop","store"],"generic_type_params":[],"fields":[{"name":"to_address","type":"address"},{"name":"token_id","type":"0x3::token::TokenId"},{"name":"amount","type":"u64"}]},{"name":"TokenOfferEvent","is_native":false,"abilities":["drop","store"],"generic_type_params":[],"fields":[{"name":"to_address","type":"address"},{"name":"token_id","type":"0x3::token::TokenId"},{"name":"amount","type":"u64"}]},{"name":"TokenOfferId","is_native":false,"abilities":["copy","drop","store"],"generic_type_params":[],"fields":[{"name":"to_addr","type":"address"},{"name":"token_id","type":"0x3::token::TokenId"}]}]}'
811
+ );
812
+ }
813
+
814
+ function loadAllTypes(registry: aptos.TypeRegistry) {
815
+ table.loadTypes(registry);
816
+ event.loadTypes(registry);
817
+ simple_map.loadTypes(registry);
818
+ type_info.loadTypes(registry);
819
+
820
+ registry.load(token.ABI);
821
+ registry.load(property_map.ABI);
822
+ registry.load(token_coin_swap.ABI);
823
+ registry.load(token_transfers.ABI);
824
+ }