@sentio/sdk 2.6.0-rc.2 → 2.6.0
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.
- package/lib/move/abstract-codegen.js +2 -1
- package/lib/move/abstract-codegen.js.map +1 -1
- package/lib/sui/builtin/0x1.d.ts +2 -2
- package/lib/sui/builtin/0x1.js.map +1 -1
- package/lib/sui/builtin/0x2.d.ts +42 -42
- package/lib/sui/builtin/0x2.js.map +1 -1
- package/lib/sui/sui-processor.js +1 -0
- package/lib/sui/sui-processor.js.map +1 -1
- package/package.json +4 -4
- package/src/move/abstract-codegen.ts +2 -1
- package/src/sui/builtin/0x1.ts +2 -2
- package/src/sui/builtin/0x2.ts +42 -42
- package/src/sui/sui-processor.ts +1 -0
@@ -315,7 +315,8 @@ export class AbstractCodegen {
|
|
315
315
|
if (type.qname.toLowerCase() === VECTOR_STR) {
|
316
316
|
// vector<u8> as hex string
|
317
317
|
const elementTypeQname = type.typeArgs[0].qname;
|
318
|
-
if (elementTypeQname === 'u8'
|
318
|
+
if (elementTypeQname === 'u8') {
|
319
|
+
// only for aptos
|
319
320
|
return 'string';
|
320
321
|
}
|
321
322
|
if (elementTypeQname.startsWith('T') && !elementTypeQname.includes(SPLITTER)) {
|
@@ -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,OAAO,CAAA;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,iBAAiB,EAAE,QAAQ,EA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AC,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;;;;;;;KAOtE,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'\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<ModuleTypes, NetworkType> {\n TEST_NET: NetworkType\n MAIN_NET: NetworkType\n ADDRESS_TYPE: string\n PREFIX: string\n STRUCT_FIELD_NAME: string = 'data'\n GENERATED_CLIENT = false\n\n abstract fetchModules(account: string, network: NetworkType): Promise<ModuleTypes>\n abstract toInternalModules(modules: ModuleTypes): InternalMoveModule[]\n // Get the structs that represent Events\n abstract getEventStructs(module: InternalMoveModule): Map<string, InternalMoveStruct>\n // Get the parameters that actually have arguments in runtime\n // Aptos first signer and Sui's last TxContext are no use\n abstract getMeaningfulFunctionParams(params: TypeDescriptor[]): TypeDescriptor[]\n\n readModulesFile(fullPath: string) {\n return JSON.parse(fs.readFileSync(fullPath, 'utf-8'))\n }\n\n async generate(srcDir: string, outputDir: string) {\n await this.generateForNetwork(srcDir, outputDir, this.MAIN_NET)\n await this.generateForNetwork(path.join(srcDir, 'testnet'), path.join(outputDir, 'testnet'), this.TEST_NET)\n }\n\n async generateForNetwork(srcDir: string, outputDir: string, network: NetworkType) {\n if (!fs.existsSync(srcDir)) {\n return\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 loader.accountImports.set('0x1', new AccountModulesImportInfo('0x1', '0x1'))\n loader.accountImports.set('0x2', new AccountModulesImportInfo('0x2', '0x2'))\n loader.accountImports.set('0x3', new AccountModulesImportInfo('0x3', '0x3'))\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.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.fetchModules(account, network)\n const modules = this.toInternalModules(rawModules)\n\n fs.writeFileSync(path.resolve(srcDir, account + '.json'), JSON.stringify(rawModules, null, '\\t'))\n\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 fs.writeFileSync(\n rootFile,\n `/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n`\n )\n for (const output of outputs) {\n const parsed = path.parse(output.fileName)\n const content = `export * as _${parsed.name.replaceAll('-', '_')} from './${parsed.name}.js'\\n`\n fs.appendFileSync(rootFile, content)\n }\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 = module.exposedFunctions\n .map((f) => this.generateOnEntryFunctions(module, f))\n .filter((s) => s !== '')\n const clientFunctions = module.exposedFunctions\n .map((f) => this.generateClientFunctions(module, f))\n .filter((s) => s !== '')\n const eventStructs = this.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 (this.GENERATED_CLIENT && 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 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 return `\n export class ${structName}${genericString} {\n static TYPE_QNAME = '${module.address}::${module.name}::${struct.name}'\n ${fields.join('\\n')}\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.getMeaningfulFunctionParams(func.params).map((param) => {\n return this.generateTypeForDescriptor(param, module.address)\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.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?: 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?: 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' || elementTypeQname === 'U8') {\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<ModuleType, NetworkType> {\n modules: InternalMoveModule[]\n config: Config<NetworkType>\n abi: ModuleType\n loader: AccountRegister\n moduleGen: AbstractCodegen<ModuleType, NetworkType>\n\n constructor(\n moduleGen: AbstractCodegen<ModuleType, NetworkType>,\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 } 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 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(defaultMoveCoder())\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;AAcjD,MAAM,OAAgB,eAAe;IACnC,QAAQ,CAAa;IACrB,QAAQ,CAAa;IACrB,YAAY,CAAQ;IACpB,MAAM,CAAQ;IACd,iBAAiB,GAAW,MAAM,CAAA;IAClC,gBAAgB,GAAG,KAAK,CAAA;IAUxB,eAAe,CAAC,QAAgB;QAC9B,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CA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AAQ,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'\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<ModuleTypes, NetworkType> {\n TEST_NET: NetworkType\n MAIN_NET: NetworkType\n ADDRESS_TYPE: string\n PREFIX: string\n STRUCT_FIELD_NAME: string = 'data'\n GENERATED_CLIENT = false\n\n abstract fetchModules(account: string, network: NetworkType): Promise<ModuleTypes>\n abstract toInternalModules(modules: ModuleTypes): InternalMoveModule[]\n // Get the structs that represent Events\n abstract getEventStructs(module: InternalMoveModule): Map<string, InternalMoveStruct>\n // Get the parameters that actually have arguments in runtime\n // Aptos first signer and Sui's last TxContext are no use\n abstract getMeaningfulFunctionParams(params: TypeDescriptor[]): TypeDescriptor[]\n\n readModulesFile(fullPath: string) {\n return JSON.parse(fs.readFileSync(fullPath, 'utf-8'))\n }\n\n async generate(srcDir: string, outputDir: string) {\n await this.generateForNetwork(srcDir, outputDir, this.MAIN_NET)\n await this.generateForNetwork(path.join(srcDir, 'testnet'), path.join(outputDir, 'testnet'), this.TEST_NET)\n }\n\n async generateForNetwork(srcDir: string, outputDir: string, network: NetworkType) {\n if (!fs.existsSync(srcDir)) {\n return\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 loader.accountImports.set('0x1', new AccountModulesImportInfo('0x1', '0x1'))\n loader.accountImports.set('0x2', new AccountModulesImportInfo('0x2', '0x2'))\n loader.accountImports.set('0x3', new AccountModulesImportInfo('0x3', '0x3'))\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.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.fetchModules(account, network)\n const modules = this.toInternalModules(rawModules)\n\n fs.writeFileSync(path.resolve(srcDir, account + '.json'), JSON.stringify(rawModules, null, '\\t'))\n\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 fs.writeFileSync(\n rootFile,\n `/* Autogenerated file. Do not edit manually. */\n/* tslint:disable */\n/* eslint-disable */\n`\n )\n for (const output of outputs) {\n const parsed = path.parse(output.fileName)\n const content = `export * as _${parsed.name.replaceAll('-', '_')} from './${parsed.name}.js'\\n`\n fs.appendFileSync(rootFile, content)\n }\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 = module.exposedFunctions\n .map((f) => this.generateOnEntryFunctions(module, f))\n .filter((s) => s !== '')\n const clientFunctions = module.exposedFunctions\n .map((f) => this.generateClientFunctions(module, f))\n .filter((s) => s !== '')\n const eventStructs = this.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 (this.GENERATED_CLIENT && 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 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 return `\n export class ${structName}${genericString} {\n static TYPE_QNAME = '${module.address}::${module.name}::${struct.name}'\n ${fields.join('\\n')}\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.getMeaningfulFunctionParams(func.params).map((param) => {\n return this.generateTypeForDescriptor(param, module.address)\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.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?: 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?: 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<ModuleType, NetworkType> {\n modules: InternalMoveModule[]\n config: Config<NetworkType>\n abi: ModuleType\n loader: AccountRegister\n moduleGen: AbstractCodegen<ModuleType, NetworkType>\n\n constructor(\n moduleGen: AbstractCodegen<ModuleType, NetworkType>,\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 } 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 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(defaultMoveCoder())\n ` // source\n\n return [\n {\n fileName: this.config.fileName + '.ts',\n fileContent: source,\n },\n ]\n }\n}\n"]}
|
package/lib/sui/builtin/0x1.d.ts
CHANGED
@@ -19,7 +19,7 @@ export declare namespace ascii {
|
|
19
19
|
}
|
20
20
|
class String {
|
21
21
|
static TYPE_QNAME: string;
|
22
|
-
bytes:
|
22
|
+
bytes: number[];
|
23
23
|
}
|
24
24
|
interface StringInstance extends TypedEventInstance<String> {
|
25
25
|
fields_decoded: String;
|
@@ -74,7 +74,7 @@ export declare class string_ extends SuiBaseProcessor {
|
|
74
74
|
export declare namespace string_ {
|
75
75
|
class String {
|
76
76
|
static TYPE_QNAME: string;
|
77
|
-
bytes:
|
77
|
+
bytes: number[];
|
78
78
|
}
|
79
79
|
interface StringInstance extends TypedEventInstance<String> {
|
80
80
|
fields_decoded: String;
|
@@ -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;AAKpB,OAAO,EAEL,gBAAgB,EAEhB,gBAAgB,EAEhB,UAAU,GAGX,MAAM,iBAAiB,CAAC;AAMzB,MAAM,OAAO,KAAM,SAAQ,gBAAgB;IACzC,YAAY,OAAuB;QACjC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1B,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,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,eAAe,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED,WAAW,CACT,IAA0D,EAC1D,WAA6B;QAE7B,IAAI,CAAC,WAAW,CACd,IAAI,EACJ;YACE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B,EAAE,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 } 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 class ascii extends SuiBaseProcessor {\n constructor(options: SuiBindOptions) {\n super(\"ascii\", options);\n }\n static DEFAULT_OPTIONS: SuiBindOptions = {\n address: \"0x1\",\n network: SuiNetwork.MAIN_NET,\n };\n\n static bind(options: Partial<SuiBindOptions> = {}): ascii {\n return new ascii({ ...ascii.DEFAULT_OPTIONS, ...options });\n }\n\n onEventChar(\n func: (event: ascii.CharInstance, ctx: SuiContext) => void,\n fetchConfig?: MoveFetchConfig\n ): ascii {\n this.onMoveEvent(\n func,\n {\n type: \"ascii::Char\",\n },\n fetchConfig\n );\n return this;\n }\n\n onEventString(\n func: (event: ascii.StringInstance, ctx: SuiContext) => void,\n fetchConfig?: MoveFetchConfig\n ): ascii {\n this.onMoveEvent(\n func,\n {\n type: \"ascii::String\",\n },\n fetchConfig\n );\n return this;\n }\n}\n\nexport namespace ascii {\n export class Char {\n static TYPE_QNAME = \"0x1::ascii::Char\";\n byte: number;\n }\n\n export interface CharInstance extends TypedEventInstance<Char> {\n fields_decoded: Char;\n type_arguments: [];\n }\n\n export class String {\n static TYPE_QNAME = \"0x1::ascii::String\";\n bytes: string;\n }\n\n export interface StringInstance extends TypedEventInstance<String> {\n fields_decoded: String;\n type_arguments: [];\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?: 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 class BitVector {\n static TYPE_QNAME = \"0x1::bit_vector::BitVector\";\n length: bigint;\n bit_field: Boolean[];\n }\n\n export interface BitVectorInstance extends TypedEventInstance<BitVector> {\n fields_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?: 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 class FixedPoint32 {\n static TYPE_QNAME = \"0x1::fixed_point32::FixedPoint32\";\n value: bigint;\n }\n\n export interface FixedPoint32Instance\n extends TypedEventInstance<FixedPoint32> {\n fields_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?: 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 class String {\n static TYPE_QNAME = \"0x1::string::String\";\n bytes: string;\n }\n\n export interface StringInstance extends TypedEventInstance<String> {\n fields_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?: 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 class TypeName {\n static TYPE_QNAME = \"0x1::type_name::TypeName\";\n name: ascii.String;\n }\n\n export interface TypeNameInstance extends TypedEventInstance<TypeName> {\n fields_decoded: TypeName;\n type_arguments: [];\n }\n}\n\nexport namespace vector {}\n\nconst MODULES = JSON.parse(\n '{\"address\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"address\",\"friends\":[],\"structs\":{},\"exposed_functions\":{\"length\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[],\"return_\":[\"U64\"]}}},\"ascii\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"ascii\",\"friends\":[],\"structs\":{\"Char\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"type_parameters\":[],\"fields\":[{\"name\":\"byte\",\"type_\":\"U8\"}]},\"String\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"type_parameters\":[],\"fields\":[{\"name\":\"bytes\",\"type_\":{\"Vector\":\"U8\"}}]}},\"exposed_functions\":{\"all_characters_printable\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}}],\"return_\":[\"Bool\"]},\"as_bytes\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}}],\"return_\":[{\"Reference\":{\"Vector\":\"U8\"}}]},\"byte\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"Char\",\"type_arguments\":[]}}],\"return_\":[\"U8\"]},\"char\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[\"U8\"],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"Char\",\"type_arguments\":[]}}]},\"into_bytes\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}],\"return_\":[{\"Vector\":\"U8\"}]},\"is_printable_char\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[\"U8\"],\"return_\":[\"Bool\"]},\"is_valid_char\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[\"U8\"],\"return_\":[\"Bool\"]},\"length\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}}],\"return_\":[\"U64\"]},\"pop_char\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"Char\",\"type_arguments\":[]}}]},\"push_char\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}},{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"Char\",\"type_arguments\":[]}}],\"return_\":[]},\"string\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}]},\"try_string\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}]}}]}}},\"bcs\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"bcs\",\"friends\":[],\"structs\":{},\"exposed_functions\":{\"to_bytes\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"TypeParameter\":0}}],\"return_\":[{\"Vector\":\"U8\"}]}}},\"bit_vector\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"bit_vector\",\"friends\":[],\"structs\":{\"BitVector\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"type_parameters\":[],\"fields\":[{\"name\":\"length\",\"type_\":\"U64\"},{\"name\":\"bit_field\",\"type_\":{\"Vector\":\"Bool\"}}]}},\"exposed_functions\":{\"is_index_set\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"type_arguments\":[]}}},\"U64\"],\"return_\":[\"Bool\"]},\"length\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"type_arguments\":[]}}}],\"return_\":[\"U64\"]},\"longest_set_sequence_starting_at\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"type_arguments\":[]}}},\"U64\"],\"return_\":[\"U64\"]},\"new\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[\"U64\"],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"type_arguments\":[]}}]},\"set\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"type_arguments\":[]}}},\"U64\"],\"return_\":[]},\"shift_left\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"type_arguments\":[]}}},\"U64\"],\"return_\":[]},\"unset\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"type_arguments\":[]}}},\"U64\"],\"return_\":[]}}},\"debug\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"debug\",\"friends\":[],\"structs\":{},\"exposed_functions\":{\"print\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"TypeParameter\":0}}],\"return_\":[]},\"print_stack_trace\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[],\"return_\":[]}}},\"fixed_point32\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"fixed_point32\",\"friends\":[],\"structs\":{\"FixedPoint32\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"type_parameters\":[],\"fields\":[{\"name\":\"value\",\"type_\":\"U64\"}]}},\"exposed_functions\":{\"create_from_rational\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[\"U64\",\"U64\"],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"type_arguments\":[]}}]},\"create_from_raw_value\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[\"U64\"],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"type_arguments\":[]}}]},\"divide_u64\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[\"U64\",{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"type_arguments\":[]}}],\"return_\":[\"U64\"]},\"get_raw_value\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"type_arguments\":[]}}],\"return_\":[\"U64\"]},\"is_zero\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"type_arguments\":[]}}],\"return_\":[\"Bool\"]},\"multiply_u64\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[\"U64\",{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"type_arguments\":[]}}],\"return_\":[\"U64\"]}}},\"hash\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"hash\",\"friends\":[],\"structs\":{},\"exposed_functions\":{\"sha2_256\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return_\":[{\"Vector\":\"U8\"}]},\"sha3_256\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return_\":[{\"Vector\":\"U8\"}]}}},\"option\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"option\",\"friends\":[],\"structs\":{\"Option\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"type_parameters\":[{\"constraints\":{\"abilities\":[]},\"is_phantom\":false}],\"fields\":[{\"name\":\"vec\",\"type_\":{\"Vector\":{\"TypeParameter\":0}}}]}},\"exposed_functions\":{\"borrow\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}}],\"return_\":[{\"Reference\":{\"TypeParameter\":0}}]},\"borrow_mut\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}}],\"return_\":[{\"MutableReference\":{\"TypeParameter\":0}}]},\"borrow_with_default\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}},{\"Reference\":{\"TypeParameter\":0}}],\"return_\":[{\"Reference\":{\"TypeParameter\":0}}]},\"contains\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}},{\"Reference\":{\"TypeParameter\":0}}],\"return_\":[\"Bool\"]},\"destroy_none\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}],\"return_\":[]},\"destroy_some\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}],\"return_\":[{\"TypeParameter\":0}]},\"destroy_with_default\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[\"Drop\"]}],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}},{\"TypeParameter\":0}],\"return_\":[{\"TypeParameter\":0}]},\"extract\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}}],\"return_\":[{\"TypeParameter\":0}]},\"fill\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}},{\"TypeParameter\":0}],\"return_\":[]},\"get_with_default\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[\"Copy\",\"Drop\"]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}},{\"TypeParameter\":0}],\"return_\":[{\"TypeParameter\":0}]},\"is_none\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}}],\"return_\":[\"Bool\"]},\"is_some\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}}],\"return_\":[\"Bool\"]},\"none\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}]},\"some\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"TypeParameter\":0}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}]},\"swap\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}},{\"TypeParameter\":0}],\"return_\":[{\"TypeParameter\":0}]},\"swap_or_fill\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}},{\"TypeParameter\":0}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}]},\"to_vec\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}],\"return_\":[{\"Vector\":{\"TypeParameter\":0}}]}}},\"string\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"string\",\"friends\":[],\"structs\":{\"String\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"type_parameters\":[],\"fields\":[{\"name\":\"bytes\",\"type_\":{\"Vector\":\"U8\"}}]}},\"exposed_functions\":{\"append\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}},{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}],\"return_\":[]},\"append_utf8\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}},{\"Vector\":\"U8\"}],\"return_\":[]},\"bytes\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}}],\"return_\":[{\"Reference\":{\"Vector\":\"U8\"}}]},\"from_ascii\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}]},\"index_of\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}},{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}}],\"return_\":[\"U64\"]},\"insert\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}},\"U64\",{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}],\"return_\":[]},\"is_empty\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}}],\"return_\":[\"Bool\"]},\"length\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}}],\"return_\":[\"U64\"]},\"sub_string\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}},\"U64\",\"U64\"],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}]},\"to_ascii\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}]},\"try_utf8\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}]}}]},\"utf8\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}]}}},\"type_name\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"type_name\",\"friends\":[],\"structs\":{\"TypeName\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"type_parameters\":[],\"fields\":[{\"name\":\"name\",\"type_\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}}]}},\"exposed_functions\":{\"borrow_string\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"type_name\",\"name\":\"TypeName\",\"type_arguments\":[]}}}],\"return_\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}}]},\"get\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"type_name\",\"name\":\"TypeName\",\"type_arguments\":[]}}]},\"get_address\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"type_name\",\"name\":\"TypeName\",\"type_arguments\":[]}}}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}]},\"get_module\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"type_name\",\"name\":\"TypeName\",\"type_arguments\":[]}}}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}]},\"into_string\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"type_name\",\"name\":\"TypeName\",\"type_arguments\":[]}}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}]}}},\"vector\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"vector\",\"friends\":[],\"structs\":{},\"exposed_functions\":{\"append\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},{\"Vector\":{\"TypeParameter\":0}}],\"return_\":[]},\"borrow\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Vector\":{\"TypeParameter\":0}}},\"U64\"],\"return_\":[{\"Reference\":{\"TypeParameter\":0}}]},\"borrow_mut\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},\"U64\"],\"return_\":[{\"MutableReference\":{\"TypeParameter\":0}}]},\"contains\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Vector\":{\"TypeParameter\":0}}},{\"Reference\":{\"TypeParameter\":0}}],\"return_\":[\"Bool\"]},\"destroy_empty\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Vector\":{\"TypeParameter\":0}}],\"return_\":[]},\"empty\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[],\"return_\":[{\"Vector\":{\"TypeParameter\":0}}]},\"index_of\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Vector\":{\"TypeParameter\":0}}},{\"Reference\":{\"TypeParameter\":0}}],\"return_\":[\"Bool\",\"U64\"]},\"insert\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},{\"TypeParameter\":0},\"U64\"],\"return_\":[]},\"is_empty\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Vector\":{\"TypeParameter\":0}}}],\"return_\":[\"Bool\"]},\"length\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Vector\":{\"TypeParameter\":0}}}],\"return_\":[\"U64\"]},\"pop_back\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}}],\"return_\":[{\"TypeParameter\":0}]},\"push_back\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},{\"TypeParameter\":0}],\"return_\":[]},\"remove\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},\"U64\"],\"return_\":[{\"TypeParameter\":0}]},\"reverse\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}}],\"return_\":[]},\"singleton\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"TypeParameter\":0}],\"return_\":[{\"Vector\":{\"TypeParameter\":0}}]},\"swap\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},\"U64\",\"U64\"],\"return_\":[]},\"swap_remove\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"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());\n"]}
|
1
|
+
{"version":3,"file":"0x1.js","sourceRoot":"","sources":["../../../src/sui/builtin/0x1.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,oBAAoB;AACpB,oBAAoB;AAKpB,OAAO,EAEL,gBAAgB,EAEhB,gBAAgB,EAEhB,UAAU,GAGX,MAAM,iBAAiB,CAAC;AAMzB,MAAM,OAAO,KAAM,SAAQ,gBAAgB;IACzC,YAAY,OAAuB;QACjC,KAAK,CAAC,OAAO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0BAA0B,CAAC;QAC/C,IAAI,CAAe;;IAFR,kBAAQ,WAGpB,CAAA;AAMH,CAAC,EAVgB,SAAS,KAAT,SAAS,QAUzB;AAID,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CACxB,68nBAA68nB,CAC98nB,CAAC;AAEF,MAAM,UAAU,YAAY,CAAC,KAAgB;IAC3C,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE;QACtC,KAAK,CAAC,IAAI,CAAC,CAAQ,CAAC,CAAC;KACtB;AACH,CAAC;AAED,YAAY,CAAC,gBAAgB,EAAE,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 } 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 class ascii extends SuiBaseProcessor {\n constructor(options: SuiBindOptions) {\n super(\"ascii\", options);\n }\n static DEFAULT_OPTIONS: SuiBindOptions = {\n address: \"0x1\",\n network: SuiNetwork.MAIN_NET,\n };\n\n static bind(options: Partial<SuiBindOptions> = {}): ascii {\n return new ascii({ ...ascii.DEFAULT_OPTIONS, ...options });\n }\n\n onEventChar(\n func: (event: ascii.CharInstance, ctx: SuiContext) => void,\n fetchConfig?: MoveFetchConfig\n ): ascii {\n this.onMoveEvent(\n func,\n {\n type: \"ascii::Char\",\n },\n fetchConfig\n );\n return this;\n }\n\n onEventString(\n func: (event: ascii.StringInstance, ctx: SuiContext) => void,\n fetchConfig?: MoveFetchConfig\n ): ascii {\n this.onMoveEvent(\n func,\n {\n type: \"ascii::String\",\n },\n fetchConfig\n );\n return this;\n }\n}\n\nexport namespace ascii {\n export class Char {\n static TYPE_QNAME = \"0x1::ascii::Char\";\n byte: number;\n }\n\n export interface CharInstance extends TypedEventInstance<Char> {\n fields_decoded: Char;\n type_arguments: [];\n }\n\n export class String {\n static TYPE_QNAME = \"0x1::ascii::String\";\n bytes: number[];\n }\n\n export interface StringInstance extends TypedEventInstance<String> {\n fields_decoded: String;\n type_arguments: [];\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?: 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 class BitVector {\n static TYPE_QNAME = \"0x1::bit_vector::BitVector\";\n length: bigint;\n bit_field: Boolean[];\n }\n\n export interface BitVectorInstance extends TypedEventInstance<BitVector> {\n fields_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?: 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 class FixedPoint32 {\n static TYPE_QNAME = \"0x1::fixed_point32::FixedPoint32\";\n value: bigint;\n }\n\n export interface FixedPoint32Instance\n extends TypedEventInstance<FixedPoint32> {\n fields_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?: 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 class String {\n static TYPE_QNAME = \"0x1::string::String\";\n bytes: number[];\n }\n\n export interface StringInstance extends TypedEventInstance<String> {\n fields_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?: 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 class TypeName {\n static TYPE_QNAME = \"0x1::type_name::TypeName\";\n name: ascii.String;\n }\n\n export interface TypeNameInstance extends TypedEventInstance<TypeName> {\n fields_decoded: TypeName;\n type_arguments: [];\n }\n}\n\nexport namespace vector {}\n\nconst MODULES = JSON.parse(\n '{\"address\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"address\",\"friends\":[],\"structs\":{},\"exposed_functions\":{\"length\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[],\"return_\":[\"U64\"]}}},\"ascii\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"ascii\",\"friends\":[],\"structs\":{\"Char\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"type_parameters\":[],\"fields\":[{\"name\":\"byte\",\"type_\":\"U8\"}]},\"String\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"type_parameters\":[],\"fields\":[{\"name\":\"bytes\",\"type_\":{\"Vector\":\"U8\"}}]}},\"exposed_functions\":{\"all_characters_printable\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}}],\"return_\":[\"Bool\"]},\"as_bytes\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}}],\"return_\":[{\"Reference\":{\"Vector\":\"U8\"}}]},\"byte\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"Char\",\"type_arguments\":[]}}],\"return_\":[\"U8\"]},\"char\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[\"U8\"],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"Char\",\"type_arguments\":[]}}]},\"into_bytes\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}],\"return_\":[{\"Vector\":\"U8\"}]},\"is_printable_char\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[\"U8\"],\"return_\":[\"Bool\"]},\"is_valid_char\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[\"U8\"],\"return_\":[\"Bool\"]},\"length\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}}],\"return_\":[\"U64\"]},\"pop_char\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"Char\",\"type_arguments\":[]}}]},\"push_char\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}},{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"Char\",\"type_arguments\":[]}}],\"return_\":[]},\"string\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}]},\"try_string\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}]}}]}}},\"bcs\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"bcs\",\"friends\":[],\"structs\":{},\"exposed_functions\":{\"to_bytes\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"TypeParameter\":0}}],\"return_\":[{\"Vector\":\"U8\"}]}}},\"bit_vector\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"bit_vector\",\"friends\":[],\"structs\":{\"BitVector\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"type_parameters\":[],\"fields\":[{\"name\":\"length\",\"type_\":\"U64\"},{\"name\":\"bit_field\",\"type_\":{\"Vector\":\"Bool\"}}]}},\"exposed_functions\":{\"is_index_set\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"type_arguments\":[]}}},\"U64\"],\"return_\":[\"Bool\"]},\"length\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"type_arguments\":[]}}}],\"return_\":[\"U64\"]},\"longest_set_sequence_starting_at\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"type_arguments\":[]}}},\"U64\"],\"return_\":[\"U64\"]},\"new\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[\"U64\"],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"type_arguments\":[]}}]},\"set\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"type_arguments\":[]}}},\"U64\"],\"return_\":[]},\"shift_left\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"type_arguments\":[]}}},\"U64\"],\"return_\":[]},\"unset\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"bit_vector\",\"name\":\"BitVector\",\"type_arguments\":[]}}},\"U64\"],\"return_\":[]}}},\"debug\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"debug\",\"friends\":[],\"structs\":{},\"exposed_functions\":{\"print\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"TypeParameter\":0}}],\"return_\":[]},\"print_stack_trace\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[],\"return_\":[]}}},\"fixed_point32\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"fixed_point32\",\"friends\":[],\"structs\":{\"FixedPoint32\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"type_parameters\":[],\"fields\":[{\"name\":\"value\",\"type_\":\"U64\"}]}},\"exposed_functions\":{\"create_from_rational\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[\"U64\",\"U64\"],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"type_arguments\":[]}}]},\"create_from_raw_value\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[\"U64\"],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"type_arguments\":[]}}]},\"divide_u64\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[\"U64\",{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"type_arguments\":[]}}],\"return_\":[\"U64\"]},\"get_raw_value\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"type_arguments\":[]}}],\"return_\":[\"U64\"]},\"is_zero\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"type_arguments\":[]}}],\"return_\":[\"Bool\"]},\"multiply_u64\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[\"U64\",{\"Struct\":{\"address\":\"0x1\",\"module\":\"fixed_point32\",\"name\":\"FixedPoint32\",\"type_arguments\":[]}}],\"return_\":[\"U64\"]}}},\"hash\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"hash\",\"friends\":[],\"structs\":{},\"exposed_functions\":{\"sha2_256\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return_\":[{\"Vector\":\"U8\"}]},\"sha3_256\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return_\":[{\"Vector\":\"U8\"}]}}},\"option\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"option\",\"friends\":[],\"structs\":{\"Option\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"type_parameters\":[{\"constraints\":{\"abilities\":[]},\"is_phantom\":false}],\"fields\":[{\"name\":\"vec\",\"type_\":{\"Vector\":{\"TypeParameter\":0}}}]}},\"exposed_functions\":{\"borrow\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}}],\"return_\":[{\"Reference\":{\"TypeParameter\":0}}]},\"borrow_mut\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}}],\"return_\":[{\"MutableReference\":{\"TypeParameter\":0}}]},\"borrow_with_default\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}},{\"Reference\":{\"TypeParameter\":0}}],\"return_\":[{\"Reference\":{\"TypeParameter\":0}}]},\"contains\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}},{\"Reference\":{\"TypeParameter\":0}}],\"return_\":[\"Bool\"]},\"destroy_none\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}],\"return_\":[]},\"destroy_some\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}],\"return_\":[{\"TypeParameter\":0}]},\"destroy_with_default\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[\"Drop\"]}],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}},{\"TypeParameter\":0}],\"return_\":[{\"TypeParameter\":0}]},\"extract\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}}],\"return_\":[{\"TypeParameter\":0}]},\"fill\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}},{\"TypeParameter\":0}],\"return_\":[]},\"get_with_default\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[\"Copy\",\"Drop\"]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}},{\"TypeParameter\":0}],\"return_\":[{\"TypeParameter\":0}]},\"is_none\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}}],\"return_\":[\"Bool\"]},\"is_some\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}}],\"return_\":[\"Bool\"]},\"none\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}]},\"some\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"TypeParameter\":0}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}]},\"swap\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}},{\"TypeParameter\":0}],\"return_\":[{\"TypeParameter\":0}]},\"swap_or_fill\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}},{\"TypeParameter\":0}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}]},\"to_vec\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"TypeParameter\":0}]}}],\"return_\":[{\"Vector\":{\"TypeParameter\":0}}]}}},\"string\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"string\",\"friends\":[],\"structs\":{\"String\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"type_parameters\":[],\"fields\":[{\"name\":\"bytes\",\"type_\":{\"Vector\":\"U8\"}}]}},\"exposed_functions\":{\"append\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}},{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}],\"return_\":[]},\"append_utf8\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}},{\"Vector\":\"U8\"}],\"return_\":[]},\"bytes\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}}],\"return_\":[{\"Reference\":{\"Vector\":\"U8\"}}]},\"from_ascii\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}]},\"index_of\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}},{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}}],\"return_\":[\"U64\"]},\"insert\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"MutableReference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}},\"U64\",{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}],\"return_\":[]},\"is_empty\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}}],\"return_\":[\"Bool\"]},\"length\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}}],\"return_\":[\"U64\"]},\"sub_string\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}},\"U64\",\"U64\"],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}]},\"to_ascii\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}]},\"try_utf8\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"option\",\"name\":\"Option\",\"type_arguments\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}]}}]},\"utf8\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Vector\":\"U8\"}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"string\",\"name\":\"String\",\"type_arguments\":[]}}]}}},\"type_name\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"type_name\",\"friends\":[],\"structs\":{\"TypeName\":{\"abilities\":{\"abilities\":[\"Copy\",\"Drop\",\"Store\"]},\"type_parameters\":[],\"fields\":[{\"name\":\"name\",\"type_\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}}]}},\"exposed_functions\":{\"borrow_string\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"type_name\",\"name\":\"TypeName\",\"type_arguments\":[]}}}],\"return_\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}}]},\"get\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"type_name\",\"name\":\"TypeName\",\"type_arguments\":[]}}]},\"get_address\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"type_name\",\"name\":\"TypeName\",\"type_arguments\":[]}}}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}]},\"get_module\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Reference\":{\"Struct\":{\"address\":\"0x1\",\"module\":\"type_name\",\"name\":\"TypeName\",\"type_arguments\":[]}}}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}]},\"into_string\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[],\"parameters\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"type_name\",\"name\":\"TypeName\",\"type_arguments\":[]}}],\"return_\":[{\"Struct\":{\"address\":\"0x1\",\"module\":\"ascii\",\"name\":\"String\",\"type_arguments\":[]}}]}}},\"vector\":{\"file_format_version\":6,\"address\":\"0x1\",\"name\":\"vector\",\"friends\":[],\"structs\":{},\"exposed_functions\":{\"append\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},{\"Vector\":{\"TypeParameter\":0}}],\"return_\":[]},\"borrow\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Vector\":{\"TypeParameter\":0}}},\"U64\"],\"return_\":[{\"Reference\":{\"TypeParameter\":0}}]},\"borrow_mut\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},\"U64\"],\"return_\":[{\"MutableReference\":{\"TypeParameter\":0}}]},\"contains\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Vector\":{\"TypeParameter\":0}}},{\"Reference\":{\"TypeParameter\":0}}],\"return_\":[\"Bool\"]},\"destroy_empty\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Vector\":{\"TypeParameter\":0}}],\"return_\":[]},\"empty\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[],\"return_\":[{\"Vector\":{\"TypeParameter\":0}}]},\"index_of\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Vector\":{\"TypeParameter\":0}}},{\"Reference\":{\"TypeParameter\":0}}],\"return_\":[\"Bool\",\"U64\"]},\"insert\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},{\"TypeParameter\":0},\"U64\"],\"return_\":[]},\"is_empty\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Vector\":{\"TypeParameter\":0}}}],\"return_\":[\"Bool\"]},\"length\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"Reference\":{\"Vector\":{\"TypeParameter\":0}}}],\"return_\":[\"U64\"]},\"pop_back\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}}],\"return_\":[{\"TypeParameter\":0}]},\"push_back\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},{\"TypeParameter\":0}],\"return_\":[]},\"remove\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},\"U64\"],\"return_\":[{\"TypeParameter\":0}]},\"reverse\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}}],\"return_\":[]},\"singleton\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"TypeParameter\":0}],\"return_\":[{\"Vector\":{\"TypeParameter\":0}}]},\"swap\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"abilities\":[]}],\"parameters\":[{\"MutableReference\":{\"Vector\":{\"TypeParameter\":0}}},\"U64\",\"U64\"],\"return_\":[]},\"swap_remove\":{\"visibility\":\"Public\",\"is_entry\":false,\"type_parameters\":[{\"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());\n"]}
|
package/lib/sui/builtin/0x2.d.ts
CHANGED
@@ -30,7 +30,7 @@ export declare class bcs extends SuiBaseProcessor {
|
|
30
30
|
export declare namespace bcs {
|
31
31
|
class BCS {
|
32
32
|
static TYPE_QNAME: string;
|
33
|
-
bytes:
|
33
|
+
bytes: number[];
|
34
34
|
}
|
35
35
|
interface BCSInstance extends TypedEventInstance<BCS> {
|
36
36
|
fields_decoded: BCS;
|
@@ -136,8 +136,8 @@ export declare namespace devnet_nft {
|
|
136
136
|
arguments_decoded: [];
|
137
137
|
type_arguments: [];
|
138
138
|
}
|
139
|
-
interface MintPayload extends TypedFunctionPayload<[
|
140
|
-
arguments_decoded: [
|
139
|
+
interface MintPayload extends TypedFunctionPayload<[number[], number[], number[]]> {
|
140
|
+
arguments_decoded: [number[], number[], number[]];
|
141
141
|
type_arguments: [];
|
142
142
|
}
|
143
143
|
interface UpdateDescriptionPayload extends TypedFunctionPayload<[SuiAddress]> {
|
@@ -154,7 +154,7 @@ export declare class digest extends SuiBaseProcessor {
|
|
154
154
|
export declare namespace digest {
|
155
155
|
class Sha3256Digest {
|
156
156
|
static TYPE_QNAME: string;
|
157
|
-
digest:
|
157
|
+
digest: number[];
|
158
158
|
}
|
159
159
|
interface Sha3256DigestInstance extends TypedEventInstance<Sha3256Digest> {
|
160
160
|
fields_decoded: Sha3256Digest;
|
@@ -197,7 +197,7 @@ export declare class elliptic_curve extends SuiBaseProcessor {
|
|
197
197
|
export declare namespace elliptic_curve {
|
198
198
|
class RistrettoPoint {
|
199
199
|
static TYPE_QNAME: string;
|
200
|
-
value:
|
200
|
+
value: number[];
|
201
201
|
}
|
202
202
|
interface RistrettoPointInstance extends TypedEventInstance<RistrettoPoint> {
|
203
203
|
fields_decoded: RistrettoPoint;
|
@@ -205,7 +205,7 @@ export declare namespace elliptic_curve {
|
|
205
205
|
}
|
206
206
|
class Scalar {
|
207
207
|
static TYPE_QNAME: string;
|
208
|
-
value:
|
208
|
+
value: number[];
|
209
209
|
}
|
210
210
|
interface ScalarInstance extends TypedEventInstance<Scalar> {
|
211
211
|
fields_decoded: Scalar;
|
@@ -243,10 +243,10 @@ export declare class groth16 extends SuiBaseProcessor {
|
|
243
243
|
export declare namespace groth16 {
|
244
244
|
class PreparedVerifyingKey {
|
245
245
|
static TYPE_QNAME: string;
|
246
|
-
vk_gamma_abc_g1_bytes:
|
247
|
-
alpha_g1_beta_g2_bytes:
|
248
|
-
gamma_g2_neg_pc_bytes:
|
249
|
-
delta_g2_neg_pc_bytes:
|
246
|
+
vk_gamma_abc_g1_bytes: number[];
|
247
|
+
alpha_g1_beta_g2_bytes: number[];
|
248
|
+
gamma_g2_neg_pc_bytes: number[];
|
249
|
+
delta_g2_neg_pc_bytes: number[];
|
250
250
|
}
|
251
251
|
interface PreparedVerifyingKeyInstance extends TypedEventInstance<PreparedVerifyingKey> {
|
252
252
|
fields_decoded: PreparedVerifyingKey;
|
@@ -254,7 +254,7 @@ export declare namespace groth16 {
|
|
254
254
|
}
|
255
255
|
class ProofPoints {
|
256
256
|
static TYPE_QNAME: string;
|
257
|
-
bytes:
|
257
|
+
bytes: number[];
|
258
258
|
}
|
259
259
|
interface ProofPointsInstance extends TypedEventInstance<ProofPoints> {
|
260
260
|
fields_decoded: ProofPoints;
|
@@ -262,7 +262,7 @@ export declare namespace groth16 {
|
|
262
262
|
}
|
263
263
|
class PublicProofInputs {
|
264
264
|
static TYPE_QNAME: string;
|
265
|
-
bytes:
|
265
|
+
bytes: number[];
|
266
266
|
}
|
267
267
|
interface PublicProofInputsInstance extends TypedEventInstance<PublicProofInputs> {
|
268
268
|
fields_decoded: PublicProofInputs;
|
@@ -742,34 +742,34 @@ export declare namespace sui_system {
|
|
742
742
|
}
|
743
743
|
interface RequestAddValidatorPayload extends TypedFunctionPayload<[
|
744
744
|
SuiAddress,
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
745
|
+
number[],
|
746
|
+
number[],
|
747
|
+
number[],
|
748
|
+
number[],
|
749
|
+
number[],
|
750
|
+
number[],
|
751
|
+
number[],
|
752
|
+
number[],
|
753
|
+
number[],
|
754
|
+
number[],
|
755
|
+
number[],
|
756
756
|
coin.Coin<sui.SUI>,
|
757
757
|
bigint,
|
758
758
|
bigint
|
759
759
|
]> {
|
760
760
|
arguments_decoded: [
|
761
761
|
SuiAddress,
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
762
|
+
number[],
|
763
|
+
number[],
|
764
|
+
number[],
|
765
|
+
number[],
|
766
|
+
number[],
|
767
|
+
number[],
|
768
|
+
number[],
|
769
|
+
number[],
|
770
|
+
number[],
|
771
|
+
number[],
|
772
|
+
number[],
|
773
773
|
coin.Coin<sui.SUI>,
|
774
774
|
bigint,
|
775
775
|
bigint
|
@@ -841,7 +841,7 @@ export declare namespace tx_context {
|
|
841
841
|
class TxContext {
|
842
842
|
static TYPE_QNAME: string;
|
843
843
|
sender: SuiAddress;
|
844
|
-
tx_hash:
|
844
|
+
tx_hash: number[];
|
845
845
|
epoch: bigint;
|
846
846
|
ids_created: bigint;
|
847
847
|
}
|
@@ -900,17 +900,17 @@ export declare namespace validator {
|
|
900
900
|
class ValidatorMetadata {
|
901
901
|
static TYPE_QNAME: string;
|
902
902
|
sui_address: SuiAddress;
|
903
|
-
pubkey_bytes:
|
904
|
-
network_pubkey_bytes:
|
905
|
-
worker_pubkey_bytes:
|
906
|
-
proof_of_possession:
|
903
|
+
pubkey_bytes: number[];
|
904
|
+
network_pubkey_bytes: number[];
|
905
|
+
worker_pubkey_bytes: number[];
|
906
|
+
proof_of_possession: number[];
|
907
907
|
name: string;
|
908
908
|
description: string;
|
909
909
|
image_url: url.Url;
|
910
910
|
project_url: url.Url;
|
911
|
-
net_address:
|
912
|
-
consensus_address:
|
913
|
-
worker_address:
|
911
|
+
net_address: number[];
|
912
|
+
consensus_address: number[];
|
913
|
+
worker_address: number[];
|
914
914
|
next_epoch_stake: bigint;
|
915
915
|
next_epoch_delegation: bigint;
|
916
916
|
next_epoch_gas_price: bigint;
|