@sentio/sdk 2.13.2-rc.4 → 2.13.2-rc.5

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.
@@ -28,7 +28,7 @@ export declare abstract class AbstractCodegen<NetworkType, ModuleTypes, StructTy
28
28
  generateForNetwork(srcDir: string, outputDir: string, network: NetworkType, builtin?: boolean): Promise<number>;
29
29
  generateNetworkOption(network: NetworkType): "TEST_NET" | "MAIN_NET";
30
30
  generateModule(module: InternalMoveModule, network: NetworkType): string;
31
- generateStructs(module: InternalMoveModule, struct: InternalMoveStruct, events: Set<string>): string;
31
+ generateStructs(module: InternalMoveModule, struct: InternalMoveStruct, events: Set<string>, typeOnly?: boolean): string;
32
32
  generateFunctionTypeParameters(func: InternalMoveFunction): string;
33
33
  generateStructTypeParameters(struct: InternalMoveStruct, useAny?: boolean): string;
34
34
  generateCallArgsStructs(module: InternalMoveModule, func: InternalMoveFunction): string | undefined;
@@ -167,7 +167,7 @@ export class AbstractCodegen {
167
167
  }
168
168
  `;
169
169
  }
170
- generateStructs(module, struct, events) {
170
+ generateStructs(module, struct, events, typeOnly = false) {
171
171
  const typeParams = struct.typeParams || [];
172
172
  const genericString = this.generateStructTypeParameters(struct);
173
173
  const genericStringAny = this.generateStructTypeParameters(struct, true);
@@ -176,16 +176,6 @@ export class AbstractCodegen {
176
176
  const type = this.generateTypeForDescriptor(field.type, module.address);
177
177
  return `${field.name}: ${type}`;
178
178
  });
179
- let eventPayload = '';
180
- if (events.has(moduleQname(module) + SPLITTER + struct.name)) {
181
- eventPayload = `
182
- export interface ${structName}Instance extends
183
- TypedEventInstance<${structName}${genericStringAny}> {
184
- ${this.STRUCT_FIELD_NAME}_decoded: ${structName}${genericStringAny}
185
- type_arguments: [${struct.typeParams.map((_) => 'string').join(', ')}]
186
- }
187
- `;
188
- }
189
179
  const typeParamApplyArg = typeParams
190
180
  .map((v, idx) => {
191
181
  return `arg${idx}: TypeDescriptor<T${idx}> = ANY_TYPE`;
@@ -196,22 +186,36 @@ export class AbstractCodegen {
196
186
  return `arg${idx}`;
197
187
  })
198
188
  .join(',');
199
- const typeWithArg = `
189
+ const typeDescriptor = `
190
+ export namespace ${structName}{
191
+ export const TYPE_QNAME = '${module.address}::${module.name}::${struct.name}'
192
+
193
+ const TYPE = new TypeDescriptor<${structName}${genericStringAny}>(${structName}.TYPE_QNAME)
194
+
200
195
  export function type${genericString}(${typeParamApplyArg}): TypeDescriptor<${structName}${genericString}> {
201
196
  return TYPE.apply(${typeParamApply})
202
- }`;
197
+ }
198
+ }
199
+ `;
200
+ if (typeOnly) {
201
+ return typeDescriptor;
202
+ }
203
+ let eventPayload = '';
204
+ if (events.has(moduleQname(module) + SPLITTER + struct.name)) {
205
+ eventPayload = `
206
+ export interface ${structName}Instance extends
207
+ TypedEventInstance<${structName}${genericStringAny}> {
208
+ ${this.STRUCT_FIELD_NAME}_decoded: ${structName}${genericStringAny}
209
+ type_arguments: [${struct.typeParams.map((_) => 'string').join(', ')}]
210
+ }
211
+ `;
212
+ }
203
213
  return `
204
214
  export interface ${structName}${genericString} {
205
215
  ${fields.join('\n')}
206
216
  }
207
217
 
208
- export namespace ${structName}{
209
- export const TYPE_QNAME = '${module.address}::${module.name}::${struct.name}'
210
-
211
- const TYPE = new TypeDescriptor<${structName}${genericStringAny}>(${structName}.TYPE_QNAME)
212
-
213
- ${typeWithArg}
214
- }
218
+ ${typeDescriptor}
215
219
 
216
220
  ${eventPayload}
217
221
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"abstract-codegen.js","sourceRoot":"","sources":["../../src/move/abstract-codegen.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,8BAA8B,GAG/B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACxE,OAAO,KAAK,MAAM,O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,SAAS,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;YAC9C,YAAY,GAAG;wCACmB,IAAI,CAAC,SAAS,CAAC,MAAM;wCACrB,IAAI,CAAC,SAAS,CAAC,MAAM;OACtD,CAAA;SACF;QAED,MAAM,MAAM,GAAG;;;;;uCAKoB,OAAO;;MAExC,OAAO;;MAEP,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;;MAExB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;kCAE7D,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC;;;QAGlD,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;;MAMrE,YAAY;KACb,CAAA,CAAC,SAAS;QAEX,OAAO;YACL;gBACE,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,KAAK;gBACtC,WAAW,EAAE,MAAM;aACpB;SACF,CAAA;IACH,CAAC;CACF","sourcesContent":["import {\n InternalMoveFunction,\n InternalMoveFunctionVisibility,\n InternalMoveModule,\n InternalMoveStruct,\n} from './internal-models.js'\nimport path from 'path'\nimport fs from 'fs'\nimport { AccountModulesImportInfo, AccountRegister } from './account.js'\nimport chalk from 'chalk'\nimport { format } from 'prettier'\nimport { isFrameworkAccount, moduleQname, normalizeToJSName, SPLITTER, VECTOR_STR } from './utils.js'\nimport { camelCase, upperFirst } from 'lodash-es'\nimport { TypeDescriptor } from './types.js'\nimport { ChainAdapter } from './chain-adapter.js'\n\ninterface OutputFile {\n fileName: string\n fileContent: string\n}\n\ninterface Config<NetworkType> {\n fileName: string\n outputDir: string\n network: NetworkType\n}\n\nexport abstract class AbstractCodegen<NetworkType, ModuleTypes, StructType> {\n TEST_NET: NetworkType\n MAIN_NET: NetworkType\n ADDRESS_TYPE: string\n PREFIX: string\n STRUCT_FIELD_NAME: string = 'data'\n GENERATE_CLIENT = false\n GENERATE_ON_ENTRY = true\n PAYLOAD_OPTIONAL = false\n SYSTEM_MODULES = new Set(['0x1', '0x2', '0x3'])\n\n chainAdapter: ChainAdapter<NetworkType, ModuleTypes, StructType>\n\n protected constructor(chainAdapter: ChainAdapter<NetworkType, ModuleTypes, StructType>) {\n this.chainAdapter = chainAdapter\n }\n\n readModulesFile(fullPath: string) {\n return JSON.parse(fs.readFileSync(fullPath, 'utf-8'))\n }\n\n async generate(srcDir: string, outputDir: string, builtin = false): Promise<number> {\n const num1 = await this.generateForNetwork(srcDir, outputDir, this.MAIN_NET, builtin)\n const num2 = await this.generateForNetwork(\n path.join(srcDir, 'testnet'),\n path.join(outputDir, 'testnet'),\n this.TEST_NET,\n builtin\n )\n return num1 + num2\n }\n\n async generateForNetwork(srcDir: string, outputDir: string, network: NetworkType, builtin = false) {\n if (!fs.existsSync(srcDir)) {\n return 0\n }\n\n const files = fs.readdirSync(srcDir)\n outputDir = path.resolve(outputDir)\n const outputs: OutputFile[] = []\n\n fs.mkdirSync(outputDir, { recursive: true })\n\n const loader = new AccountRegister()\n\n // when generating user code, don't need to generate framework account\n for (const sysModule of this.SYSTEM_MODULES) {\n loader.accountImports.set(sysModule, new AccountModulesImportInfo(sysModule, sysModule))\n }\n // const client = getRpcClient(network)\n\n for (const file of files) {\n if (!file.endsWith('.json')) {\n continue\n }\n const fullPath = path.resolve(srcDir, file)\n const abi = this.readModulesFile(fullPath)\n const modules = this.chainAdapter.toInternalModules(abi)\n\n for (const module of modules) {\n loader.register(module, path.basename(file, '.json'))\n }\n const codeGen = new AccountCodegen(this, loader, abi, modules, {\n fileName: path.basename(file, '.json'),\n outputDir: outputDir,\n network,\n })\n\n outputs.push(...codeGen.generate())\n }\n\n while (loader.pendingAccounts.size > 0) {\n for (const account of loader.pendingAccounts) {\n console.log(`download dependent module for account ${account} at ${network}`)\n\n try {\n const rawModules = await this.chainAdapter.fetchModules(account, network)\n const modules = this.chainAdapter.toInternalModules(rawModules)\n\n fs.writeFileSync(path.resolve(srcDir, account + '.json'), JSON.stringify(rawModules, null, '\\t'))\n for (const module of modules) {\n loader.register(module, account)\n }\n const codeGen = new AccountCodegen(this, loader, rawModules, modules, {\n fileName: account,\n outputDir: outputDir,\n network,\n })\n\n outputs.push(...codeGen.generate())\n } catch (e) {\n console.error(\n chalk.red(\n 'Error downloading account module, check if you choose the right network,or download account modules manually into your director'\n )\n )\n console.error(e)\n process.exit(1)\n }\n }\n }\n\n for (const output of outputs) {\n // const content = output.fileContent\n const content = format(output.fileContent, { parser: 'typescript' })\n fs.writeFileSync(path.join(outputDir, output.fileName), content)\n }\n\n const rootFile = path.join(outputDir, 'index.ts')\n let rootFileContent = `/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n`\n for (const output of outputs) {\n const parsed = path.parse(output.fileName)\n rootFileContent += `export * as _${parsed.name.replaceAll('-', '_')} from './${parsed.name}.js'\\n`\n }\n // if (builtin) {\n // rootFileContent += `export { BUILTIN_TYPES } from '@sentio/sdk/move'`\n // }\n fs.writeFileSync(rootFile, rootFileContent)\n\n return outputs.length + 1\n }\n\n generateNetworkOption(network: NetworkType) {\n switch (network) {\n case this.TEST_NET:\n return 'TEST_NET'\n }\n return 'MAIN_NET'\n }\n\n generateModule(module: InternalMoveModule, network: NetworkType) {\n const functions = this.GENERATE_ON_ENTRY\n ? module.exposedFunctions.map((f) => this.generateOnEntryFunctions(module, f)).filter((s) => s !== '')\n : []\n const clientFunctions = this.GENERATE_CLIENT\n ? module.exposedFunctions.map((f) => this.generateClientFunctions(module, f)).filter((s) => s !== '')\n : []\n const eventStructs = this.chainAdapter.getEventStructs(module)\n const eventTypes = new Set(eventStructs.keys())\n const events = Array.from(eventStructs.values())\n .map((e) => this.generateOnEvents(module, e))\n .filter((s) => s !== '')\n const structs = module.structs.map((s) => this.generateStructs(module, s, eventTypes))\n const callArgs = module.exposedFunctions.map((f) => this.generateCallArgsStructs(module, f))\n\n const moduleName = normalizeToJSName(module.name)\n let processor = ''\n let client = ''\n\n if (clientFunctions.length > 0) {\n client = `\n export class ${moduleName}_client extends ModuleClient {\n ${clientFunctions.join('\\n')}\n }\n `\n }\n\n if (functions.length > 0 || events.length > 0) {\n processor = `export class ${moduleName} extends ${this.PREFIX}BaseProcessor {\n\n constructor(options: ${this.PREFIX}BindOptions) {\n super(\"${module.name}\", options)\n }\n static DEFAULT_OPTIONS: ${this.PREFIX}BindOptions = {\n address: \"${module.address}\",\n network: ${this.PREFIX}Network.${this.generateNetworkOption(network)}\n }\n\n static bind(options: Partial<${this.PREFIX}BindOptions> = {}): ${moduleName} {\n return new ${moduleName}({ ...${moduleName}.DEFAULT_OPTIONS, ...options })\n }\n\n ${functions.join('\\n')}\n\n ${events.join('\\n')}\n }\n `\n }\n\n return `\n ${client}\n\n ${processor}\n\n export namespace ${moduleName} {\n ${structs.join('\\n')}\n\n ${callArgs.join('\\n')}\n }\n `\n }\n\n generateStructs(module: InternalMoveModule, struct: InternalMoveStruct, events: Set<string>) {\n const typeParams = struct.typeParams || []\n const genericString = this.generateStructTypeParameters(struct)\n const genericStringAny = this.generateStructTypeParameters(struct, true)\n\n const structName = normalizeToJSName(struct.name)\n\n const fields = struct.fields.map((field) => {\n const type = this.generateTypeForDescriptor(field.type, module.address)\n return `${field.name}: ${type}`\n })\n\n let eventPayload = ''\n if (events.has(moduleQname(module) + SPLITTER + struct.name)) {\n eventPayload = `\n export interface ${structName}Instance extends\n TypedEventInstance<${structName}${genericStringAny}> {\n ${this.STRUCT_FIELD_NAME}_decoded: ${structName}${genericStringAny}\n type_arguments: [${struct.typeParams.map((_) => 'string').join(', ')}]\n }\n `\n }\n\n const typeParamApplyArg = typeParams\n .map((v, idx) => {\n return `arg${idx}: TypeDescriptor<T${idx}> = ANY_TYPE`\n })\n .join(',')\n const typeParamApply = typeParams\n .map((v, idx) => {\n return `arg${idx}`\n })\n .join(',')\n\n const typeWithArg = `\n export function type${genericString}(${typeParamApplyArg}): TypeDescriptor<${structName}${genericString}> {\n return TYPE.apply(${typeParamApply})\n }`\n\n return `\n export interface ${structName}${genericString} {\n ${fields.join('\\n')}\n }\n \n export namespace ${structName}{\n export const TYPE_QNAME = '${module.address}::${module.name}::${struct.name}'\n \n const TYPE = new TypeDescriptor<${structName}${genericStringAny}>(${structName}.TYPE_QNAME)\n\n ${typeWithArg}\n }\n\n ${eventPayload}\n `\n }\n\n generateFunctionTypeParameters(func: InternalMoveFunction) {\n let genericString = ''\n if (func.typeParams && func.typeParams.length > 0) {\n const params = func.typeParams\n .map((v, idx) => {\n return `T${idx}=any`\n })\n .join(',')\n genericString = `<${params}>`\n }\n return genericString\n }\n\n generateStructTypeParameters(struct: InternalMoveStruct, useAny = false) {\n let genericString = ''\n\n if (struct.typeParams && struct.typeParams.length > 0) {\n const params = struct.typeParams\n .map((v, idx) => {\n return useAny ? 'any' : 'T' + idx\n })\n .join(',')\n genericString = `<${params}>`\n }\n return genericString\n }\n\n generateCallArgsStructs(module: InternalMoveModule, func: InternalMoveFunction) {\n if (!func.isEntry) {\n return\n }\n\n const fields = this.chainAdapter.getMeaningfulFunctionParams(func.params).map((param) => {\n return this.generateTypeForDescriptor(param, module.address) + (this.PAYLOAD_OPTIONAL ? ' | undefined' : '')\n })\n\n const camelFuncName = upperFirst(camelCase(func.name))\n\n const genericString = this.generateFunctionTypeParameters(func)\n return `\n export interface ${camelFuncName}Payload${genericString}\n extends TypedFunctionPayload<[${fields.join(',')}]> {\n arguments_decoded: [${fields.join(',')}],\n type_arguments: [${func.typeParams.map((_) => 'string').join(', ')}]\n }\n `\n }\n\n generateClientFunctions(module: InternalMoveModule, func: InternalMoveFunction) {\n if (func.visibility === InternalMoveFunctionVisibility.PRIVATE) {\n return ''\n }\n if (func.isEntry) {\n return ''\n }\n // const moduleName = normalizeToJSName(module.name)\n const funcName = camelCase(func.name)\n const fields = this.chainAdapter.getMeaningfulFunctionParams(func.params).map((param) => {\n return this.generateTypeForDescriptor(param, module.address)\n })\n const genericString = this.generateFunctionTypeParameters(func)\n\n const returns = func.return.map((param) => {\n return this.generateTypeForDescriptor(param, module.address)\n })\n\n const source = `\n ${funcName}${genericString}(type_arguments: [${func.typeParams\n .map((_) => 'string')\n .join(', ')}], args: [${fields.join(',')}], version?: bigint): Promise<[${returns.join(',')}]> {\n return this.viewDecoded('${module.address}::${module.name}::${func.name}', type_arguments, args, version) as any\n }`\n return source\n }\n\n generateOnEntryFunctions(module: InternalMoveModule, func: InternalMoveFunction) {\n if (!func.isEntry) {\n return ''\n }\n\n // const genericString = generateFunctionTypeParameters(func)\n const moduleName = normalizeToJSName(module.name)\n\n const camelFuncName = upperFirst(camelCase(func.name))\n const source = `\n onEntry${camelFuncName}(func: (call: ${moduleName}.${camelFuncName}Payload, ctx: ${this.PREFIX}Context) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): ${moduleName} {\n this.onEntryFunctionCall(func, {\n ...filter,\n function: '${module.name}::${func.name}'\n },\n fetchConfig)\n return this\n }`\n\n return source\n }\n\n generateOnEvents(module: InternalMoveModule, struct: InternalMoveStruct): string {\n // for struct that has drop + store\n // if (!isEvent(struct, module)) {\n // return ''\n // }\n\n // const genericString = generateStructTypeParameters(struct)\n\n const moduleName = normalizeToJSName(module.name)\n const source = `\n onEvent${struct.name}(func: (event: ${moduleName}.${normalizeToJSName(struct.name)}Instance, ctx: ${\n this.PREFIX\n }Context) => void, fetchConfig?: Partial<MoveFetchConfig>): ${moduleName} {\n this.onMoveEvent(func, {\n type: '${module.name}::${struct.name}'\n },\n fetchConfig)\n return this\n }\n `\n return source\n }\n\n generateTypeForDescriptor(type: TypeDescriptor, currentAddress: string): string {\n if (type.reference) {\n return this.ADDRESS_TYPE\n }\n\n switch (type.qname) {\n case 'signer': // TODO check this\n case 'address':\n case 'Address':\n return this.ADDRESS_TYPE\n case '0x1::string::String':\n return 'string'\n case 'bool':\n case 'Bool':\n return 'Boolean'\n case 'u8':\n case 'U8':\n case 'u16':\n case 'U16':\n case 'u32':\n case 'U32':\n return 'number'\n case 'u64':\n case 'U64':\n case 'u128':\n case 'U128':\n case 'u256':\n case 'U256':\n return 'bigint'\n }\n\n if (type.qname.toLowerCase() === VECTOR_STR) {\n // vector<u8> as hex string\n const elementTypeQname = type.typeArgs[0].qname\n if (elementTypeQname === 'u8') {\n // only for aptos\n return 'string'\n }\n if (elementTypeQname.startsWith('T') && !elementTypeQname.includes(SPLITTER)) {\n return `${elementTypeQname}[] | string`\n }\n return this.generateTypeForDescriptor(type.typeArgs[0], currentAddress) + '[]'\n }\n\n const simpleName = this.generateSimpleType(type.qname, currentAddress)\n if (simpleName.length === 0) {\n console.error('unexpected error')\n }\n if (simpleName.toLowerCase() === VECTOR_STR || simpleName.toLowerCase().startsWith(VECTOR_STR + SPLITTER)) {\n console.error('unexpected vector type error')\n }\n if (type.typeArgs.length > 0) {\n // return simpleName\n return (\n simpleName + '<' + type.typeArgs.map((t) => this.generateTypeForDescriptor(t, currentAddress)).join(',') + '>'\n )\n }\n return simpleName\n }\n\n generateSimpleType(type: string, currentAddress: string): string {\n const parts = type.split(SPLITTER)\n\n for (let i = 0; i < parts.length; i++) {\n parts[i] = normalizeToJSName(parts[i])\n }\n\n if (parts.length < 2) {\n return parts[0]\n }\n if (parts[0] === currentAddress) {\n return parts.slice(1).join('.')\n }\n return '_' + parts.join('.')\n }\n}\n\nexport class AccountCodegen<NetworkType, ModuleType, StructType> {\n modules: InternalMoveModule[]\n config: Config<NetworkType>\n abi: ModuleType[]\n loader: AccountRegister\n moduleGen: AbstractCodegen<NetworkType, ModuleType, StructType>\n\n constructor(\n moduleGen: AbstractCodegen<NetworkType, ModuleType, StructType>,\n loader: AccountRegister,\n abi: ModuleType[],\n modules: InternalMoveModule[],\n config: Config<NetworkType>\n ) {\n // const json = fs.readFileSync(config.srcFile, 'utf-8')\n this.moduleGen = moduleGen\n this.abi = abi\n this.modules = modules\n this.config = config\n this.loader = loader\n }\n\n generate(): OutputFile[] {\n if (!this.modules) {\n return []\n }\n // const baseName = path.basename(this.config.fileName, '.json')\n\n let address: string | undefined\n for (const module of this.modules) {\n address = module.address\n }\n if (!address) {\n return []\n }\n\n const imports = `\n import { CallFilter, TypeDescriptor, ANY_TYPE } from \"@sentio/sdk/move\"\n import {\n MoveCoder, defaultMoveCoder, ${this.moduleGen.PREFIX}BindOptions, ${this.moduleGen.PREFIX}BaseProcessor,\n TypedEventInstance, ${this.moduleGen.PREFIX}Network, TypedFunctionPayload,\n ${this.moduleGen.PREFIX}Context } from \"@sentio/sdk/${this.moduleGen.PREFIX.toLowerCase()}\"\n import { MoveFetchConfig } from \"@sentio/protos\"\n import { ${this.moduleGen.ADDRESS_TYPE}, ModuleClient } from \"@sentio/sdk/${this.moduleGen.PREFIX.toLowerCase()}\"\n `\n\n const dependedAccounts: string[] = []\n\n const moduleImports: string[] = []\n\n const info = this.loader.accountImports.get(address)\n\n if (info) {\n for (const [account] of info.imports.entries()) {\n // Remap to user's filename if possible, TODO codepath not well tested\n const tsAccountModule = './' + (this.loader.accountImports.get(account)?.moduleName || account)\n if (isFrameworkAccount(account) && !isFrameworkAccount(address)) {\n // Decide where to find runtime library\n moduleImports.push(`import { _${account} } from \"@sentio/sdk/${this.moduleGen.PREFIX.toLowerCase()}/builtin\"`)\n } else {\n moduleImports.push(`import * as _${account} from \"${tsAccountModule}.js\"`)\n }\n\n dependedAccounts.push(account)\n }\n }\n\n let loadAllTypes = `loadAllTypes(defaultMoveCoder(${\n this.moduleGen.PREFIX\n }Network.${this.moduleGen.generateNetworkOption(this.config.network)}))`\n\n if (this.moduleGen.SYSTEM_MODULES.has(address)) {\n loadAllTypes = `\n loadAllTypes(defaultMoveCoder(${this.moduleGen.PREFIX}Network.MAIN_NET))\n loadAllTypes(defaultMoveCoder(${this.moduleGen.PREFIX}Network.TEST_NET))\n `\n }\n\n const source = `\n /* Autogenerated file. Do not edit manually. */\n /* tslint:disable */\n /* eslint-disable */\n\n /* Generated modules for account ${address} */\n\n ${imports}\n\n ${moduleImports.join('\\n')}\n\n ${this.modules.map((m) => this.moduleGen.generateModule(m, this.config.network)).join('\\n')}\n\n const MODULES = JSON.parse('${JSON.stringify(this.abi)}')\n\n export function loadAllTypes(coder: MoveCoder) {\n ${dependedAccounts.map((a) => `_${a}.loadAllTypes(coder)`).join('\\n')}\n for (const m of Object.values(MODULES)) {\n coder.load(m as any)\n }\n }\n\n ${loadAllTypes}\n ` // source\n\n return [\n {\n fileName: this.config.fileName + '.ts',\n fileContent: source,\n },\n ]\n }\n}\n"]}
1
+ {"version":3,"file":"abstract-codegen.js","sourceRoot":"","sources":["../../src/move/abstract-codegen.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,8BAA8B,GAG/B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACxE,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,iBAAiB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACrG,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAejD,MAAM,OAAgB,eAAe;IACnC,QAAQ,CAAa;IACrB,QAAQ,CAAa;IACrB,YAAY,CAAQ;IACpB,MAAM,CAAQ;IACd,iBAAiB,GAAW,MAAM,CAAA;IAClC,eAAe,GAAG,KAAK,CAAA;IACvB,iBAAiB,GAAG,IAAI,CAAA;IACxB,gBAAgB,GAAG,KAAK,CAAA;IACxB,cAAc,GAAG,IA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AAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;kCAE7D,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC;;;QAGlD,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;;MAMrE,YAAY;KACb,CAAA,CAAC,SAAS;QAEX,OAAO;YACL;gBACE,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,KAAK;gBACtC,WAAW,EAAE,MAAM;aACpB;SACF,CAAA;IACH,CAAC;CACF","sourcesContent":["import {\n InternalMoveFunction,\n InternalMoveFunctionVisibility,\n InternalMoveModule,\n InternalMoveStruct,\n} from './internal-models.js'\nimport path from 'path'\nimport fs from 'fs'\nimport { AccountModulesImportInfo, AccountRegister } from './account.js'\nimport chalk from 'chalk'\nimport { format } from 'prettier'\nimport { isFrameworkAccount, moduleQname, normalizeToJSName, SPLITTER, VECTOR_STR } from './utils.js'\nimport { camelCase, upperFirst } from 'lodash-es'\nimport { TypeDescriptor } from './types.js'\nimport { ChainAdapter } from './chain-adapter.js'\n\ninterface OutputFile {\n fileName: string\n fileContent: string\n}\n\ninterface Config<NetworkType> {\n fileName: string\n outputDir: string\n network: NetworkType\n}\n\nexport abstract class AbstractCodegen<NetworkType, ModuleTypes, StructType> {\n TEST_NET: NetworkType\n MAIN_NET: NetworkType\n ADDRESS_TYPE: string\n PREFIX: string\n STRUCT_FIELD_NAME: string = 'data'\n GENERATE_CLIENT = false\n GENERATE_ON_ENTRY = true\n PAYLOAD_OPTIONAL = false\n SYSTEM_MODULES = new Set(['0x1', '0x2', '0x3'])\n\n chainAdapter: ChainAdapter<NetworkType, ModuleTypes, StructType>\n\n protected constructor(chainAdapter: ChainAdapter<NetworkType, ModuleTypes, StructType>) {\n this.chainAdapter = chainAdapter\n }\n\n readModulesFile(fullPath: string) {\n return JSON.parse(fs.readFileSync(fullPath, 'utf-8'))\n }\n\n async generate(srcDir: string, outputDir: string, builtin = false): Promise<number> {\n const num1 = await this.generateForNetwork(srcDir, outputDir, this.MAIN_NET, builtin)\n const num2 = await this.generateForNetwork(\n path.join(srcDir, 'testnet'),\n path.join(outputDir, 'testnet'),\n this.TEST_NET,\n builtin\n )\n return num1 + num2\n }\n\n async generateForNetwork(srcDir: string, outputDir: string, network: NetworkType, builtin = false) {\n if (!fs.existsSync(srcDir)) {\n return 0\n }\n\n const files = fs.readdirSync(srcDir)\n outputDir = path.resolve(outputDir)\n const outputs: OutputFile[] = []\n\n fs.mkdirSync(outputDir, { recursive: true })\n\n const loader = new AccountRegister()\n\n // when generating user code, don't need to generate framework account\n for (const sysModule of this.SYSTEM_MODULES) {\n loader.accountImports.set(sysModule, new AccountModulesImportInfo(sysModule, sysModule))\n }\n // const client = getRpcClient(network)\n\n for (const file of files) {\n if (!file.endsWith('.json')) {\n continue\n }\n const fullPath = path.resolve(srcDir, file)\n const abi = this.readModulesFile(fullPath)\n const modules = this.chainAdapter.toInternalModules(abi)\n\n for (const module of modules) {\n loader.register(module, path.basename(file, '.json'))\n }\n const codeGen = new AccountCodegen(this, loader, abi, modules, {\n fileName: path.basename(file, '.json'),\n outputDir: outputDir,\n network,\n })\n\n outputs.push(...codeGen.generate())\n }\n\n while (loader.pendingAccounts.size > 0) {\n for (const account of loader.pendingAccounts) {\n console.log(`download dependent module for account ${account} at ${network}`)\n\n try {\n const rawModules = await this.chainAdapter.fetchModules(account, network)\n const modules = this.chainAdapter.toInternalModules(rawModules)\n\n fs.writeFileSync(path.resolve(srcDir, account + '.json'), JSON.stringify(rawModules, null, '\\t'))\n for (const module of modules) {\n loader.register(module, account)\n }\n const codeGen = new AccountCodegen(this, loader, rawModules, modules, {\n fileName: account,\n outputDir: outputDir,\n network,\n })\n\n outputs.push(...codeGen.generate())\n } catch (e) {\n console.error(\n chalk.red(\n 'Error downloading account module, check if you choose the right network,or download account modules manually into your director'\n )\n )\n console.error(e)\n process.exit(1)\n }\n }\n }\n\n for (const output of outputs) {\n // const content = output.fileContent\n const content = format(output.fileContent, { parser: 'typescript' })\n fs.writeFileSync(path.join(outputDir, output.fileName), content)\n }\n\n const rootFile = path.join(outputDir, 'index.ts')\n let rootFileContent = `/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n`\n for (const output of outputs) {\n const parsed = path.parse(output.fileName)\n rootFileContent += `export * as _${parsed.name.replaceAll('-', '_')} from './${parsed.name}.js'\\n`\n }\n // if (builtin) {\n // rootFileContent += `export { BUILTIN_TYPES } from '@sentio/sdk/move'`\n // }\n fs.writeFileSync(rootFile, rootFileContent)\n\n return outputs.length + 1\n }\n\n generateNetworkOption(network: NetworkType) {\n switch (network) {\n case this.TEST_NET:\n return 'TEST_NET'\n }\n return 'MAIN_NET'\n }\n\n generateModule(module: InternalMoveModule, network: NetworkType) {\n const functions = this.GENERATE_ON_ENTRY\n ? module.exposedFunctions.map((f) => this.generateOnEntryFunctions(module, f)).filter((s) => s !== '')\n : []\n const clientFunctions = this.GENERATE_CLIENT\n ? module.exposedFunctions.map((f) => this.generateClientFunctions(module, f)).filter((s) => s !== '')\n : []\n const eventStructs = this.chainAdapter.getEventStructs(module)\n const eventTypes = new Set(eventStructs.keys())\n const events = Array.from(eventStructs.values())\n .map((e) => this.generateOnEvents(module, e))\n .filter((s) => s !== '')\n const structs = module.structs.map((s) => this.generateStructs(module, s, eventTypes))\n const callArgs = module.exposedFunctions.map((f) => this.generateCallArgsStructs(module, f))\n\n const moduleName = normalizeToJSName(module.name)\n let processor = ''\n let client = ''\n\n if (clientFunctions.length > 0) {\n client = `\n export class ${moduleName}_client extends ModuleClient {\n ${clientFunctions.join('\\n')}\n }\n `\n }\n\n if (functions.length > 0 || events.length > 0) {\n processor = `export class ${moduleName} extends ${this.PREFIX}BaseProcessor {\n\n constructor(options: ${this.PREFIX}BindOptions) {\n super(\"${module.name}\", options)\n }\n static DEFAULT_OPTIONS: ${this.PREFIX}BindOptions = {\n address: \"${module.address}\",\n network: ${this.PREFIX}Network.${this.generateNetworkOption(network)}\n }\n\n static bind(options: Partial<${this.PREFIX}BindOptions> = {}): ${moduleName} {\n return new ${moduleName}({ ...${moduleName}.DEFAULT_OPTIONS, ...options })\n }\n\n ${functions.join('\\n')}\n\n ${events.join('\\n')}\n }\n `\n }\n\n return `\n ${client}\n\n ${processor}\n\n export namespace ${moduleName} {\n ${structs.join('\\n')}\n\n ${callArgs.join('\\n')}\n }\n `\n }\n\n generateStructs(module: InternalMoveModule, struct: InternalMoveStruct, events: Set<string>, typeOnly = false) {\n const typeParams = struct.typeParams || []\n const genericString = this.generateStructTypeParameters(struct)\n const genericStringAny = this.generateStructTypeParameters(struct, true)\n\n const structName = normalizeToJSName(struct.name)\n\n const fields = struct.fields.map((field) => {\n const type = this.generateTypeForDescriptor(field.type, module.address)\n return `${field.name}: ${type}`\n })\n\n const typeParamApplyArg = typeParams\n .map((v, idx) => {\n return `arg${idx}: TypeDescriptor<T${idx}> = ANY_TYPE`\n })\n .join(',')\n const typeParamApply = typeParams\n .map((v, idx) => {\n return `arg${idx}`\n })\n .join(',')\n\n const typeDescriptor = `\n export namespace ${structName}{\n export const TYPE_QNAME = '${module.address}::${module.name}::${struct.name}'\n \n const TYPE = new TypeDescriptor<${structName}${genericStringAny}>(${structName}.TYPE_QNAME)\n\n export function type${genericString}(${typeParamApplyArg}): TypeDescriptor<${structName}${genericString}> {\n return TYPE.apply(${typeParamApply})\n }\n}\n`\n if (typeOnly) {\n return typeDescriptor\n }\n\n let eventPayload = ''\n if (events.has(moduleQname(module) + SPLITTER + struct.name)) {\n eventPayload = `\n export interface ${structName}Instance extends\n TypedEventInstance<${structName}${genericStringAny}> {\n ${this.STRUCT_FIELD_NAME}_decoded: ${structName}${genericStringAny}\n type_arguments: [${struct.typeParams.map((_) => 'string').join(', ')}]\n }\n `\n }\n\n return `\n export interface ${structName}${genericString} {\n ${fields.join('\\n')}\n }\n \n ${typeDescriptor}\n\n ${eventPayload}\n `\n }\n\n generateFunctionTypeParameters(func: InternalMoveFunction) {\n let genericString = ''\n if (func.typeParams && func.typeParams.length > 0) {\n const params = func.typeParams\n .map((v, idx) => {\n return `T${idx}=any`\n })\n .join(',')\n genericString = `<${params}>`\n }\n return genericString\n }\n\n generateStructTypeParameters(struct: InternalMoveStruct, useAny = false) {\n let genericString = ''\n\n if (struct.typeParams && struct.typeParams.length > 0) {\n const params = struct.typeParams\n .map((v, idx) => {\n return useAny ? 'any' : 'T' + idx\n })\n .join(',')\n genericString = `<${params}>`\n }\n return genericString\n }\n\n generateCallArgsStructs(module: InternalMoveModule, func: InternalMoveFunction) {\n if (!func.isEntry) {\n return\n }\n\n const fields = this.chainAdapter.getMeaningfulFunctionParams(func.params).map((param) => {\n return this.generateTypeForDescriptor(param, module.address) + (this.PAYLOAD_OPTIONAL ? ' | undefined' : '')\n })\n\n const camelFuncName = upperFirst(camelCase(func.name))\n\n const genericString = this.generateFunctionTypeParameters(func)\n return `\n export interface ${camelFuncName}Payload${genericString}\n extends TypedFunctionPayload<[${fields.join(',')}]> {\n arguments_decoded: [${fields.join(',')}],\n type_arguments: [${func.typeParams.map((_) => 'string').join(', ')}]\n }\n `\n }\n\n generateClientFunctions(module: InternalMoveModule, func: InternalMoveFunction) {\n if (func.visibility === InternalMoveFunctionVisibility.PRIVATE) {\n return ''\n }\n if (func.isEntry) {\n return ''\n }\n // const moduleName = normalizeToJSName(module.name)\n const funcName = camelCase(func.name)\n const fields = this.chainAdapter.getMeaningfulFunctionParams(func.params).map((param) => {\n return this.generateTypeForDescriptor(param, module.address)\n })\n const genericString = this.generateFunctionTypeParameters(func)\n\n const returns = func.return.map((param) => {\n return this.generateTypeForDescriptor(param, module.address)\n })\n\n const source = `\n ${funcName}${genericString}(type_arguments: [${func.typeParams\n .map((_) => 'string')\n .join(', ')}], args: [${fields.join(',')}], version?: bigint): Promise<[${returns.join(',')}]> {\n return this.viewDecoded('${module.address}::${module.name}::${func.name}', type_arguments, args, version) as any\n }`\n return source\n }\n\n generateOnEntryFunctions(module: InternalMoveModule, func: InternalMoveFunction) {\n if (!func.isEntry) {\n return ''\n }\n\n // const genericString = generateFunctionTypeParameters(func)\n const moduleName = normalizeToJSName(module.name)\n\n const camelFuncName = upperFirst(camelCase(func.name))\n const source = `\n onEntry${camelFuncName}(func: (call: ${moduleName}.${camelFuncName}Payload, ctx: ${this.PREFIX}Context) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): ${moduleName} {\n this.onEntryFunctionCall(func, {\n ...filter,\n function: '${module.name}::${func.name}'\n },\n fetchConfig)\n return this\n }`\n\n return source\n }\n\n generateOnEvents(module: InternalMoveModule, struct: InternalMoveStruct): string {\n // for struct that has drop + store\n // if (!isEvent(struct, module)) {\n // return ''\n // }\n\n // const genericString = generateStructTypeParameters(struct)\n\n const moduleName = normalizeToJSName(module.name)\n const source = `\n onEvent${struct.name}(func: (event: ${moduleName}.${normalizeToJSName(struct.name)}Instance, ctx: ${\n this.PREFIX\n }Context) => void, fetchConfig?: Partial<MoveFetchConfig>): ${moduleName} {\n this.onMoveEvent(func, {\n type: '${module.name}::${struct.name}'\n },\n fetchConfig)\n return this\n }\n `\n return source\n }\n\n generateTypeForDescriptor(type: TypeDescriptor, currentAddress: string): string {\n if (type.reference) {\n return this.ADDRESS_TYPE\n }\n\n switch (type.qname) {\n case 'signer': // TODO check this\n case 'address':\n case 'Address':\n return this.ADDRESS_TYPE\n case '0x1::string::String':\n return 'string'\n case 'bool':\n case 'Bool':\n return 'Boolean'\n case 'u8':\n case 'U8':\n case 'u16':\n case 'U16':\n case 'u32':\n case 'U32':\n return 'number'\n case 'u64':\n case 'U64':\n case 'u128':\n case 'U128':\n case 'u256':\n case 'U256':\n return 'bigint'\n }\n\n if (type.qname.toLowerCase() === VECTOR_STR) {\n // vector<u8> as hex string\n const elementTypeQname = type.typeArgs[0].qname\n if (elementTypeQname === 'u8') {\n // only for aptos\n return 'string'\n }\n if (elementTypeQname.startsWith('T') && !elementTypeQname.includes(SPLITTER)) {\n return `${elementTypeQname}[] | string`\n }\n return this.generateTypeForDescriptor(type.typeArgs[0], currentAddress) + '[]'\n }\n\n const simpleName = this.generateSimpleType(type.qname, currentAddress)\n if (simpleName.length === 0) {\n console.error('unexpected error')\n }\n if (simpleName.toLowerCase() === VECTOR_STR || simpleName.toLowerCase().startsWith(VECTOR_STR + SPLITTER)) {\n console.error('unexpected vector type error')\n }\n if (type.typeArgs.length > 0) {\n // return simpleName\n return (\n simpleName + '<' + type.typeArgs.map((t) => this.generateTypeForDescriptor(t, currentAddress)).join(',') + '>'\n )\n }\n return simpleName\n }\n\n generateSimpleType(type: string, currentAddress: string): string {\n const parts = type.split(SPLITTER)\n\n for (let i = 0; i < parts.length; i++) {\n parts[i] = normalizeToJSName(parts[i])\n }\n\n if (parts.length < 2) {\n return parts[0]\n }\n if (parts[0] === currentAddress) {\n return parts.slice(1).join('.')\n }\n return '_' + parts.join('.')\n }\n}\n\nexport class AccountCodegen<NetworkType, ModuleType, StructType> {\n modules: InternalMoveModule[]\n config: Config<NetworkType>\n abi: ModuleType[]\n loader: AccountRegister\n moduleGen: AbstractCodegen<NetworkType, ModuleType, StructType>\n\n constructor(\n moduleGen: AbstractCodegen<NetworkType, ModuleType, StructType>,\n loader: AccountRegister,\n abi: ModuleType[],\n modules: InternalMoveModule[],\n config: Config<NetworkType>\n ) {\n // const json = fs.readFileSync(config.srcFile, 'utf-8')\n this.moduleGen = moduleGen\n this.abi = abi\n this.modules = modules\n this.config = config\n this.loader = loader\n }\n\n generate(): OutputFile[] {\n if (!this.modules) {\n return []\n }\n // const baseName = path.basename(this.config.fileName, '.json')\n\n let address: string | undefined\n for (const module of this.modules) {\n address = module.address\n }\n if (!address) {\n return []\n }\n\n const imports = `\n import { CallFilter, TypeDescriptor, ANY_TYPE } from \"@sentio/sdk/move\"\n import {\n MoveCoder, defaultMoveCoder, ${this.moduleGen.PREFIX}BindOptions, ${this.moduleGen.PREFIX}BaseProcessor,\n TypedEventInstance, ${this.moduleGen.PREFIX}Network, TypedFunctionPayload,\n ${this.moduleGen.PREFIX}Context } from \"@sentio/sdk/${this.moduleGen.PREFIX.toLowerCase()}\"\n import { MoveFetchConfig } from \"@sentio/protos\"\n import { ${this.moduleGen.ADDRESS_TYPE}, ModuleClient } from \"@sentio/sdk/${this.moduleGen.PREFIX.toLowerCase()}\"\n `\n\n const dependedAccounts: string[] = []\n\n const moduleImports: string[] = []\n\n const info = this.loader.accountImports.get(address)\n\n if (info) {\n for (const [account] of info.imports.entries()) {\n // Remap to user's filename if possible, TODO codepath not well tested\n const tsAccountModule = './' + (this.loader.accountImports.get(account)?.moduleName || account)\n if (isFrameworkAccount(account) && !isFrameworkAccount(address)) {\n // Decide where to find runtime library\n moduleImports.push(`import { _${account} } from \"@sentio/sdk/${this.moduleGen.PREFIX.toLowerCase()}/builtin\"`)\n } else {\n moduleImports.push(`import * as _${account} from \"${tsAccountModule}.js\"`)\n }\n\n dependedAccounts.push(account)\n }\n }\n\n let loadAllTypes = `loadAllTypes(defaultMoveCoder(${\n this.moduleGen.PREFIX\n }Network.${this.moduleGen.generateNetworkOption(this.config.network)}))`\n\n if (this.moduleGen.SYSTEM_MODULES.has(address)) {\n loadAllTypes = `\n loadAllTypes(defaultMoveCoder(${this.moduleGen.PREFIX}Network.MAIN_NET))\n loadAllTypes(defaultMoveCoder(${this.moduleGen.PREFIX}Network.TEST_NET))\n `\n }\n\n const source = `\n /* Autogenerated file. Do not edit manually. */\n /* tslint:disable */\n /* eslint-disable */\n\n /* Generated modules for account ${address} */\n\n ${imports}\n\n ${moduleImports.join('\\n')}\n\n ${this.modules.map((m) => this.moduleGen.generateModule(m, this.config.network)).join('\\n')}\n\n const MODULES = JSON.parse('${JSON.stringify(this.abi)}')\n\n export function loadAllTypes(coder: MoveCoder) {\n ${dependedAccounts.map((a) => `_${a}.loadAllTypes(coder)`).join('\\n')}\n for (const m of Object.values(MODULES)) {\n coder.load(m as any)\n }\n }\n\n ${loadAllTypes}\n ` // source\n\n return [\n {\n fileName: this.config.fileName + '.ts',\n fileContent: source,\n },\n ]\n }\n}\n"]}
@@ -4,7 +4,15 @@ import { MoveFetchConfig } from "@sentio/protos";
4
4
  export declare namespace address { }
5
5
  export declare namespace ascii {
6
6
  type Char = string;
7
+ namespace Char {
8
+ const TYPE_QNAME = "0x1::ascii::Char";
9
+ function type(): TypeDescriptor<Char>;
10
+ }
7
11
  type String = string;
12
+ namespace String {
13
+ const TYPE_QNAME = "0x1::ascii::String";
14
+ function type(): TypeDescriptor<String>;
15
+ }
8
16
  }
9
17
  export declare namespace bcs { }
10
18
  export declare class bit_vector extends SuiBaseProcessor {
@@ -50,6 +58,10 @@ export declare namespace fixed_point32 {
50
58
  export declare namespace hash { }
51
59
  export declare namespace option {
52
60
  type Option<T> = T | undefined;
61
+ namespace Option {
62
+ const TYPE_QNAME = "0x1::option::Option";
63
+ function type<T0>(arg0?: TypeDescriptor<T0>): TypeDescriptor<Option<T0>>;
64
+ }
53
65
  }
54
66
  export declare class string_ extends SuiBaseProcessor {
55
67
  constructor(options: SuiBindOptions);
@@ -2,8 +2,29 @@
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
4
  /* Generated modules for account 0x1 */
5
- import { TypeDescriptor } from "@sentio/sdk/move";
5
+ import { TypeDescriptor, ANY_TYPE } from "@sentio/sdk/move";
6
6
  import { defaultMoveCoder, SuiBaseProcessor, SuiNetwork, } from "@sentio/sdk/sui";
7
+ export var ascii;
8
+ (function (ascii) {
9
+ let Char;
10
+ (function (Char) {
11
+ Char.TYPE_QNAME = "0x1::ascii::Char";
12
+ const TYPE = new TypeDescriptor(Char.TYPE_QNAME);
13
+ function type() {
14
+ return TYPE.apply();
15
+ }
16
+ Char.type = type;
17
+ })(Char = ascii.Char || (ascii.Char = {}));
18
+ let String;
19
+ (function (String) {
20
+ String.TYPE_QNAME = "0x1::ascii::String";
21
+ const TYPE = new TypeDescriptor(String.TYPE_QNAME);
22
+ function type() {
23
+ return TYPE.apply();
24
+ }
25
+ String.type = type;
26
+ })(String = ascii.String || (ascii.String = {}));
27
+ })(ascii || (ascii = {}));
7
28
  class bit_vector extends SuiBaseProcessor {
8
29
  constructor(options) {
9
30
  super("bit_vector", options);
@@ -64,6 +85,18 @@ export { fixed_point32 };
64
85
  FixedPoint32.type = type;
65
86
  })(FixedPoint32 = fixed_point32.FixedPoint32 || (fixed_point32.FixedPoint32 = {}));
66
87
  })(fixed_point32 || (fixed_point32 = {}));
88
+ export var option;
89
+ (function (option) {
90
+ let Option;
91
+ (function (Option) {
92
+ Option.TYPE_QNAME = "0x1::option::Option";
93
+ const TYPE = new TypeDescriptor(Option.TYPE_QNAME);
94
+ function type(arg0 = ANY_TYPE) {
95
+ return TYPE.apply(arg0);
96
+ }
97
+ Option.type = type;
98
+ })(Option = option.Option || (option.Option = {}));
99
+ })(option || (option = {}));
67
100
  class string_ extends SuiBaseProcessor {
68
101
  constructor(options) {
69
102
  super("string", options);
@@ -1 +1 @@
1
- {"version":3,"file":"0x1.js","sourceRoot":"","sources":["../../../src/sui/builtin/0x1.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,oBAAoB;AACpB,oBAAoB;AAEpB,uCAAuC;AAEvC,OAAO,EAAc,cAAc,EAAY,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAEL,gBAAgB,EAEhB,gBAAgB,EAEhB,UAAU,GAGX,MAAM,iBAAiB,CAAC;AAazB,MAAa,UAAW,SAAQ,gBAAgB;IAC9C,YAAY,OAAuB;QACjC,KAAK,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC;IACD,MAAM,CAAC,eAAe,GAAmB;QACvC,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,UAAU,CAAC,QAAQ;KAC7B,CAAC;IAEF,MAAM,CAAC,IAAI,CAAC,UAAmC,EAAE;QAC/C,OAAO,IAAI,UAAU,CAAC,EAAE,GAAG,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gBAAgB,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;AACpD,YAAY,CAAC,gBAAgB,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC","sourcesContent":["/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n\n/* Generated modules for account 0x1 */\n\nimport { CallFilter, TypeDescriptor, ANY_TYPE } from \"@sentio/sdk/move\";\nimport {\n MoveCoder,\n defaultMoveCoder,\n SuiBindOptions,\n SuiBaseProcessor,\n TypedEventInstance,\n SuiNetwork,\n TypedFunctionPayload,\n SuiContext,\n} from \"@sentio/sdk/sui\";\nimport { MoveFetchConfig } from \"@sentio/protos\";\nimport { SuiAddress, ModuleClient } from \"@sentio/sdk/sui\";\n\nexport namespace address {}\n\nexport namespace ascii {\n export type Char = string;\n export type String = string;\n}\n\nexport namespace bcs {}\n\nexport class bit_vector extends SuiBaseProcessor {\n constructor(options: SuiBindOptions) {\n super(\"bit_vector\", options);\n }\n static DEFAULT_OPTIONS: SuiBindOptions = {\n address: \"0x1\",\n network: SuiNetwork.MAIN_NET,\n };\n\n static bind(options: Partial<SuiBindOptions> = {}): bit_vector {\n return new bit_vector({ ...bit_vector.DEFAULT_OPTIONS, ...options });\n }\n\n onEventBitVector(\n func: (event: bit_vector.BitVectorInstance, ctx: SuiContext) => void,\n fetchConfig?: Partial<MoveFetchConfig>\n ): bit_vector {\n this.onMoveEvent(\n func,\n {\n type: \"bit_vector::BitVector\",\n },\n fetchConfig\n );\n return this;\n }\n}\n\nexport namespace bit_vector {\n export interface BitVector {\n length: bigint;\n bit_field: Boolean[];\n }\n\n export namespace BitVector {\n export const TYPE_QNAME = \"0x1::bit_vector::BitVector\";\n\n const TYPE = new TypeDescriptor<BitVector>(BitVector.TYPE_QNAME);\n\n export function type(): TypeDescriptor<BitVector> {\n return TYPE.apply();\n }\n }\n\n export interface BitVectorInstance extends TypedEventInstance<BitVector> {\n data_decoded: BitVector;\n type_arguments: [];\n }\n}\n\nexport namespace debug {}\n\nexport class fixed_point32 extends SuiBaseProcessor {\n constructor(options: SuiBindOptions) {\n super(\"fixed_point32\", options);\n }\n static DEFAULT_OPTIONS: SuiBindOptions = {\n address: \"0x1\",\n network: SuiNetwork.MAIN_NET,\n };\n\n static bind(options: Partial<SuiBindOptions> = {}): fixed_point32 {\n return new fixed_point32({ ...fixed_point32.DEFAULT_OPTIONS, ...options });\n }\n\n onEventFixedPoint32(\n func: (event: fixed_point32.FixedPoint32Instance, ctx: SuiContext) => void,\n fetchConfig?: Partial<MoveFetchConfig>\n ): fixed_point32 {\n this.onMoveEvent(\n func,\n {\n type: \"fixed_point32::FixedPoint32\",\n },\n fetchConfig\n );\n return this;\n }\n}\n\nexport namespace fixed_point32 {\n export interface FixedPoint32 {\n value: bigint;\n }\n\n export namespace FixedPoint32 {\n export const TYPE_QNAME = \"0x1::fixed_point32::FixedPoint32\";\n\n const TYPE = new TypeDescriptor<FixedPoint32>(FixedPoint32.TYPE_QNAME);\n\n export function type(): TypeDescriptor<FixedPoint32> {\n return TYPE.apply();\n }\n }\n\n export interface FixedPoint32Instance\n extends TypedEventInstance<FixedPoint32> {\n data_decoded: FixedPoint32;\n type_arguments: [];\n }\n}\n\nexport namespace hash {}\n\nexport namespace option {\n export type Option<T> = T | undefined;\n}\n\nexport class string_ extends SuiBaseProcessor {\n constructor(options: SuiBindOptions) {\n super(\"string\", options);\n }\n static DEFAULT_OPTIONS: SuiBindOptions = {\n address: \"0x1\",\n network: SuiNetwork.MAIN_NET,\n };\n\n static bind(options: Partial<SuiBindOptions> = {}): string_ {\n return new string_({ ...string_.DEFAULT_OPTIONS, ...options });\n }\n\n onEventString(\n func: (event: string_.StringInstance, ctx: SuiContext) => void,\n fetchConfig?: Partial<MoveFetchConfig>\n ): string_ {\n this.onMoveEvent(\n func,\n {\n type: \"string::String\",\n },\n fetchConfig\n );\n return this;\n }\n}\n\nexport namespace string_ {\n export interface String {\n bytes: number[];\n }\n\n export namespace String {\n export const TYPE_QNAME = \"0x1::string::String\";\n\n const TYPE = new TypeDescriptor<String>(String.TYPE_QNAME);\n\n export function type(): TypeDescriptor<String> {\n return TYPE.apply();\n }\n }\n\n export interface StringInstance extends TypedEventInstance<String> {\n data_decoded: String;\n type_arguments: [];\n }\n}\n\nexport class type_name extends SuiBaseProcessor {\n constructor(options: SuiBindOptions) {\n super(\"type_name\", options);\n }\n static DEFAULT_OPTIONS: SuiBindOptions = {\n address: \"0x1\",\n network: SuiNetwork.MAIN_NET,\n };\n\n static bind(options: Partial<SuiBindOptions> = {}): type_name {\n return new type_name({ ...type_name.DEFAULT_OPTIONS, ...options });\n }\n\n onEventTypeName(\n func: (event: type_name.TypeNameInstance, ctx: SuiContext) => void,\n fetchConfig?: Partial<MoveFetchConfig>\n ): type_name {\n this.onMoveEvent(\n func,\n {\n type: \"type_name::TypeName\",\n },\n fetchConfig\n );\n return this;\n }\n}\n\nexport namespace type_name {\n export interface TypeName {\n name: ascii.String;\n }\n\n export namespace TypeName {\n export const TYPE_QNAME = \"0x1::type_name::TypeName\";\n\n const TYPE = new TypeDescriptor<TypeName>(TypeName.TYPE_QNAME);\n\n export function type(): TypeDescriptor<TypeName> {\n return TYPE.apply();\n }\n }\n\n export interface TypeNameInstance extends TypedEventInstance<TypeName> {\n data_decoded: TypeName;\n type_arguments: [];\n }\n}\n\nexport namespace vector {}\n\nconst MODULES = JSON.parse(\n '{\"address\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"address\",\"friends\":[],\"structs\":{},\"exposedFunctions\":{\"length\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[],\"return\":[\"U64\"]}}},\"ascii\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"ascii\",\"friends\":[],\"structs\":{\"Char\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"typeParameters\":[],\"fields\":[{\"name\":\"byte\",\"type\":\"U8\"}]},\"String\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"typeParameters\":[],\"fields\":[{\"name\":\"bytes\",\"type\":{\"Vector\":\"U8\"}}]}},\"exposedFunctions\":{\"all_characters_printable\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}}],\"return\":[\"Bool\"]},\"as_bytes\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}}],\"return\":[{\"Reference\":{\"Vector\":\"U8\"}}]},\"byte\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"Char\",\"typeArguments\":[]}}],\"return\":[\"U8\"]},\"char\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[\"U8\"],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"Char\",\"typeArguments\":[]}}]},\"into_bytes\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}],\"return\":[{\"Vector\":\"U8\"}]},\"is_printable_char\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[\"U8\"],\"return\":[\"Bool\"]},\"is_valid_char\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[\"U8\"],\"return\":[\"Bool\"]},\"length\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}}],\"return\":[\"U64\"]},\"pop_char\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"Char\",\"typeArguments\":[]}}]},\"push_char\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}},{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"Char\",\"typeArguments\":[]}}],\"return\":[]},\"string\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}]},\"try_string\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}]}}]}}},\"bcs\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"bcs\",\"friends\":[],\"structs\":{},\"exposedFunctions\":{\"to_bytes\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"TypeParameter\":0}}],\"return\":[{\"Vector\":\"U8\"}]}}},\"bit_vector\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"bit_vector\",\"friends\":[],\"structs\":{\"BitVector\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"typeParameters\":[],\"fields\":[{\"name\":\"length\",\"type\":\"U64\"},{\"name\":\"bit_field\",\"type\":{\"Vector\":\"Bool\"}}]}},\"exposedFunctions\":{\"is_index_set\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"typeArguments\":[]}}},\"U64\"],\"return\":[\"Bool\"]},\"length\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"typeArguments\":[]}}}],\"return\":[\"U64\"]},\"longest_set_sequence_starting_at\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"typeArguments\":[]}}},\"U64\"],\"return\":[\"U64\"]},\"new\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[\"U64\"],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"typeArguments\":[]}}]},\"set\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"typeArguments\":[]}}},\"U64\"],\"return\":[]},\"shift_left\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"typeArguments\":[]}}},\"U64\"],\"return\":[]},\"unset\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"typeArguments\":[]}}},\"U64\"],\"return\":[]}}},\"debug\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"debug\",\"friends\":[],\"structs\":{},\"exposedFunctions\":{\"print\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"TypeParameter\":0}}],\"return\":[]},\"print_stack_trace\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[],\"return\":[]}}},\"fixed_point32\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"fixed_point32\",\"friends\":[],\"structs\":{\"FixedPoint32\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"typeParameters\":[],\"fields\":[{\"name\":\"value\",\"type\":\"U64\"}]}},\"exposedFunctions\":{\"create_from_rational\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[\"U64\",\"U64\"],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"typeArguments\":[]}}]},\"create_from_raw_value\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[\"U64\"],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"typeArguments\":[]}}]},\"divide_u64\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[\"U64\",{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"typeArguments\":[]}}],\"return\":[\"U64\"]},\"get_raw_value\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"typeArguments\":[]}}],\"return\":[\"U64\"]},\"is_zero\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"typeArguments\":[]}}],\"return\":[\"Bool\"]},\"multiply_u64\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[\"U64\",{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"typeArguments\":[]}}],\"return\":[\"U64\"]}}},\"hash\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"hash\",\"friends\":[],\"structs\":{},\"exposedFunctions\":{\"sha2_256\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return\":[{\"Vector\":\"U8\"}]},\"sha3_256\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return\":[{\"Vector\":\"U8\"}]}}},\"option\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"option\",\"friends\":[],\"structs\":{\"Option\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"typeParameters\":[{\"constraints\":{\"abilities\":[]},\"isPhantom\":false}],\"fields\":[{\"name\":\"vec\",\"type\":{\"Vector\":{\"TypeParameter\":0}}}]}},\"exposedFunctions\":{\"borrow\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}}],\"return\":[{\"Reference\":{\"TypeParameter\":0}}]},\"borrow_mut\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}}],\"return\":[{\"MutableReference\":{\"TypeParameter\":0}}]},\"borrow_with_default\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}},{\"Reference\":{\"TypeParameter\":0}}],\"return\":[{\"Reference\":{\"TypeParameter\":0}}]},\"contains\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}},{\"Reference\":{\"TypeParameter\":0}}],\"return\":[\"Bool\"]},\"destroy_none\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}],\"return\":[]},\"destroy_some\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}],\"return\":[{\"TypeParameter\":0}]},\"destroy_with_default\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[\"Drop\"]}],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}},{\"TypeParameter\":0}],\"return\":[{\"TypeParameter\":0}]},\"extract\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}}],\"return\":[{\"TypeParameter\":0}]},\"fill\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}},{\"TypeParameter\":0}],\"return\":[]},\"get_with_default\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[\"Copy\",\"Drop\"]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}},{\"TypeParameter\":0}],\"return\":[{\"TypeParameter\":0}]},\"is_none\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}}],\"return\":[\"Bool\"]},\"is_some\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}}],\"return\":[\"Bool\"]},\"none\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}]},\"some\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"TypeParameter\":0}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}]},\"swap\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}},{\"TypeParameter\":0}],\"return\":[{\"TypeParameter\":0}]},\"swap_or_fill\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}},{\"TypeParameter\":0}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}]},\"to_vec\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}],\"return\":[{\"Vector\":{\"TypeParameter\":0}}]}}},\"string\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"string\",\"friends\":[],\"structs\":{\"String\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"typeParameters\":[],\"fields\":[{\"name\":\"bytes\",\"type\":{\"Vector\":\"U8\"}}]}},\"exposedFunctions\":{\"append\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}},{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}],\"return\":[]},\"append_utf8\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}},{\"Vector\":\"U8\"}],\"return\":[]},\"bytes\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}}],\"return\":[{\"Reference\":{\"Vector\":\"U8\"}}]},\"from_ascii\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}]},\"index_of\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}},{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}}],\"return\":[\"U64\"]},\"insert\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}},\"U64\",{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}],\"return\":[]},\"is_empty\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}}],\"return\":[\"Bool\"]},\"length\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}}],\"return\":[\"U64\"]},\"sub_string\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}},\"U64\",\"U64\"],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}]},\"to_ascii\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}]},\"try_utf8\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}]}}]},\"utf8\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}]}}},\"type_name\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"type_name\",\"friends\":[],\"structs\":{\"TypeName\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"typeParameters\":[],\"fields\":[{\"name\":\"name\",\"type\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}}]}},\"exposedFunctions\":{\"borrow_string\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"type_name\",\"name\":\"TypeName\",\"typeArguments\":[]}}}],\"return\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}}]},\"get\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"type_name\",\"name\":\"TypeName\",\"typeArguments\":[]}}]},\"get_address\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"type_name\",\"name\":\"TypeName\",\"typeArguments\":[]}}}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}]},\"get_module\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"type_name\",\"name\":\"TypeName\",\"typeArguments\":[]}}}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}]},\"into_string\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"type_name\",\"name\":\"TypeName\",\"typeArguments\":[]}}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}]}}},\"vector\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"vector\",\"friends\":[],\"structs\":{},\"exposedFunctions\":{\"append\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},{\"Vector\":{\"TypeParameter\":0}}],\"return\":[]},\"borrow\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Vector\":{\"TypeParameter\":0}}},\"U64\"],\"return\":[{\"Reference\":{\"TypeParameter\":0}}]},\"borrow_mut\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},\"U64\"],\"return\":[{\"MutableReference\":{\"TypeParameter\":0}}]},\"contains\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Vector\":{\"TypeParameter\":0}}},{\"Reference\":{\"TypeParameter\":0}}],\"return\":[\"Bool\"]},\"destroy_empty\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Vector\":{\"TypeParameter\":0}}],\"return\":[]},\"empty\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[],\"return\":[{\"Vector\":{\"TypeParameter\":0}}]},\"index_of\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Vector\":{\"TypeParameter\":0}}},{\"Reference\":{\"TypeParameter\":0}}],\"return\":[\"Bool\",\"U64\"]},\"insert\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},{\"TypeParameter\":0},\"U64\"],\"return\":[]},\"is_empty\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Vector\":{\"TypeParameter\":0}}}],\"return\":[\"Bool\"]},\"length\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Vector\":{\"TypeParameter\":0}}}],\"return\":[\"U64\"]},\"pop_back\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}}],\"return\":[{\"TypeParameter\":0}]},\"push_back\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},{\"TypeParameter\":0}],\"return\":[]},\"remove\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},\"U64\"],\"return\":[{\"TypeParameter\":0}]},\"reverse\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}}],\"return\":[]},\"singleton\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"TypeParameter\":0}],\"return\":[{\"Vector\":{\"TypeParameter\":0}}]},\"swap\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},\"U64\",\"U64\"],\"return\":[]},\"swap_remove\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},\"U64\"],\"return\":[{\"TypeParameter\":0}]}}}}'\n);\n\nexport function loadAllTypes(coder: MoveCoder) {\n for (const m of Object.values(MODULES)) {\n coder.load(m as any);\n }\n}\n\nloadAllTypes(defaultMoveCoder(SuiNetwork.MAIN_NET));\nloadAllTypes(defaultMoveCoder(SuiNetwork.TEST_NET));\n"]}
1
+ {"version":3,"file":"0x1.js","sourceRoot":"","sources":["../../../src/sui/builtin/0x1.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,oBAAoB;AACpB,oBAAoB;AAEpB,uCAAuC;AAEvC,OAAO,EAAc,cAAc,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAEL,gBAAgB,EAEhB,gBAAgB,EAEhB,UAAU,GAGX,MAAM,iBAAiB,CAAC;AAMzB,MAAM,KAAW,KAAK,CAsBrB;AAtBD,WAAiB,KAAK;IAEpB,IAAiB,IAAI,CAQpB;IARD,WAAiB,IAAI;QACN,eAAU,GAAG,k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CAAC,EAAE;QACtC,KAAK,CAAC,IAAI,CAAC,CAAQ,CAAC,CAAC;KACtB;AACH,CAAC;AAED,YAAY,CAAC,gBAAgB,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC;AACpD,YAAY,CAAC,gBAAgB,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC","sourcesContent":["/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n\n/* Generated modules for account 0x1 */\n\nimport { CallFilter, TypeDescriptor, ANY_TYPE } from \"@sentio/sdk/move\";\nimport {\n MoveCoder,\n defaultMoveCoder,\n SuiBindOptions,\n SuiBaseProcessor,\n TypedEventInstance,\n SuiNetwork,\n TypedFunctionPayload,\n SuiContext,\n} from \"@sentio/sdk/sui\";\nimport { MoveFetchConfig } from \"@sentio/protos\";\nimport { SuiAddress, ModuleClient } from \"@sentio/sdk/sui\";\n\nexport namespace address {}\n\nexport namespace ascii {\n export type Char = string;\n export namespace Char {\n export const TYPE_QNAME = \"0x1::ascii::Char\";\n\n const TYPE = new TypeDescriptor<Char>(Char.TYPE_QNAME);\n\n export function type(): TypeDescriptor<Char> {\n return TYPE.apply();\n }\n }\n\n export type String = string;\n export namespace String {\n export const TYPE_QNAME = \"0x1::ascii::String\";\n\n const TYPE = new TypeDescriptor<String>(String.TYPE_QNAME);\n\n export function type(): TypeDescriptor<String> {\n return TYPE.apply();\n }\n }\n}\n\nexport namespace bcs {}\n\nexport class bit_vector extends SuiBaseProcessor {\n constructor(options: SuiBindOptions) {\n super(\"bit_vector\", options);\n }\n static DEFAULT_OPTIONS: SuiBindOptions = {\n address: \"0x1\",\n network: SuiNetwork.MAIN_NET,\n };\n\n static bind(options: Partial<SuiBindOptions> = {}): bit_vector {\n return new bit_vector({ ...bit_vector.DEFAULT_OPTIONS, ...options });\n }\n\n onEventBitVector(\n func: (event: bit_vector.BitVectorInstance, ctx: SuiContext) => void,\n fetchConfig?: Partial<MoveFetchConfig>\n ): bit_vector {\n this.onMoveEvent(\n func,\n {\n type: \"bit_vector::BitVector\",\n },\n fetchConfig\n );\n return this;\n }\n}\n\nexport namespace bit_vector {\n export interface BitVector {\n length: bigint;\n bit_field: Boolean[];\n }\n\n export namespace BitVector {\n export const TYPE_QNAME = \"0x1::bit_vector::BitVector\";\n\n const TYPE = new TypeDescriptor<BitVector>(BitVector.TYPE_QNAME);\n\n export function type(): TypeDescriptor<BitVector> {\n return TYPE.apply();\n }\n }\n\n export interface BitVectorInstance extends TypedEventInstance<BitVector> {\n data_decoded: BitVector;\n type_arguments: [];\n }\n}\n\nexport namespace debug {}\n\nexport class fixed_point32 extends SuiBaseProcessor {\n constructor(options: SuiBindOptions) {\n super(\"fixed_point32\", options);\n }\n static DEFAULT_OPTIONS: SuiBindOptions = {\n address: \"0x1\",\n network: SuiNetwork.MAIN_NET,\n };\n\n static bind(options: Partial<SuiBindOptions> = {}): fixed_point32 {\n return new fixed_point32({ ...fixed_point32.DEFAULT_OPTIONS, ...options });\n }\n\n onEventFixedPoint32(\n func: (event: fixed_point32.FixedPoint32Instance, ctx: SuiContext) => void,\n fetchConfig?: Partial<MoveFetchConfig>\n ): fixed_point32 {\n this.onMoveEvent(\n func,\n {\n type: \"fixed_point32::FixedPoint32\",\n },\n fetchConfig\n );\n return this;\n }\n}\n\nexport namespace fixed_point32 {\n export interface FixedPoint32 {\n value: bigint;\n }\n\n export namespace FixedPoint32 {\n export const TYPE_QNAME = \"0x1::fixed_point32::FixedPoint32\";\n\n const TYPE = new TypeDescriptor<FixedPoint32>(FixedPoint32.TYPE_QNAME);\n\n export function type(): TypeDescriptor<FixedPoint32> {\n return TYPE.apply();\n }\n }\n\n export interface FixedPoint32Instance\n extends TypedEventInstance<FixedPoint32> {\n data_decoded: FixedPoint32;\n type_arguments: [];\n }\n}\n\nexport namespace hash {}\n\nexport namespace option {\n export type Option<T> = T | undefined;\n export namespace Option {\n export const TYPE_QNAME = \"0x1::option::Option\";\n\n const TYPE = new TypeDescriptor<Option<any>>(Option.TYPE_QNAME);\n\n export function type<T0>(\n arg0: TypeDescriptor<T0> = ANY_TYPE\n ): TypeDescriptor<Option<T0>> {\n return TYPE.apply(arg0);\n }\n }\n}\n\nexport class string_ extends SuiBaseProcessor {\n constructor(options: SuiBindOptions) {\n super(\"string\", options);\n }\n static DEFAULT_OPTIONS: SuiBindOptions = {\n address: \"0x1\",\n network: SuiNetwork.MAIN_NET,\n };\n\n static bind(options: Partial<SuiBindOptions> = {}): string_ {\n return new string_({ ...string_.DEFAULT_OPTIONS, ...options });\n }\n\n onEventString(\n func: (event: string_.StringInstance, ctx: SuiContext) => void,\n fetchConfig?: Partial<MoveFetchConfig>\n ): string_ {\n this.onMoveEvent(\n func,\n {\n type: \"string::String\",\n },\n fetchConfig\n );\n return this;\n }\n}\n\nexport namespace string_ {\n export interface String {\n bytes: number[];\n }\n\n export namespace String {\n export const TYPE_QNAME = \"0x1::string::String\";\n\n const TYPE = new TypeDescriptor<String>(String.TYPE_QNAME);\n\n export function type(): TypeDescriptor<String> {\n return TYPE.apply();\n }\n }\n\n export interface StringInstance extends TypedEventInstance<String> {\n data_decoded: String;\n type_arguments: [];\n }\n}\n\nexport class type_name extends SuiBaseProcessor {\n constructor(options: SuiBindOptions) {\n super(\"type_name\", options);\n }\n static DEFAULT_OPTIONS: SuiBindOptions = {\n address: \"0x1\",\n network: SuiNetwork.MAIN_NET,\n };\n\n static bind(options: Partial<SuiBindOptions> = {}): type_name {\n return new type_name({ ...type_name.DEFAULT_OPTIONS, ...options });\n }\n\n onEventTypeName(\n func: (event: type_name.TypeNameInstance, ctx: SuiContext) => void,\n fetchConfig?: Partial<MoveFetchConfig>\n ): type_name {\n this.onMoveEvent(\n func,\n {\n type: \"type_name::TypeName\",\n },\n fetchConfig\n );\n return this;\n }\n}\n\nexport namespace type_name {\n export interface TypeName {\n name: ascii.String;\n }\n\n export namespace TypeName {\n export const TYPE_QNAME = \"0x1::type_name::TypeName\";\n\n const TYPE = new TypeDescriptor<TypeName>(TypeName.TYPE_QNAME);\n\n export function type(): TypeDescriptor<TypeName> {\n return TYPE.apply();\n }\n }\n\n export interface TypeNameInstance extends TypedEventInstance<TypeName> {\n data_decoded: TypeName;\n type_arguments: [];\n }\n}\n\nexport namespace vector {}\n\nconst MODULES = JSON.parse(\n '{\"address\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"address\",\"friends\":[],\"structs\":{},\"exposedFunctions\":{\"length\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[],\"return\":[\"U64\"]}}},\"ascii\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"ascii\",\"friends\":[],\"structs\":{\"Char\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"typeParameters\":[],\"fields\":[{\"name\":\"byte\",\"type\":\"U8\"}]},\"String\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"typeParameters\":[],\"fields\":[{\"name\":\"bytes\",\"type\":{\"Vector\":\"U8\"}}]}},\"exposedFunctions\":{\"all_characters_printable\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}}],\"return\":[\"Bool\"]},\"as_bytes\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}}],\"return\":[{\"Reference\":{\"Vector\":\"U8\"}}]},\"byte\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"Char\",\"typeArguments\":[]}}],\"return\":[\"U8\"]},\"char\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[\"U8\"],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"Char\",\"typeArguments\":[]}}]},\"into_bytes\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}],\"return\":[{\"Vector\":\"U8\"}]},\"is_printable_char\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[\"U8\"],\"return\":[\"Bool\"]},\"is_valid_char\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[\"U8\"],\"return\":[\"Bool\"]},\"length\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}}],\"return\":[\"U64\"]},\"pop_char\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"Char\",\"typeArguments\":[]}}]},\"push_char\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}},{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"Char\",\"typeArguments\":[]}}],\"return\":[]},\"string\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}]},\"try_string\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}]}}]}}},\"bcs\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"bcs\",\"friends\":[],\"structs\":{},\"exposedFunctions\":{\"to_bytes\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"TypeParameter\":0}}],\"return\":[{\"Vector\":\"U8\"}]}}},\"bit_vector\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"bit_vector\",\"friends\":[],\"structs\":{\"BitVector\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"typeParameters\":[],\"fields\":[{\"name\":\"length\",\"type\":\"U64\"},{\"name\":\"bit_field\",\"type\":{\"Vector\":\"Bool\"}}]}},\"exposedFunctions\":{\"is_index_set\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"typeArguments\":[]}}},\"U64\"],\"return\":[\"Bool\"]},\"length\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"typeArguments\":[]}}}],\"return\":[\"U64\"]},\"longest_set_sequence_starting_at\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"typeArguments\":[]}}},\"U64\"],\"return\":[\"U64\"]},\"new\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[\"U64\"],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"typeArguments\":[]}}]},\"set\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"typeArguments\":[]}}},\"U64\"],\"return\":[]},\"shift_left\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"typeArguments\":[]}}},\"U64\"],\"return\":[]},\"unset\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"typeArguments\":[]}}},\"U64\"],\"return\":[]}}},\"debug\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"debug\",\"friends\":[],\"structs\":{},\"exposedFunctions\":{\"print\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"TypeParameter\":0}}],\"return\":[]},\"print_stack_trace\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[],\"return\":[]}}},\"fixed_point32\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"fixed_point32\",\"friends\":[],\"structs\":{\"FixedPoint32\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"typeParameters\":[],\"fields\":[{\"name\":\"value\",\"type\":\"U64\"}]}},\"exposedFunctions\":{\"create_from_rational\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[\"U64\",\"U64\"],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"typeArguments\":[]}}]},\"create_from_raw_value\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[\"U64\"],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"typeArguments\":[]}}]},\"divide_u64\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[\"U64\",{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"typeArguments\":[]}}],\"return\":[\"U64\"]},\"get_raw_value\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"typeArguments\":[]}}],\"return\":[\"U64\"]},\"is_zero\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"typeArguments\":[]}}],\"return\":[\"Bool\"]},\"multiply_u64\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[\"U64\",{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"typeArguments\":[]}}],\"return\":[\"U64\"]}}},\"hash\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"hash\",\"friends\":[],\"structs\":{},\"exposedFunctions\":{\"sha2_256\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return\":[{\"Vector\":\"U8\"}]},\"sha3_256\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return\":[{\"Vector\":\"U8\"}]}}},\"option\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"option\",\"friends\":[],\"structs\":{\"Option\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"typeParameters\":[{\"constraints\":{\"abilities\":[]},\"isPhantom\":false}],\"fields\":[{\"name\":\"vec\",\"type\":{\"Vector\":{\"TypeParameter\":0}}}]}},\"exposedFunctions\":{\"borrow\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}}],\"return\":[{\"Reference\":{\"TypeParameter\":0}}]},\"borrow_mut\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}}],\"return\":[{\"MutableReference\":{\"TypeParameter\":0}}]},\"borrow_with_default\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}},{\"Reference\":{\"TypeParameter\":0}}],\"return\":[{\"Reference\":{\"TypeParameter\":0}}]},\"contains\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}},{\"Reference\":{\"TypeParameter\":0}}],\"return\":[\"Bool\"]},\"destroy_none\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}],\"return\":[]},\"destroy_some\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}],\"return\":[{\"TypeParameter\":0}]},\"destroy_with_default\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[\"Drop\"]}],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}},{\"TypeParameter\":0}],\"return\":[{\"TypeParameter\":0}]},\"extract\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}}],\"return\":[{\"TypeParameter\":0}]},\"fill\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}},{\"TypeParameter\":0}],\"return\":[]},\"get_with_default\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[\"Copy\",\"Drop\"]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}},{\"TypeParameter\":0}],\"return\":[{\"TypeParameter\":0}]},\"is_none\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}}],\"return\":[\"Bool\"]},\"is_some\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}}],\"return\":[\"Bool\"]},\"none\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}]},\"some\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"TypeParameter\":0}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}]},\"swap\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}},{\"TypeParameter\":0}],\"return\":[{\"TypeParameter\":0}]},\"swap_or_fill\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}},{\"TypeParameter\":0}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}]},\"to_vec\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"TypeParameter\":0}]}}],\"return\":[{\"Vector\":{\"TypeParameter\":0}}]}}},\"string\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"string\",\"friends\":[],\"structs\":{\"String\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"typeParameters\":[],\"fields\":[{\"name\":\"bytes\",\"type\":{\"Vector\":\"U8\"}}]}},\"exposedFunctions\":{\"append\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}},{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}],\"return\":[]},\"append_utf8\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}},{\"Vector\":\"U8\"}],\"return\":[]},\"bytes\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}}],\"return\":[{\"Reference\":{\"Vector\":\"U8\"}}]},\"from_ascii\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}]},\"index_of\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}},{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}}],\"return\":[\"U64\"]},\"insert\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}},\"U64\",{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}],\"return\":[]},\"is_empty\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}}],\"return\":[\"Bool\"]},\"length\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}}],\"return\":[\"U64\"]},\"sub_string\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}},\"U64\",\"U64\"],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}]},\"to_ascii\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}]},\"try_utf8\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"typeArguments\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}]}}]},\"utf8\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"typeArguments\":[]}}]}}},\"type_name\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"type_name\",\"friends\":[],\"structs\":{\"TypeName\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"typeParameters\":[],\"fields\":[{\"name\":\"name\",\"type\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}}]}},\"exposedFunctions\":{\"borrow_string\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"type_name\",\"name\":\"TypeName\",\"typeArguments\":[]}}}],\"return\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}}]},\"get\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"type_name\",\"name\":\"TypeName\",\"typeArguments\":[]}}]},\"get_address\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"type_name\",\"name\":\"TypeName\",\"typeArguments\":[]}}}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}]},\"get_module\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"type_name\",\"name\":\"TypeName\",\"typeArguments\":[]}}}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}]},\"into_string\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"type_name\",\"name\":\"TypeName\",\"typeArguments\":[]}}],\"return\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"typeArguments\":[]}}]}}},\"vector\":{\"fileFormatVersion\":6,\"address\":\"0x1\",\"name\":\"vector\",\"friends\":[],\"structs\":{},\"exposedFunctions\":{\"append\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},{\"Vector\":{\"TypeParameter\":0}}],\"return\":[]},\"borrow\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Vector\":{\"TypeParameter\":0}}},\"U64\"],\"return\":[{\"Reference\":{\"TypeParameter\":0}}]},\"borrow_mut\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},\"U64\"],\"return\":[{\"MutableReference\":{\"TypeParameter\":0}}]},\"contains\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Vector\":{\"TypeParameter\":0}}},{\"Reference\":{\"TypeParameter\":0}}],\"return\":[\"Bool\"]},\"destroy_empty\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Vector\":{\"TypeParameter\":0}}],\"return\":[]},\"empty\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[],\"return\":[{\"Vector\":{\"TypeParameter\":0}}]},\"index_of\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Vector\":{\"TypeParameter\":0}}},{\"Reference\":{\"TypeParameter\":0}}],\"return\":[\"Bool\",\"U64\"]},\"insert\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},{\"TypeParameter\":0},\"U64\"],\"return\":[]},\"is_empty\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Vector\":{\"TypeParameter\":0}}}],\"return\":[\"Bool\"]},\"length\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Vector\":{\"TypeParameter\":0}}}],\"return\":[\"U64\"]},\"pop_back\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}}],\"return\":[{\"TypeParameter\":0}]},\"push_back\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},{\"TypeParameter\":0}],\"return\":[]},\"remove\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},\"U64\"],\"return\":[{\"TypeParameter\":0}]},\"reverse\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}}],\"return\":[]},\"singleton\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"TypeParameter\":0}],\"return\":[{\"Vector\":{\"TypeParameter\":0}}]},\"swap\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},\"U64\",\"U64\"],\"return\":[]},\"swap_remove\":{\"visibility\":\"Public\",\"isEntry\":false,\"typeParameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},\"U64\"],\"return\":[{\"TypeParameter\":0}]}}}}'\n);\n\nexport function loadAllTypes(coder: MoveCoder) {\n for (const m of Object.values(MODULES)) {\n coder.load(m as any);\n }\n}\n\nloadAllTypes(defaultMoveCoder(SuiNetwork.MAIN_NET));\nloadAllTypes(defaultMoveCoder(SuiNetwork.TEST_NET));\n"]}
@@ -16,6 +16,10 @@ export declare namespace bag {
16
16
  }
17
17
  export declare namespace balance {
18
18
  type Balance<T> = bigint;
19
+ namespace Balance {
20
+ const TYPE_QNAME = "0x2::balance::Balance";
21
+ function type<T0>(arg0?: TypeDescriptor<T0>): TypeDescriptor<Balance<T0>>;
22
+ }
19
23
  interface Supply<T0> {
20
24
  value: bigint;
21
25
  }
@@ -87,6 +91,10 @@ export declare class coin extends SuiBaseProcessor {
87
91
  }
88
92
  export declare namespace coin {
89
93
  type Coin<T> = string;
94
+ namespace Coin {
95
+ const TYPE_QNAME = "0x2::coin::Coin";
96
+ function type<T0>(arg0?: TypeDescriptor<T0>): TypeDescriptor<Coin<T0>>;
97
+ }
90
98
  interface CoinMetadata<T0> {
91
99
  id: object_.UID;
92
100
  decimals: number;
@@ -449,6 +457,10 @@ export declare namespace linked_table {
449
457
  export declare namespace math { }
450
458
  export declare namespace object_ {
451
459
  type ID = string;
460
+ namespace ID {
461
+ const TYPE_QNAME = "0x2::object::ID";
462
+ function type(): TypeDescriptor<ID>;
463
+ }
452
464
  interface UID {
453
465
  id: object_.ID;
454
466
  }