@typemove/aptos 1.13.5-rc.2 → 2.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/esm/codegen/run.js +2 -2
  2. package/package.json +3 -3
  3. package/dist/esm/account-resource-client.d.ts +0 -28
  4. package/dist/esm/account-resource-client.d.ts.map +0 -1
  5. package/dist/esm/account-resource-client.js +0 -47
  6. package/dist/esm/account-resource-client.js.map +0 -1
  7. package/dist/esm/account-resource-client.test.d.ts +0 -2
  8. package/dist/esm/account-resource-client.test.d.ts.map +0 -1
  9. package/dist/esm/account-resource-client.test.js.map +0 -1
  10. package/dist/esm/aptos-chain-adapter.d.ts +0 -19
  11. package/dist/esm/aptos-chain-adapter.d.ts.map +0 -1
  12. package/dist/esm/aptos-chain-adapter.js +0 -101
  13. package/dist/esm/aptos-chain-adapter.js.map +0 -1
  14. package/dist/esm/builtin/0x1.d.ts +0 -7522
  15. package/dist/esm/builtin/0x1.d.ts.map +0 -1
  16. package/dist/esm/builtin/0x1.js +0 -11632
  17. package/dist/esm/builtin/0x1.js.map +0 -1
  18. package/dist/esm/builtin/0x3.d.ts +0 -1087
  19. package/dist/esm/builtin/0x3.d.ts.map +0 -1
  20. package/dist/esm/builtin/0x3.js +0 -926
  21. package/dist/esm/builtin/0x3.js.map +0 -1
  22. package/dist/esm/builtin/0x4.d.ts +0 -535
  23. package/dist/esm/builtin/0x4.d.ts.map +0 -1
  24. package/dist/esm/builtin/0x4.js +0 -884
  25. package/dist/esm/builtin/0x4.js.map +0 -1
  26. package/dist/esm/builtin/index.d.ts +0 -4
  27. package/dist/esm/builtin/index.d.ts.map +0 -1
  28. package/dist/esm/builtin/index.js +0 -7
  29. package/dist/esm/builtin/index.js.map +0 -1
  30. package/dist/esm/client.test.d.ts +0 -2
  31. package/dist/esm/client.test.d.ts.map +0 -1
  32. package/dist/esm/client.test.js.map +0 -1
  33. package/dist/esm/codegen/codegen.d.ts +0 -18
  34. package/dist/esm/codegen/codegen.d.ts.map +0 -1
  35. package/dist/esm/codegen/codegen.js +0 -161
  36. package/dist/esm/codegen/codegen.js.map +0 -1
  37. package/dist/esm/codegen/index.d.ts +0 -2
  38. package/dist/esm/codegen/index.d.ts.map +0 -1
  39. package/dist/esm/codegen/index.js +0 -2
  40. package/dist/esm/codegen/index.js.map +0 -1
  41. package/dist/esm/codegen/run.d.ts +0 -3
  42. package/dist/esm/codegen/run.d.ts.map +0 -1
  43. package/dist/esm/codegen/run.js.map +0 -1
  44. package/dist/esm/codegen/types.test.d.ts +0 -2
  45. package/dist/esm/codegen/types.test.d.ts.map +0 -1
  46. package/dist/esm/codegen/types.test.js.map +0 -1
  47. package/dist/esm/coder-helpers.d.ts +0 -6
  48. package/dist/esm/coder-helpers.d.ts.map +0 -1
  49. package/dist/esm/coder-helpers.js +0 -8
  50. package/dist/esm/coder-helpers.js.map +0 -1
  51. package/dist/esm/index.d.ts +0 -5
  52. package/dist/esm/index.d.ts.map +0 -1
  53. package/dist/esm/index.js +0 -5
  54. package/dist/esm/index.js.map +0 -1
  55. package/dist/esm/models.d.ts +0 -12
  56. package/dist/esm/models.d.ts.map +0 -1
  57. package/dist/esm/models.js +0 -2
  58. package/dist/esm/models.js.map +0 -1
  59. package/dist/esm/move-coder.d.ts +0 -17
  60. package/dist/esm/move-coder.d.ts.map +0 -1
  61. package/dist/esm/move-coder.js +0 -97
  62. package/dist/esm/move-coder.js.map +0 -1
  63. package/dist/esm/to-internal.d.ts +0 -7
  64. package/dist/esm/to-internal.d.ts.map +0 -1
  65. package/dist/esm/to-internal.js +0 -55
  66. package/dist/esm/to-internal.js.map +0 -1
  67. package/src/abis/0x1.json +0 -43414
  68. package/src/abis/0x3.json +0 -3976
  69. package/src/abis/0x4.json +0 -2844
  70. package/src/account-resource-client.ts +0 -69
  71. package/src/aptos-chain-adapter.ts +0 -129
  72. package/src/builtin/0x1.ts +0 -19976
  73. package/src/builtin/0x3.ts +0 -2083
  74. package/src/builtin/0x4.ts +0 -1503
  75. package/src/builtin/index.ts +0 -6
  76. package/src/codegen/codegen.ts +0 -190
  77. package/src/codegen/index.ts +0 -1
  78. package/src/codegen/run.ts +0 -70
  79. package/src/coder-helpers.ts +0 -15
  80. package/src/index.ts +0 -4
  81. package/src/models.ts +0 -23
  82. package/src/move-coder.ts +0 -124
  83. package/src/tests/abis/0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af.json +0 -3265
  84. package/src/tests/abis/0x4dcae85fc5559071906cd5c76b7420fcbb4b0a92f00ab40ffc394aadbbff5ee9.json +0 -637
  85. package/src/tests/abis/0x6b3720cd988adeaf721ed9d4730da4324d52364871a68eac62b46d21e4d2fa99.json +0 -1099
  86. package/src/tests/abis/0x7fd500c11216f0fe3095d0c4b8aa4d64a4e2e04f83758462f2b127255643615.json +0 -409
  87. package/src/tests/abis/0x87978b35bf1eb73ae6cf04cfedcaa1f48254a683ebd00a21e7516a991edae3ac.json +0 -219
  88. package/src/tests/abis/0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541.json +0 -3717
  89. package/src/tests/types/0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af.ts +0 -2805
  90. package/src/tests/types/0x4dcae85fc5559071906cd5c76b7420fcbb4b0a92f00ab40ffc394aadbbff5ee9.ts +0 -89
  91. package/src/tests/types/0x6b3720cd988adeaf721ed9d4730da4324d52364871a68eac62b46d21e4d2fa99.ts +0 -1649
  92. package/src/tests/types/0x7fd500c11216f0fe3095d0c4b8aa4d64a4e2e04f83758462f2b127255643615.ts +0 -744
  93. package/src/tests/types/0x87978b35bf1eb73ae6cf04cfedcaa1f48254a683ebd00a21e7516a991edae3ac.ts +0 -126
  94. package/src/tests/types/0xbd35135844473187163ca197ca93b2ab014370587bb0ed3befff9e902d6bb541.ts +0 -2165
  95. package/src/tests/types/index.ts +0 -9
  96. package/src/to-internal.ts +0 -71
@@ -1,6 +0,0 @@
1
- /* Autogenerated file. Do not edit manually. */
2
- /* tslint:disable */
3
- /* eslint-disable */
4
- export * as _0x1 from './0x1.js'
5
- export * as _0x3 from './0x3.js'
6
- export * as _0x4 from './0x4.js'
@@ -1,190 +0,0 @@
1
- import * as fs from 'fs'
2
- import chalk from 'chalk'
3
- import { join } from 'path'
4
- import { AptosChainAdapter } from '../aptos-chain-adapter.js'
5
- import {
6
- camel,
7
- InternalMoveFunction,
8
- InternalMoveModule,
9
- InternalMoveStruct,
10
- normalizeToJSName,
11
- structQname
12
- } from '@typemove/move'
13
- import { AbstractCodegen } from '@typemove/move/codegen'
14
- import { Aptos, AptosConfig, Event, MoveModuleBytecode, MoveResource } from '@aptos-labs/ts-sdk'
15
-
16
- export async function codegen(
17
- abisDir: string,
18
- outDir = join('src', 'types', 'aptos'),
19
- config: AptosConfig,
20
- genExample = false,
21
- builtin = false
22
- ) {
23
- if (!fs.existsSync(abisDir)) {
24
- console.error(chalk.red(`ABIs directory ${abisDir} does not exist`))
25
- return 0
26
- }
27
- const gen = new AptosCodegen(config)
28
- try {
29
- const numFiles = await gen.generate(abisDir, outDir, builtin)
30
- if (numFiles > 0) {
31
- console.log(chalk.green(`Generated for ${numFiles} accounts for Aptos to ${outDir}`))
32
- } else {
33
- console.error(chalk.red(`No account found`))
34
- }
35
- return numFiles
36
- } catch (e) {
37
- console.error(chalk.red(`Failed to generate for ${abisDir}, please check if ABI json files are valid`))
38
- console.log(e)
39
- return 0
40
- }
41
- }
42
-
43
- export class AptosCodegen extends AbstractCodegen<MoveModuleBytecode, Event | MoveResource> {
44
- ADDRESS_TYPE = 'MoveAddressType'
45
- PREFIX = 'Aptos'
46
- SYSTEM_PACKAGE = '@typemove/aptos'
47
-
48
- constructor(
49
- config: AptosConfig,
50
- readonly useViewJson = false
51
- ) {
52
- super(new AptosChainAdapter(new Aptos(config)))
53
- }
54
-
55
- generateImports(): string {
56
- return `
57
- ${super.generateImports()}
58
- import { Aptos, Account as AptosAccount, MoveAddressType, PendingTransactionResponse, InputGenerateTransactionOptions, MoveStructId, InputViewFunctionData, InputViewFunctionJsonData } from '@aptos-labs/ts-sdk'
59
- `
60
- }
61
-
62
- protected generateExtra(address: string | undefined, module: InternalMoveModule) {
63
- const funcs = module.exposedFunctions.map((f) => this.generateEntryForFunction(module, f))
64
-
65
- const viewFuncs = module.exposedFunctions.map((f) => this.generateViewFunction(module, f))
66
-
67
- return `
68
- export namespace entry {
69
- ${funcs.join('\n')}
70
- }
71
- export namespace view {
72
- ${viewFuncs.join('\n')}
73
- }
74
- `
75
- }
76
-
77
- generateStructs(module: InternalMoveModule, struct: InternalMoveStruct, events: Set<string>): string {
78
- let content = ''
79
- switch (structQname(module, struct)) {
80
- case '0x1::object::Object':
81
- content += `export type ${struct.name}<T> = MoveAddressType`
82
- break
83
- }
84
- return content + super.generateStructs(module, struct, events, content !== '')
85
- }
86
-
87
- protected generateViewFunction(module: InternalMoveModule, func: InternalMoveFunction): string {
88
- if (!func.isView) {
89
- return ''
90
- }
91
- const genericString = this.generateFunctionTypeParameters(func)
92
- const fields = this.chainAdapter.getMeaningfulFunctionParams(func.params).map((param) => {
93
- return this.generateTypeForDescriptor(param, module.address)
94
- })
95
-
96
- const returns = func.return.map((param) => {
97
- return this.generateTypeForDescriptor(param, module.address)
98
- })
99
-
100
- const typeParamArg = func.typeParams
101
- .map((v, idx) => {
102
- return `TypeDescriptor<T${idx}> | string`
103
- })
104
- .join(',')
105
-
106
- // const args = this.generateArgs(module, func)
107
- const allEmpty = func.typeParams.length === 0 && func.params.length === 0
108
- const requestArg = allEmpty
109
- ? ''
110
- : `request: {
111
- ${func.typeParams.length > 0 ? `typeArguments: [${func.typeParams.map((_) => 'MoveStructId').join(', ')}],` : ''}
112
- ${func.params.length > 0 ? `functionArguments: [${fields.join(',')}]` : ''}},`
113
-
114
- if (this.useViewJson) {
115
- return `export async function ${camel(normalizeToJSName(func.name))}${genericString}(
116
- client: Aptos,
117
- ${requestArg}
118
- version?: bigint): Promise<[${returns.join(',')}]> {
119
- const coder = ${this.getGetDefaultCoder()}
120
- const data: InputViewFunctionJsonData = {
121
- function: "${module.address}::${module.name}::${func.name}",
122
- functionArguments: ${func.params.length > 0 ? 'request.functionArguments.map(coder.toMoveValue)' : '[]'},
123
- typeArguments: ${func.typeParams.length > 0 ? 'request.typeArguments' : '[]'},
124
- }
125
- const res = await client.viewJson({payload: data, options: { ledgerVersion: version } });
126
- const type = await coder.getMoveFunction("${module.address}::${module.name}::${func.name}")
127
- return await coder.decodeArray(res, type.return) as any
128
- }`
129
- }
130
-
131
- return `export async function ${camel(normalizeToJSName(func.name))}${genericString}(
132
- client: Aptos,
133
- ${requestArg}
134
- version?: bigint): Promise<[${returns.join(',')}]> {
135
- const coder = ${this.getGetDefaultCoder()}
136
- const data: InputViewFunctionData = {
137
- function: "${module.address}::${module.name}::${func.name}",
138
- functionArguments: ${func.params.length > 0 ? 'coder.encodeArray(request.functionArguments)' : '[]'},
139
- typeArguments: ${func.typeParams.length > 0 ? 'request.typeArguments' : '[]'},
140
- }
141
- const res = await client.view({payload: data, options: { ledgerVersion: version } });
142
- const type = await coder.getMoveFunction("${module.address}::${module.name}::${func.name}")
143
- return await coder.decodeArray(res, type.return) as any
144
- }`
145
- }
146
-
147
- protected getGetDefaultCoder() {
148
- return `defaultMoveCoder(client.config)`
149
- }
150
-
151
- protected generateEntryForFunction(module: InternalMoveModule, func: InternalMoveFunction): string {
152
- if (!func.isEntry) {
153
- return ''
154
- }
155
- const genericString = this.generateFunctionTypeParameters(func)
156
- const fields = this.chainAdapter.getMeaningfulFunctionParams(func.params).map((param) => {
157
- return this.generateTypeForDescriptor(param, module.address)
158
- })
159
-
160
- // const typeParamArg = func.typeParams
161
- // .map((v, idx) => {
162
- // return `TypeDescriptor<T${idx}> | string`
163
- // })
164
- // .join(',')
165
- //
166
- // const args = this.generateArgs(module, func)
167
-
168
- return `export async function ${camel(normalizeToJSName(func.name))}${genericString}(
169
- client: Aptos,
170
- account: AptosAccount,
171
- request: {
172
- typeArguments: [${func.typeParams.map((_) => 'MoveStructId').join(', ')}],
173
- functionArguments: [${fields.join(',')}]
174
- },
175
- options?: InputGenerateTransactionOptions
176
- ): Promise<PendingTransactionResponse> {
177
- const coder = ${this.getGetDefaultCoder()}
178
- const transaction = await client.transaction.build.simple({
179
- sender: account.accountAddress,
180
- data: {
181
- function: "${module.address}::${module.name}::${func.name}",
182
- functionArguments: ${func.params.length > 0 ? 'coder.encodeArray(request.functionArguments)' : '[]'},
183
- typeArguments: ${func.typeParams.length > 0 ? 'request.typeArguments' : '[]'},
184
- },
185
- options
186
- })
187
- return await client.signAndSubmitTransaction({ signer: account, transaction });
188
- }`
189
- }
190
- }
@@ -1 +0,0 @@
1
- export * from './codegen.js'
@@ -1,70 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { codegen } from './codegen.js'
4
- import { AptosChainAdapter } from '../aptos-chain-adapter.js'
5
- import { Aptos, AptosConfig, Network } from '@aptos-labs/ts-sdk'
6
- import * as path from 'path'
7
- import * as fs from 'fs'
8
- import { Command } from 'commander'
9
- import { createRequire } from 'module'
10
- const require = createRequire(import.meta.url)
11
- let pkg = undefined
12
- try {
13
- pkg = require('../../package.json')
14
- } catch (e) {
15
- pkg = require('../../../package.json')
16
- }
17
-
18
- const program = new Command()
19
-
20
- program
21
- .name('typemove-aptos')
22
- .description('CLI to generate typescript types from Aptos ABIs')
23
- .showHelpAfterError()
24
- .version(pkg.version)
25
- .argument('<location>', 'Directory of ABI json files or address of account to generate types for')
26
- .option('-a, --abi-dir <dir>', 'Directory to store downloaded ABI. Only useful if <location> is address', './abis')
27
- .option('-t, --target-dir <dir>', 'Directory to output generated files', './types')
28
- .option(
29
- '-n, --network <mainnet|testnet|$url>',
30
- 'Network to use, could be either "mainnet", "testnet" or any node URL',
31
- 'mainnet'
32
- )
33
- .action(async (location, options) => {
34
- const endpoint = options.network
35
- let config: AptosConfig
36
- if (endpoint == 'mainnet') {
37
- config = new AptosConfig({
38
- network: Network.MAINNET
39
- })
40
- } else if (endpoint == 'testnet') {
41
- config = new AptosConfig({
42
- network: Network.TESTNET
43
- })
44
- } else {
45
- config = new AptosConfig({
46
- network: Network.CUSTOM,
47
- fullnode: endpoint
48
- })
49
- }
50
- const aptosClient = new Aptos(config)
51
-
52
- let abisDir = location
53
- if (location.startsWith('0x')) {
54
- const abiAddress = abisDir
55
- const abi = await aptosClient.getAccountModules({ accountAddress: abiAddress })
56
- abisDir = options.abiDir
57
- if (!fs.existsSync(abisDir)) {
58
- fs.mkdirSync(abisDir, { recursive: true })
59
- }
60
- fs.writeFileSync(
61
- path.join(abisDir, abiAddress + '.json'),
62
- JSON.stringify(new AptosChainAdapter(aptosClient).toPersistableModules(abi), null, 2)
63
- )
64
- }
65
-
66
- const num = await codegen(abisDir, options.targetDir, config, true)
67
- process.exit(num == 0 ? 1 : 0)
68
- })
69
-
70
- program.parse()
@@ -1,15 +0,0 @@
1
- import { ResourceChange } from './models.js'
2
- import { MoveCoder } from './move-coder.js'
3
-
4
- export async function decodeResourceChange<T>(
5
- resources: {
6
- [key: string]: any
7
- }[],
8
- coder: MoveCoder
9
- ): Promise<ResourceChange<T>[]> {
10
- const promises = resources.map(async (r) => {
11
- r.data = await coder.decodeResource<T>(r.data)
12
- return r as ResourceChange<T>
13
- })
14
- return await Promise.all(promises)
15
- }
package/src/index.ts DELETED
@@ -1,4 +0,0 @@
1
- export * from './models.js'
2
- export { MoveCoder, defaultMoveCoder } from './move-coder.js'
3
- export { AccountResourceClient } from './account-resource-client.js'
4
- export * from './coder-helpers.js'
package/src/models.ts DELETED
@@ -1,23 +0,0 @@
1
- import { DecodedStruct, NestedDecodedStruct } from '@typemove/move'
2
- import {
3
- EntryFunctionPayloadResponse,
4
- MoveResource,
5
- Event,
6
- WriteSetChangeWriteResource,
7
- WriteSetChangeDeleteResource
8
- } from '@aptos-labs/ts-sdk'
9
-
10
- export type TypedEventInstance<T> = DecodedStruct<Event, T>
11
- export type TypedMoveResource<T> = DecodedStruct<MoveResource, T>
12
-
13
- // Don't use intermediate type to make IDE happier
14
- export type TypedFunctionPayload<T extends Array<any>> = EntryFunctionPayloadResponse & {
15
- /**
16
- * decoded argument data using ABI, undefined if there is decoding error, usually because the ABI/data mismatch
17
- */
18
- arguments_decoded: T
19
- }
20
-
21
- export type ResourceChange<T> =
22
- | NestedDecodedStruct<MoveResource, WriteSetChangeWriteResource, T>
23
- | WriteSetChangeDeleteResource
package/src/move-coder.ts DELETED
@@ -1,124 +0,0 @@
1
- import { AbstractMoveCoder, InternalMoveModule, parseMoveType, TypeDescriptor } from '@typemove/move'
2
- import { TypedEventInstance, TypedFunctionPayload, TypedMoveResource } from './models.js'
3
- import { AptosChainAdapter } from './aptos-chain-adapter.js'
4
- import { toInternalModule } from './to-internal.js'
5
- import {
6
- Aptos,
7
- AptosConfig,
8
- EntryFunctionPayloadResponse,
9
- Event,
10
- MoveModuleBytecode,
11
- MoveResource,
12
- MoveValue,
13
- Network
14
- } from '@aptos-labs/ts-sdk'
15
-
16
- export class MoveCoder extends AbstractMoveCoder<MoveModuleBytecode, Event | MoveResource> {
17
- constructor(
18
- client: Aptos,
19
- readonly ignoreObjectInnerField: boolean = false
20
- ) {
21
- super(new AptosChainAdapter(client))
22
- }
23
-
24
- load(module: MoveModuleBytecode, address: string): InternalMoveModule {
25
- if (!module.abi) {
26
- throw Error('Module without abi')
27
- }
28
- let m = this.moduleMapping.get(module.abi.address + '::' + module.abi.name)
29
- // if (this.contains(module.abi.address, module.abi.name)) {
30
- // return
31
- // }
32
- if (m) {
33
- return m
34
- }
35
- this.accounts.add(module.abi.address)
36
- m = toInternalModule(module)
37
- this.loadInternal(m, address)
38
- return m
39
- }
40
-
41
- decodeEvent<T>(event: Event): Promise<TypedEventInstance<T> | undefined> {
42
- // TODO fix type
43
- return this.decodedStruct(event)
44
- }
45
- filterAndDecodeEvents<T>(type: string | TypeDescriptor<T>, resources: Event[]): Promise<TypedEventInstance<T>[]> {
46
- if (typeof type === 'string') {
47
- type = parseMoveType(type)
48
- }
49
- // TODO fix type
50
- return this.filterAndDecodeStruct(type, resources)
51
- }
52
- decodeResource<T>(res: MoveResource): Promise<TypedMoveResource<T> | undefined> {
53
- return this.decodedStruct(res)
54
- }
55
-
56
- protected async decode(data: any, type: TypeDescriptor): Promise<any> {
57
- switch (type.qname) {
58
- case '0x1::object::Object':
59
- if (this.ignoreObjectInnerField && typeof data === 'string') {
60
- return data
61
- }
62
- if (typeof data === 'object' && data?.inner !== undefined && typeof data?.inner === 'string') {
63
- return data.inner
64
- }
65
- }
66
- return super.decode(data, type)
67
- }
68
-
69
- filterAndDecodeResources<T>(
70
- type: string | TypeDescriptor<T>,
71
- resources: MoveResource[]
72
- ): Promise<TypedMoveResource<T>[]> {
73
- if (typeof type === 'string') {
74
- type = parseMoveType(type)
75
- }
76
- return this.filterAndDecodeStruct(type, resources)
77
- }
78
-
79
- async decodeFunctionPayload<T extends Array<any>>(
80
- payload: EntryFunctionPayloadResponse
81
- ): Promise<TypedFunctionPayload<T>> {
82
- const func = await this.getMoveFunction(payload.function)
83
- const params = this.adapter.getMeaningfulFunctionParams(func.params)
84
- const argumentsDecoded = await this.decodeArray(payload.arguments, params)
85
-
86
- return {
87
- ...payload,
88
- arguments_decoded: argumentsDecoded
89
- } as TypedFunctionPayload<T>
90
- }
91
-
92
- toMoveValue(value: any): MoveValue {
93
- switch (typeof value) {
94
- case 'boolean':
95
- return value
96
- case 'number':
97
- return value
98
- case 'bigint':
99
- return value.toString()
100
- case 'object':
101
- if (Array.isArray(value)) {
102
- return value.map(this.toMoveValue)
103
- }
104
- return value
105
- default:
106
- return value.toString()
107
- }
108
- }
109
- }
110
-
111
- const DEFAULT_CONFIG = new AptosConfig({ network: Network.MAINNET })
112
-
113
- const CODER_MAP = new Map<string, MoveCoder>()
114
-
115
- export function defaultMoveCoder(config = DEFAULT_CONFIG): MoveCoder {
116
- const configKey = config.fullnode ? config.fullnode : config.network
117
-
118
- let coder = CODER_MAP.get(configKey)
119
- if (!coder) {
120
- coder = new MoveCoder(new Aptos(config))
121
- CODER_MAP.set(configKey, coder)
122
- }
123
- return coder
124
- }