@sentio/sdk 1.20.1 → 1.21.0

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