@sentio/sdk 2.5.4-rc.1 → 2.5.5-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/aptos/builtin/0x1.d.ts +70 -76
- package/lib/aptos/builtin/0x1.js +4 -4
- package/lib/aptos/builtin/0x1.js.map +1 -1
- package/lib/aptos/builtin/0x3.d.ts +14 -32
- package/lib/aptos/builtin/0x3.js.map +1 -1
- package/lib/aptos/codegen/codegen.js +1 -0
- package/lib/aptos/codegen/codegen.js.map +1 -1
- package/lib/aptos/codegen/types.test.js.map +1 -1
- package/lib/aptos/index.d.ts +2 -1
- package/lib/aptos/index.js +1 -0
- package/lib/aptos/index.js.map +1 -1
- package/lib/aptos/models.d.ts +1 -1
- package/lib/aptos/models.js.map +1 -1
- package/lib/aptos/module-client.d.ts +6 -0
- package/lib/aptos/module-client.js +25 -0
- package/lib/aptos/module-client.js.map +1 -0
- package/lib/aptos/module-client.test.d.ts +1 -0
- package/lib/aptos/module-client.test.js.map +1 -0
- package/lib/aptos/move-coder.d.ts +2 -0
- package/lib/aptos/move-coder.js +7 -15
- package/lib/aptos/move-coder.js.map +1 -1
- package/lib/aptos/network.d.ts +2 -0
- package/lib/aptos/network.js +1 -0
- package/lib/aptos/network.js.map +1 -1
- package/lib/move/abstract-codegen.d.ts +2 -0
- package/lib/move/abstract-codegen.js +44 -7
- package/lib/move/abstract-codegen.js.map +1 -1
- package/lib/move/abstract-move-coder.d.ts +12 -5
- package/lib/move/abstract-move-coder.js +100 -6
- package/lib/move/abstract-move-coder.js.map +1 -1
- package/lib/move/ts-type.js +1 -1
- package/lib/move/ts-type.js.map +1 -1
- package/lib/move/utils.js +1 -1
- package/lib/move/utils.js.map +1 -1
- package/lib/sui/builtin/0x1.js.map +1 -1
- package/lib/sui/builtin/0x2.d.ts +49 -49
- package/lib/sui/builtin/0x2.js.map +1 -1
- package/lib/sui/codegen/codegen.js +2 -4
- package/lib/sui/codegen/codegen.js.map +1 -1
- package/lib/sui/index.d.ts +1 -0
- package/lib/sui/index.js +1 -0
- package/lib/sui/index.js.map +1 -1
- package/lib/sui/models.d.ts +1 -1
- package/lib/sui/models.js.map +1 -1
- package/lib/sui/module-client.d.ts +3 -0
- package/lib/sui/module-client.js +7 -0
- package/lib/sui/module-client.js.map +1 -0
- package/lib/sui/move-coder.d.ts +2 -0
- package/lib/sui/move-coder.js +8 -17
- package/lib/sui/move-coder.js.map +1 -1
- package/lib/sui/utils.d.ts +2 -0
- package/lib/sui/utils.js +6 -0
- package/lib/sui/utils.js.map +1 -1
- package/package.json +4 -4
- package/src/aptos/builtin/0x1.ts +71 -81
- package/src/aptos/builtin/0x3.ts +15 -21
- package/src/aptos/codegen/codegen.ts +1 -0
- package/src/aptos/index.ts +2 -1
- package/src/aptos/models.ts +1 -1
- package/src/aptos/module-client.ts +30 -0
- package/src/aptos/move-coder.ts +11 -17
- package/src/aptos/network.ts +2 -0
- package/src/move/abstract-codegen.ts +55 -9
- package/src/move/abstract-move-coder.ts +116 -10
- package/src/move/ts-type.ts +1 -1
- package/src/move/utils.ts +1 -1
- package/src/sui/builtin/0x1.ts +2 -2
- package/src/sui/builtin/0x2.ts +50 -51
- package/src/sui/codegen/codegen.ts +2 -4
- package/src/sui/index.ts +2 -0
- package/src/sui/models.ts +1 -1
- package/src/sui/module-client.ts +7 -0
- package/src/sui/move-coder.ts +11 -21
- package/src/sui/utils.ts +8 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-move-coder.js","sourceRoot":"","sources":["../../src/move/abstract-move-coder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC9D,OAAO,EAAE,aAAa,EAAkB,MAAM,YAAY,CAAA;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAYjD,MAAM,OAAgB,iBAAiB;IAC7B,aAAa,GAAG,IAAI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TOR_STR } from './utils.js'\nimport { parseMoveType, TypeDescriptor } from './types.js'\nimport { InternalMoveFunction, InternalMoveModule, InternalMoveStruct } from './internal-models.js'\nimport { bytesToBigInt } from '../utils/index.js'\n\ntype StructWithTag<Base> = Base & {\n type: string\n data: any\n}\n\ntype DecodedStructWithTag<B, T> = StructWithTag<B> & {\n data_decoded: T\n type_arguments: string[]\n}\n\nexport abstract class AbstractMoveCoder<StructType> {\n private moduleMapping = new Map<string, InternalMoveModule>()\n private typeMapping = new Map<string, InternalMoveStruct>()\n private funcMapping = new Map<string, InternalMoveFunction>()\n\n contains(account: string, name: string) {\n return this.moduleMapping.has(account + '::' + name)\n }\n\n loadInternal(module: InternalMoveModule) {\n if (this.contains(module.address, module.name)) {\n return\n }\n this.moduleMapping.set(moduleQname(module), module)\n\n for (const struct of module.structs) {\n // TODO move to util\n const key = [module.address, module.name, struct.name].join(SPLITTER)\n this.typeMapping.set(key, struct)\n }\n\n for (const func of module.exposedFunctions) {\n if (!func.isEntry) {\n continue\n }\n const key = [module.address, module.name, func.name].join(SPLITTER)\n this.funcMapping.set(key, func)\n }\n }\n\n protected dataToBigInt(data: any): bigint {\n if (Array.isArray(data)) {\n // Only sui function need this, strange\n const bytes = data as number[]\n return bytesToBigInt(new Uint8Array(bytes.slice().reverse()))\n } else {\n return BigInt(data)\n }\n }\n\n protected getMoveStruct(type: string): InternalMoveStruct {\n const struct = this.typeMapping.get(type)\n if (!struct) {\n throw new Error('Failed to load type' + type + ' type are not imported anywhere')\n }\n return struct\n }\n\n protected getMoveFunction(type: string): InternalMoveFunction {\n const func = this.funcMapping.get(type)\n if (!func) {\n throw new Error('Failed to load function' + type + ' type are not imported anywhere')\n }\n return func\n }\n\n protected decode(data: any, type: TypeDescriptor): any {\n // process simple type\n if (type.reference) {\n return data\n }\n switch (type.qname) {\n case 'signer': // TODO check this, aptos only\n case 'address':\n case 'Address':\n case '0x2::object::ID':\n case '0x2::coin::Coin':\n case '0x1::string::String':\n case 'bool':\n case 'Bool':\n case 'u8':\n case 'U8':\n case 'u16':\n case 'U16':\n case 'u32':\n case 'U32':\n return data\n case 'u64':\n case 'U64':\n case 'u128':\n case 'U128':\n return this.dataToBigInt(data)\n }\n\n // process vector\n if (type.qname === VECTOR_STR) {\n // vector<u8> as hex string\n if (type.typeArgs[0].qname === 'u8' || type.typeArgs[0].qname === 'U8') {\n return data\n }\n\n const res = []\n for (const entry of data) {\n res.push(this.decode(entry, type.typeArgs[0]))\n }\n return res\n }\n\n // Process complex type\n const struct = this.getMoveStruct(type.qname)\n\n const typeCtx = new Map<string, TypeDescriptor>()\n for (const [idx, typeArg] of type.typeArgs.entries()) {\n typeCtx.set('T' + idx, typeArg)\n }\n\n const typedData: any = {}\n\n for (const field of struct.fields) {\n let filedType = field.type\n filedType = filedType.applyTypeArgs(typeCtx)\n const value = this.decode(data[field.name], filedType)\n typedData[field.name] = value\n }\n return typedData\n }\n\n protected filterAndDecodeInternal<T>(\n typeQname: string,\n structs: StructWithTag<StructType>[]\n ): DecodedStructWithTag<StructType, T>[] {\n if (!structs) {\n return []\n }\n const results: DecodedStructWithTag<StructType, T>[] = []\n for (const resource of structs) {\n if (resource.type.split('<')[0] !== typeQname) {\n continue\n }\n const result = this.decodedInternal(resource)\n if (result) {\n results.push(result as DecodedStructWithTag<StructType, T>)\n }\n }\n return results\n }\n\n protected decodedInternal<T>(typeStruct: StructWithTag<StructType>): DecodedStructWithTag<StructType, T> | undefined {\n const typeDescriptor = parseMoveType(typeStruct.type)\n const typeArguments = typeDescriptor.typeArgs.map((t) => t.getSignature())\n\n let dataTyped = undefined\n try {\n dataTyped = this.decode(typeStruct.data, typeDescriptor)\n } catch (e) {\n console.error('Decoding error for ', JSON.stringify(typeStruct), e)\n return undefined\n }\n return {\n ...typeStruct,\n data_decoded: dataTyped,\n type_arguments: typeArguments,\n } as DecodedStructWithTag<StructType, T>\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"abstract-move-coder.js","sourceRoot":"","sources":["../../src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AAa;SACS,CAAA;IAC1C,CAAC;CACF","sourcesContent":["import { moduleQname, SPLITTER, VECTOR_STR } from './utils.js'\nimport { parseMoveType, TypeDescriptor } from './types.js'\nimport { InternalMoveFunction, InternalMoveModule, InternalMoveStruct } from './internal-models.js'\nimport { bytesToBigInt } from '../utils/index.js'\n\ntype StructWithTag<Base> = Base & {\n type: string\n data: any\n}\n\ntype DecodedStructWithTag<B, T> = StructWithTag<B> & {\n data_decoded: T\n type_arguments: string[]\n}\n\nexport abstract class AbstractMoveCoder<StructType> {\n private moduleMapping = new Map<string, InternalMoveModule>()\n private typeMapping = new Map<string, InternalMoveStruct>()\n private funcMapping = new Map<string, InternalMoveFunction>()\n\n contains(account: string, name: string) {\n return this.moduleMapping.has(account + '::' + name)\n }\n\n protected abstract getMeaningfulFunctionParams(params: TypeDescriptor[]): TypeDescriptor[]\n\n protected loadInternal(module: InternalMoveModule) {\n if (this.contains(module.address, module.name)) {\n return\n }\n this.moduleMapping.set(moduleQname(module), module)\n\n for (const struct of module.structs) {\n // TODO move to util\n const key = [module.address, module.name, struct.name].join(SPLITTER)\n this.typeMapping.set(key, struct)\n }\n\n for (const func of module.exposedFunctions) {\n // if (!func.isEntry) {\n // continue\n // }\n const key = [module.address, module.name, func.name].join(SPLITTER)\n this.funcMapping.set(key, func)\n }\n }\n\n protected decodeBigInt(data: any): bigint {\n if (Array.isArray(data)) {\n // Only sui function need this, strange\n const bytes = data as number[]\n return bytesToBigInt(new Uint8Array(bytes.slice().reverse()))\n } else {\n return BigInt(data)\n }\n }\n\n protected encodeBigInt(data: bigint): any {\n return '0x' + data.toString(16)\n }\n\n getMoveStruct(type: string): InternalMoveStruct {\n const struct = this.typeMapping.get(type)\n if (!struct) {\n throw new Error('Failed to load type' + type + ' type are not imported anywhere')\n }\n return struct\n }\n\n getMoveFunction(type: string): InternalMoveFunction {\n const func = this.funcMapping.get(type)\n if (!func) {\n throw new Error('Failed to load function ' + type + ' type are not imported anywhere')\n }\n return func\n }\n\n decode(data: any, type: TypeDescriptor): any {\n // process simple type\n if (type.reference) {\n return data\n }\n switch (type.qname) {\n case 'signer': // TODO check this, aptos only\n case 'address':\n case 'Address':\n case '0x2::object::ID':\n case '0x2::coin::Coin':\n case '0x1::string::String':\n case 'bool':\n case 'Bool':\n case 'u8':\n case 'U8':\n case 'u16':\n case 'U16':\n case 'u32':\n case 'U32':\n return data\n case 'u64':\n case 'U64':\n case 'u128':\n case 'U128':\n return this.decodeBigInt(data)\n }\n\n // process vector\n if (type.qname === VECTOR_STR) {\n // vector<u8> as hex string\n if (type.typeArgs[0].qname === 'u8' || type.typeArgs[0].qname === 'U8') {\n return data\n }\n\n const res = []\n for (const entry of data) {\n res.push(this.decode(entry, type.typeArgs[0]))\n }\n return res\n }\n\n // Process complex type\n const struct = this.getMoveStruct(type.qname)\n\n const typeCtx = new Map<string, TypeDescriptor>()\n for (const [idx, typeArg] of type.typeArgs.entries()) {\n typeCtx.set('T' + idx, typeArg)\n }\n\n const typedData: any = {}\n\n for (const field of struct.fields) {\n let filedType = field.type\n filedType = filedType.applyTypeArgs(typeCtx)\n const value = this.decode(data[field.name], filedType)\n typedData[field.name] = value\n }\n return typedData\n }\n\n encode(data: any, type: TypeDescriptor): any {\n // process simple type\n if (type.reference) {\n return data\n }\n switch (type.qname) {\n case 'signer': // TODO check this, aptos only\n case 'address':\n case 'Address':\n case '0x2::object::ID':\n case '0x2::coin::Coin':\n case '0x1::string::String':\n case 'bool':\n case 'Bool':\n case 'u8':\n case 'U8':\n case 'u16':\n case 'U16':\n case 'u32':\n case 'U32':\n return data\n case 'u64':\n case 'U64':\n case 'u128':\n case 'U128':\n return this.encodeBigInt(data)\n }\n\n // process vector\n if (type.qname === VECTOR_STR) {\n // vector<u8> as hex string\n if (type.typeArgs[0].qname === 'u8' || type.typeArgs[0].qname === 'U8') {\n return data\n }\n\n const res = []\n for (const entry of data) {\n res.push(this.encode(entry, type.typeArgs[0]))\n }\n return res\n }\n\n // Process complex type\n const struct = this.getMoveStruct(type.qname)\n\n const typeCtx = new Map<string, TypeDescriptor>()\n for (const [idx, typeArg] of type.typeArgs.entries()) {\n typeCtx.set('T' + idx, typeArg)\n }\n\n const typedData: any = {}\n\n for (const field of struct.fields) {\n let filedType = field.type\n filedType = filedType.applyTypeArgs(typeCtx)\n const value = this.encode(data[field.name], filedType)\n typedData[field.name] = value\n }\n return typedData\n }\n\n decodeArray(entries: any[], types: TypeDescriptor[]): any[] {\n const entriesDecoded: any[] = []\n for (const [idx, arg] of entries.entries()) {\n // TODO consider apply payload.type_arguments, but this might be hard since we don't code gen for them\n const argType = types[idx]\n try {\n entriesDecoded.push(this.decode(arg, argType))\n } catch (e) {\n console.error(e, 'Decoding error for ', JSON.stringify(arg), 'using type', argType)\n return entries\n }\n }\n return entriesDecoded\n }\n\n encodeArray(entriesDecoded: any[], types: TypeDescriptor[]): any[] {\n const entries: any[] = []\n for (const [idx, arg] of entriesDecoded.entries()) {\n // TODO consider apply payload.type_arguments, but this might be hard since we don't code gen for them\n const argType = types[idx]\n try {\n entries.push(this.encode(arg, argType))\n } catch (e) {\n throw Error('Decoding error for ' + JSON.stringify(arg) + 'using type' + argType + e.toString())\n }\n }\n return entries\n }\n\n encodeCallArgs(args: any[], func: string): any[] {\n const f = this.getMoveFunction(func)\n return this.encodeArray(args, this.getMeaningfulFunctionParams(f.params))\n }\n\n decodeCallResult(res: any[], func: string): any[] {\n const f = this.getMoveFunction(func)\n return this.decodeArray(res, f.return)\n }\n\n protected filterAndDecodeInternal<T>(\n typeQname: string,\n structs: StructWithTag<StructType>[]\n ): DecodedStructWithTag<StructType, T>[] {\n if (!structs) {\n return []\n }\n const results: DecodedStructWithTag<StructType, T>[] = []\n for (const resource of structs) {\n if (resource.type.split('<')[0] !== typeQname) {\n continue\n }\n const result = this.decodedInternal(resource)\n if (result) {\n results.push(result as DecodedStructWithTag<StructType, T>)\n }\n }\n return results\n }\n\n protected decodedInternal<T>(typeStruct: StructWithTag<StructType>): DecodedStructWithTag<StructType, T> | undefined {\n const typeDescriptor = parseMoveType(typeStruct.type)\n const typeArguments = typeDescriptor.typeArgs.map((t) => t.getSignature())\n\n let dataTyped = undefined\n try {\n dataTyped = this.decode(typeStruct.data, typeDescriptor)\n } catch (e) {\n console.error('Decoding error for ', JSON.stringify(typeStruct), e)\n return undefined\n }\n return {\n ...typeStruct,\n data_decoded: dataTyped,\n type_arguments: typeArguments,\n } as DecodedStructWithTag<StructType, T>\n }\n}\n"]}
|
package/lib/move/ts-type.js
CHANGED
|
@@ -47,7 +47,7 @@ export function generateTypeForDescriptor(type, currentAddress, addressType) {
|
|
|
47
47
|
if (simpleName.length === 0) {
|
|
48
48
|
console.error('unexpected error');
|
|
49
49
|
}
|
|
50
|
-
if (simpleName.toLowerCase().
|
|
50
|
+
if (simpleName.toLowerCase() === VECTOR_STR || simpleName.toLowerCase().startsWith(VECTOR_STR + SPLITTER)) {
|
|
51
51
|
console.error('unexpected vector type error');
|
|
52
52
|
}
|
|
53
53
|
if (type.typeArgs.length > 0) {
|
package/lib/move/ts-type.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ts-type.js","sourceRoot":"","sources":["../../src/move/ts-type.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEpE,MAAM,UAAU,yBAAyB,CAAC,IAAoB,EAAE,cAAsB,EAAE,WAAmB;IACzG,IAAI,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAC9B,MAAM,KAAK,CAAC,cAAc,CAAC,CAAA;KAC5B;IACD,IAAI,IAAI,CAAC,SAAS,EAAE;QAClB,OAAO,WAAW,CAAA;KACnB;IAED,QAAQ,IAAI,CAAC,KAAK,EAAE;QAClB,KAAK,QAAQ,CAAC,CAAC,kBAAkB;QACjC,KAAK,SAAS,CAAC;QACf,KAAK,SAAS;YACZ,OAAO,WAAW,CAAA;QACpB,K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AiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;KACvC;IAED,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QACpB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAA;KAChB;IACD,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,cAAc,EAAE;QAC/B,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;KAChC;IACD,OAAO,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC9B,CAAC","sourcesContent":["import { TypeDescriptor } from './types.js'\nimport { normalizeToJSName, SPLITTER, VECTOR_STR } from './utils.js'\n\nexport function generateTypeForDescriptor(type: TypeDescriptor, currentAddress: string, addressType: string): string {\n if (type.qname.startsWith('&')) {\n throw Error('Unexpected &')\n }\n if (type.reference) {\n return addressType\n }\n\n switch (type.qname) {\n case 'signer': // TODO check this\n case 'address':\n case 'Address':\n return addressType\n case '0x2::object::ID':\n case '0x2::coin::Coin':\n return 'string'\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 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 generateTypeForDescriptor(type.typeArgs[0], currentAddress, addressType) + '[]'\n }\n\n const simpleName = 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 +\n '<' +\n type.typeArgs.map((t) => generateTypeForDescriptor(t, currentAddress, addressType)).join(',') +\n '>'\n )\n }\n return simpleName\n}\n\nfunction 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"]}
|
package/lib/move/utils.js
CHANGED
|
@@ -3,7 +3,7 @@ export const VECTOR_STR = 'vector';
|
|
|
3
3
|
export function isFrameworkAccount(account) {
|
|
4
4
|
return account === '0x1' || account === '0x2' || account === '0x3';
|
|
5
5
|
}
|
|
6
|
-
const KEYWORDS = new Set(['package', 'namespace', 'volatile', 'object', 'string', 'number', 'bigint']);
|
|
6
|
+
const KEYWORDS = new Set(['package', 'namespace', 'volatile', 'object', 'string', 'number', 'bigint', 'any']);
|
|
7
7
|
export function normalizeToJSName(name) {
|
|
8
8
|
if (KEYWORDS.has(name)) {
|
|
9
9
|
return name + '_';
|
package/lib/move/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/move/utils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAA;AAE5B,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAA;AAElC,MAAM,UAAU,kBAAkB,CAAC,OAAe;IAChD,OAAO,OAAO,KAAK,KAAK,IAAI,OAAO,KAAK,KAAK,IAAI,OAAO,KAAK,KAAK,CAAA;AACpE,CAAC;AAED,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/move/utils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAA;AAE5B,MAAM,CAAC,MAAM,UAAU,GAAG,QAAQ,CAAA;AAElC,MAAM,UAAU,kBAAkB,CAAC,OAAe;IAChD,OAAO,OAAO,KAAK,KAAK,IAAI,OAAO,KAAK,KAAK,IAAI,OAAO,KAAK,KAAK,CAAA;AACpE,CAAC;AAED,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAA;AAE7G,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QACtB,OAAO,IAAI,GAAG,GAAG,CAAA;KAClB;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IAC9C,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA;AAC7B,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,MAAyC;IACnE,OAAO,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAA;AAC9D,CAAC","sourcesContent":["export const SPLITTER = '::'\n\nexport const VECTOR_STR = 'vector'\n\nexport function isFrameworkAccount(account: string) {\n return account === '0x1' || account === '0x2' || account === '0x3'\n}\n\nconst KEYWORDS = new Set(['package', 'namespace', 'volatile', 'object', 'string', 'number', 'bigint', 'any'])\n\nexport function normalizeToJSName(name: string) {\n if (KEYWORDS.has(name)) {\n return name + '_'\n }\n return name\n}\n\nexport function moduleQnameForType(type: string): [string, string] {\n const parts = type.split(SPLITTER).slice(0, 2)\n return [parts[0], parts[1]]\n}\n\nexport function moduleQname(module: { address: string; name: string }): string {\n return module.address.toLowerCase() + SPLITTER + module.name\n}\n"]}
|
|
@@ -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,IAAI,EAAE,aAAa;SACpB,EACD,WAAW,CACZ,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,aAAa,CACX,IAA4D,EAC5D,WAA6B;QAE7B,IAAI,CAAC,WAAW,CACd,IAAI,EACJ;YACE,IAAI,EAAE,eAAe;SACtB,EACD,WAAW,CACZ,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;;AAGH,WAAiB,KAAK;IACpB,MAAa,IAAI;QACf,MAAM,CAAC,UA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AAQ;QACnB,MAAM,CAAC,UAAU,GAAG,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 TypedEntryFunctionPayload,\n SuiContext,\n} from \"@sentio/sdk/sui\";\nimport { MoveFetchConfig } from \"@sentio/protos\";\nimport { SuiAddress } 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 class option extends SuiBaseProcessor {\n constructor(options: SuiBindOptions) {\n super(\"option\", options);\n }\n static DEFAULT_OPTIONS: SuiBindOptions = {\n address: \"0x1\",\n network: SuiNetwork.MAIN_NET,\n };\n\n static bind(options: Partial<SuiBindOptions> = {}): option {\n return new option({ ...option.DEFAULT_OPTIONS, ...options });\n }\n\n onEventOption(\n func: (event: option.OptionInstance, ctx: SuiContext) => void,\n fetchConfig?: MoveFetchConfig\n ): option {\n this.onMoveEvent(\n func,\n {\n type: \"option::Option\",\n },\n fetchConfig\n );\n return this;\n }\n}\n\nexport namespace option {\n export class Option<T0> {\n static TYPE_QNAME = \"0x1::option::Option\";\n vec: T0[] | string;\n }\n\n export interface OptionInstance extends TypedEventInstance<Option<any>> {\n fields_decoded: Option<any>;\n type_arguments: [string];\n }\n}\n\nexport class string_ extends SuiBaseProcessor {\n constructor(options: SuiBindOptions) {\n super(\"string\", options);\n }\n static DEFAULT_OPTIONS: SuiBindOptions = {\n address: \"0x1\",\n network: SuiNetwork.MAIN_NET,\n };\n\n static bind(options: Partial<SuiBindOptions> = {}): string_ {\n return new string_({ ...string_.DEFAULT_OPTIONS, ...options });\n }\n\n onEventString(\n func: (event: string_.StringInstance, ctx: SuiContext) => void,\n fetchConfig?: 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,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,CAA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AI,CAAC,UAAmC,EAAE;QAC/C,OAAO,IAAI,SAAS,CAAC,EAAE,GAAG,SAAS,CAAC,eAAe,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,eAAe,CACb,IAAkE,EAClE,WAA6B;QAE7B,IAAI,CAAC,WAAW,CACd,IAAI,EACJ;YACE,IAAI,EAAE,qBAAqB;SAC5B,EACD,WAAW,CACZ,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;;AAGH,WAAiB,SAAS;IACxB,MAAa,QAAQ;QACnB,MAAM,CAAC,UAAU,GAAG,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: 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 class option extends SuiBaseProcessor {\n constructor(options: SuiBindOptions) {\n super(\"option\", options);\n }\n static DEFAULT_OPTIONS: SuiBindOptions = {\n address: \"0x1\",\n network: SuiNetwork.MAIN_NET,\n };\n\n static bind(options: Partial<SuiBindOptions> = {}): option {\n return new option({ ...option.DEFAULT_OPTIONS, ...options });\n }\n\n onEventOption(\n func: (event: option.OptionInstance, ctx: SuiContext) => void,\n fetchConfig?: MoveFetchConfig\n ): option {\n this.onMoveEvent(\n func,\n {\n type: \"option::Option\",\n },\n fetchConfig\n );\n return this;\n }\n}\n\nexport namespace option {\n export class Option<T0> {\n static TYPE_QNAME = \"0x1::option::Option\";\n vec: T0[] | string;\n }\n\n export interface OptionInstance extends TypedEventInstance<Option<any>> {\n fields_decoded: Option<any>;\n type_arguments: [string];\n }\n}\n\nexport class string_ extends SuiBaseProcessor {\n constructor(options: SuiBindOptions) {\n super(\"string\", options);\n }\n static DEFAULT_OPTIONS: SuiBindOptions = {\n address: \"0x1\",\n network: SuiNetwork.MAIN_NET,\n };\n\n static bind(options: Partial<SuiBindOptions> = {}): string_ {\n return new string_({ ...string_.DEFAULT_OPTIONS, ...options });\n }\n\n onEventString(\n func: (event: string_.StringInstance, ctx: SuiContext) => void,\n fetchConfig?: 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"]}
|