From 02a93ec85af60c7de6c07d9f59d0e8f0471addac Mon Sep 17 00:00:00 2001 From: Nimish Agrawal Date: Fri, 9 Aug 2024 01:59:58 +0530 Subject: [PATCH 01/14] feat: add basic blueprint --- packages/gateway/src/azero-id.ts | 33 ++++++++++++++++++++++++++++++++ packages/gateway/src/index.ts | 5 ++--- 2 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 packages/gateway/src/azero-id.ts diff --git a/packages/gateway/src/azero-id.ts b/packages/gateway/src/azero-id.ts new file mode 100644 index 0000000..8a2d119 --- /dev/null +++ b/packages/gateway/src/azero-id.ts @@ -0,0 +1,33 @@ +import { Database } from './server'; + +const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'; +const EMPTY_CONTENT_HASH = '0x'; + +export class AzeroId implements Database { + ttl: number; + + constructor(ttl: number) { + this.ttl = ttl; + } + + static init(ttl: number) { + return new AzeroId( + ttl, + ); + } + + addr(name: string, coinType: number) { + console.log("addr", name, coinType); + return { addr: ZERO_ADDRESS, ttl: this.ttl }; + } + + text(name: string, key: string) { + console.log("text", name, key); + return { value: '', ttl: this.ttl }; + } + + contenthash(name: string) { + console.log("contenthash", name); + return { contenthash: EMPTY_CONTENT_HASH, ttl: this.ttl }; + } +} diff --git a/packages/gateway/src/index.ts b/packages/gateway/src/index.ts index 115232c..897bbeb 100644 --- a/packages/gateway/src/index.ts +++ b/packages/gateway/src/index.ts @@ -2,14 +2,13 @@ import { makeApp } from './server'; import { Command } from 'commander'; import { readFileSync } from 'fs'; import { ethers } from 'ethers'; -import { JSONDatabase } from './json'; +import { AzeroId } from './azero-id'; const program = new Command(); program .requiredOption( '-k --private-key ', 'Private key to sign responses with. Prefix with @ to read from a file' ) - .requiredOption('-d --data ', 'JSON file to read data from') .option('-t --ttl ', 'TTL for signatures', '300') .option('-p --port ', 'Port number to serve on', '8080'); program.parse(process.argv); @@ -22,7 +21,7 @@ if (privateKey.startsWith('@')) { } const address = ethers.utils.computeAddress(privateKey); const signer = new ethers.utils.SigningKey(privateKey); -const db = JSONDatabase.fromFilename(options.data, parseInt(options.ttl)); +const db = AzeroId.init(parseInt(options.ttl)); const app = makeApp(signer, '/', db); console.log(`Serving on port ${options.port} with signing address ${address}`); app.listen(parseInt(options.port)); From 32e28ccac0cb223158682fd6bdecfeb7d1f99803 Mon Sep 17 00:00:00 2001 From: Nimish Agrawal Date: Fri, 9 Aug 2024 03:17:50 +0530 Subject: [PATCH 02/14] feat: connect wasm contract with db --- packages/gateway/package.json | 2 + packages/gateway/src/azero-id.ts | 24 +- packages/gateway/src/index.ts | 25 +- packages/gateway/src/metadata.json | 5660 ++++++++++++++++++++++++++++ yarn.lock | 544 ++- 5 files changed, 6246 insertions(+), 9 deletions(-) create mode 100644 packages/gateway/src/metadata.json diff --git a/packages/gateway/package.json b/packages/gateway/package.json index 016ad99..4e3b47f 100644 --- a/packages/gateway/package.json +++ b/packages/gateway/package.json @@ -60,6 +60,8 @@ "@chainlink/ethers-ccip-read-provider": "^0.2.3", "@ensdomains/ens-contracts": "^0.0.8", "@ensdomains/offchain-resolver-contracts": "^0.2.1", + "@polkadot/api": "^12.3.1", + "@polkadot/api-contract": "^12.3.1", "commander": "^8.3.0", "dotenv": "^15.0.0", "ethers": "^5.7.2" diff --git a/packages/gateway/src/azero-id.ts b/packages/gateway/src/azero-id.ts index 8a2d119..5b98ce2 100644 --- a/packages/gateway/src/azero-id.ts +++ b/packages/gateway/src/azero-id.ts @@ -1,18 +1,38 @@ +import abi from './metadata.json'; +import { ApiPromise, WsProvider } from '@polkadot/api'; import { Database } from './server'; +import { ContractPromise } from '@polkadot/api-contract'; +import type { WeightV2 } from '@polkadot/types/interfaces'; const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'; const EMPTY_CONTENT_HASH = '0x'; +export interface GasLimit { + refTime: number, + proofSize: number, +} + export class AzeroId implements Database { ttl: number; + contract: ContractPromise; + maxGasLimit: WeightV2; - constructor(ttl: number) { + constructor(ttl: number, contract: ContractPromise, maxGasLimit: WeightV2) { this.ttl = ttl; + this.contract = contract; + this.maxGasLimit = maxGasLimit; } - static init(ttl: number) { + static async init(ttl: number, providerURL: string, contractAddress: string, gasLimit: GasLimit) { + const wsProvider = new WsProvider(providerURL); + const api = await ApiPromise.create({ provider: wsProvider }); + const contract = new ContractPromise(api, abi, contractAddress); + const maxGasLimit = api.registry.createType('WeightV2', gasLimit) as WeightV2; + return new AzeroId( ttl, + contract, + maxGasLimit, ); } diff --git a/packages/gateway/src/index.ts b/packages/gateway/src/index.ts index 897bbeb..6e27e8a 100644 --- a/packages/gateway/src/index.ts +++ b/packages/gateway/src/index.ts @@ -2,13 +2,15 @@ import { makeApp } from './server'; import { Command } from 'commander'; import { readFileSync } from 'fs'; import { ethers } from 'ethers'; -import { AzeroId } from './azero-id'; +import { AzeroId, GasLimit } from './azero-id'; const program = new Command(); program .requiredOption( '-k --private-key ', 'Private key to sign responses with. Prefix with @ to read from a file' ) + .option('--provider-url ', 'Provider URL of the substrate chain', 'wss://ws.test.azero.dev') + .option('-c --contract ', 'Target contract address', '5FsB91tXSEuMj6akzdPczAtmBaVKToqHmtAwSUzXh49AYzaD') .option('-t --ttl ', 'TTL for signatures', '300') .option('-p --port ', 'Port number to serve on', '8080'); program.parse(process.argv); @@ -21,9 +23,20 @@ if (privateKey.startsWith('@')) { } const address = ethers.utils.computeAddress(privateKey); const signer = new ethers.utils.SigningKey(privateKey); -const db = AzeroId.init(parseInt(options.ttl)); -const app = makeApp(signer, '/', db); -console.log(`Serving on port ${options.port} with signing address ${address}`); -app.listen(parseInt(options.port)); -module.exports = app; +// TODO: make it configurable +const defaultGasLimit: GasLimit = { + refTime: 10_000_000_000, + proofSize: 1_000_000, +}; + +AzeroId.init( + parseInt(options.ttl), + options.providerUrl, + options.contract, + defaultGasLimit, +).then(db => { + const app = makeApp(signer, '/', db); + console.log(`Serving on port ${options.port} with signing address ${address}`); + app.listen(parseInt(options.port)); +}); diff --git a/packages/gateway/src/metadata.json b/packages/gateway/src/metadata.json new file mode 100644 index 0000000..184400b --- /dev/null +++ b/packages/gateway/src/metadata.json @@ -0,0 +1,5660 @@ +{ + "source": { + "hash": "0x8bc23023f7db0913fb1e803a6e161a551337011ca3cd71c1e4bc8fa495adc91d", + "language": "ink! 4.2.1", + "compiler": "rustc 1.79.0", + "build_info": { + "build_mode": "Release", + "cargo_contract_version": "3.2.0", + "rust_toolchain": "stable-aarch64-apple-darwin", + "wasm_opt_settings": { + "keep_debug_symbols": false, + "optimization_passes": "Z" + } + } + }, + "contract": { + "name": "azns_registry", + "version": "1.1.0", + "authors": [ + "AZERO.ID " + ] + }, + "spec": { + "constructors": [ + { + "args": [ + { + "label": "admin", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + }, + { + "label": "name_checker_addr", + "type": { + "displayName": [ + "Option" + ], + "type": 9 + } + }, + { + "label": "fee_calculator_addr", + "type": { + "displayName": [ + "Option" + ], + "type": 9 + } + }, + { + "label": "tld", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + }, + { + "label": "base_uri", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + } + ], + "default": false, + "docs": [ + "Creates a new AZNS contract." + ], + "label": "new", + "payable": false, + "returnType": { + "displayName": [ + "ink_primitives", + "ConstructorResult" + ], + "type": 10 + }, + "selector": "0x9bae9d5e" + } + ], + "docs": [], + "environment": { + "accountId": { + "displayName": [ + "AccountId" + ], + "type": 0 + }, + "balance": { + "displayName": [ + "Balance" + ], + "type": 4 + }, + "blockNumber": { + "displayName": [ + "BlockNumber" + ], + "type": 5 + }, + "chainExtension": { + "displayName": [ + "ChainExtension" + ], + "type": 78 + }, + "hash": { + "displayName": [ + "Hash" + ], + "type": 77 + }, + "maxEventTopics": 4, + "timestamp": { + "displayName": [ + "Timestamp" + ], + "type": 6 + } + }, + "events": [ + { + "args": [ + { + "docs": [], + "indexed": true, + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + }, + { + "docs": [], + "indexed": true, + "label": "from", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + }, + { + "docs": [], + "indexed": false, + "label": "registration_timestamp", + "type": { + "displayName": [ + "u64" + ], + "type": 6 + } + }, + { + "docs": [], + "indexed": false, + "label": "expiration_timestamp", + "type": { + "displayName": [ + "u64" + ], + "type": 6 + } + } + ], + "docs": [ + "Emitted whenever a new name is registered." + ], + "label": "Register" + }, + { + "args": [ + { + "docs": [], + "indexed": true, + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + }, + { + "docs": [], + "indexed": true, + "label": "from", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + }, + { + "docs": [], + "indexed": true, + "label": "referrer", + "type": { + "displayName": [ + "Option" + ], + "type": 13 + } + }, + { + "docs": [], + "indexed": false, + "label": "referrer_addr", + "type": { + "displayName": [ + "Option" + ], + "type": 9 + } + }, + { + "docs": [], + "indexed": false, + "label": "received_fee", + "type": { + "displayName": [ + "Balance" + ], + "type": 4 + } + }, + { + "docs": [], + "indexed": false, + "label": "forwarded_referrer_fee", + "type": { + "displayName": [ + "Balance" + ], + "type": 4 + } + } + ], + "docs": [], + "label": "FeeReceived" + }, + { + "args": [ + { + "docs": [], + "indexed": true, + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + }, + { + "docs": [], + "indexed": true, + "label": "from", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "docs": [ + "Emitted whenever a name is released" + ], + "label": "Release" + }, + { + "args": [ + { + "docs": [], + "indexed": true, + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + }, + { + "docs": [], + "indexed": false, + "label": "from", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + }, + { + "docs": [], + "indexed": true, + "label": "old_address", + "type": { + "displayName": [ + "Option" + ], + "type": 9 + } + }, + { + "docs": [], + "indexed": true, + "label": "new_address", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "docs": [ + "Emitted whenever an address changes." + ], + "label": "SetAddress" + }, + { + "args": [ + { + "docs": [], + "indexed": true, + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + }, + { + "docs": [], + "indexed": false, + "label": "from", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + }, + { + "docs": [], + "indexed": true, + "label": "old_controller", + "type": { + "displayName": [ + "Option" + ], + "type": 9 + } + }, + { + "docs": [], + "indexed": true, + "label": "new_controller", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "docs": [ + "Emitted whenever controller changes." + ], + "label": "SetController" + }, + { + "args": [ + { + "docs": [], + "indexed": true, + "label": "account", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + }, + { + "docs": [], + "indexed": true, + "label": "primary_name", + "type": { + "displayName": [ + "Option" + ], + "type": 13 + } + } + ], + "docs": [], + "label": "SetPrimaryName" + }, + { + "args": [ + { + "docs": [], + "indexed": true, + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + }, + { + "docs": [], + "indexed": false, + "label": "from", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "docs": [], + "label": "RecordsUpdated" + }, + { + "args": [ + { + "docs": [], + "indexed": true, + "label": "from", + "type": { + "displayName": [ + "Option" + ], + "type": 9 + } + }, + { + "docs": [], + "indexed": true, + "label": "to", + "type": { + "displayName": [ + "Option" + ], + "type": 9 + } + }, + { + "docs": [], + "indexed": true, + "label": "id", + "type": { + "displayName": [ + "Id" + ], + "type": 66 + } + } + ], + "docs": [ + "Event emitted when a token transfer occurs." + ], + "label": "Transfer" + }, + { + "args": [ + { + "docs": [], + "indexed": true, + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + }, + { + "docs": [], + "indexed": true, + "label": "caller", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + }, + { + "docs": [], + "indexed": true, + "label": "unlocker", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "docs": [ + "Event emitted when a token is locked." + ], + "label": "Lock" + }, + { + "args": [ + { + "docs": [], + "indexed": true, + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + } + ], + "docs": [ + "Event emitted when a token is unlocked." + ], + "label": "Unlock" + }, + { + "args": [ + { + "docs": [], + "indexed": true, + "label": "owner", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + }, + { + "docs": [], + "indexed": true, + "label": "operator", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + }, + { + "docs": [], + "indexed": true, + "label": "id", + "type": { + "displayName": [ + "Option" + ], + "type": 69 + } + }, + { + "docs": [], + "indexed": false, + "label": "approved", + "type": { + "displayName": [ + "bool" + ], + "type": 18 + } + } + ], + "docs": [ + "Event emitted when a token approve occurs." + ], + "label": "Approval" + }, + { + "args": [], + "docs": [ + "Emitted when switching from whitelist-phase to public-phase" + ], + "label": "PublicPhaseActivated" + }, + { + "args": [ + { + "docs": [], + "indexed": true, + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + }, + { + "docs": [], + "indexed": true, + "label": "account_id", + "type": { + "displayName": [ + "Option" + ], + "type": 9 + } + }, + { + "docs": [], + "indexed": false, + "label": "action", + "type": { + "displayName": [ + "bool" + ], + "type": 18 + } + } + ], + "docs": [ + "Emitted when a name is reserved or removed from the reservation list" + ], + "label": "Reserve" + }, + { + "args": [ + { + "docs": [], + "indexed": true, + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + }, + { + "docs": [], + "indexed": false, + "label": "old_expiry", + "type": { + "displayName": [ + "u64" + ], + "type": 6 + } + }, + { + "docs": [], + "indexed": false, + "label": "new_expiry", + "type": { + "displayName": [ + "u64" + ], + "type": 6 + } + } + ], + "docs": [ + "Emitted whenever a name is renewed." + ], + "label": "Renew" + } + ], + "lang_error": { + "displayName": [ + "ink", + "LangError" + ], + "type": 12 + }, + "messages": [ + { + "args": [ + { + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + }, + { + "label": "recipient", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + }, + { + "label": "years_to_register", + "type": { + "displayName": [ + "u8" + ], + "type": 2 + } + }, + { + "label": "referrer", + "type": { + "displayName": [ + "Option" + ], + "type": 13 + } + }, + { + "label": "bonus_name", + "type": { + "displayName": [ + "Option" + ], + "type": 13 + } + } + ], + "default": false, + "docs": [ + " Register specific name on behalf of some other address.", + " Pay the fee, but forward the ownership of the name to the provided recipient", + "", + " NOTE: During the whitelist phase, use `register()` method instead." + ], + "label": "register_on_behalf_of", + "mutates": true, + "payable": true, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 14 + }, + "selector": "0x7aa26a96" + }, + { + "args": [ + { + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + }, + { + "label": "years_to_register", + "type": { + "displayName": [ + "u8" + ], + "type": 2 + } + }, + { + "label": "referrer", + "type": { + "displayName": [ + "Option" + ], + "type": 13 + } + }, + { + "label": "bonus_name", + "type": { + "displayName": [ + "Option" + ], + "type": 13 + } + }, + { + "label": "set_as_primary_name", + "type": { + "displayName": [ + "bool" + ], + "type": 18 + } + } + ], + "default": false, + "docs": [ + " Register specific name with caller as owner." + ], + "label": "register_v2", + "mutates": true, + "payable": true, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 14 + }, + "selector": "0xb16554be" + }, + { + "args": [ + { + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + }, + { + "label": "years_to_register", + "type": { + "displayName": [ + "u8" + ], + "type": 2 + } + }, + { + "label": "referrer", + "type": { + "displayName": [ + "Option" + ], + "type": 13 + } + }, + { + "label": "_merkle_proof", + "type": { + "displayName": [ + "Option" + ], + "type": 19 + } + }, + { + "label": "set_as_primary_name", + "type": { + "displayName": [ + "bool" + ], + "type": 18 + } + } + ], + "default": false, + "docs": [ + " register_v1" + ], + "label": "register", + "mutates": true, + "payable": true, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 14 + }, + "selector": "0x229b553f" + }, + { + "args": [ + { + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + }, + { + "label": "years_to_renew", + "type": { + "displayName": [ + "u8" + ], + "type": 2 + } + }, + { + "label": "bonus_name", + "type": { + "displayName": [ + "Option" + ], + "type": 13 + } + } + ], + "default": false, + "docs": [], + "label": "renew", + "mutates": true, + "payable": true, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 21 + }, + "selector": "0xb5604092" + }, + { + "args": [ + { + "label": "data", + "type": { + "displayName": [ + "Vec" + ], + "type": 23 + } + } + ], + "default": false, + "docs": [], + "label": "batch_renew", + "mutates": true, + "payable": true, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 21 + }, + "selector": "0xb3d33208" + }, + { + "args": [ + { + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + }, + { + "label": "set_as_primary_name", + "type": { + "displayName": [ + "bool" + ], + "type": 18 + } + } + ], + "default": false, + "docs": [ + " Allows users to claim their reserved name at zero cost" + ], + "label": "claim_reserved_name", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 14 + }, + "selector": "0x2251f2bc" + }, + { + "args": [ + { + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + } + ], + "default": false, + "docs": [ + " Release name from registration." + ], + "label": "release", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 14 + }, + "selector": "0x3f2be152" + }, + { + "args": [ + { + "label": "to", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + }, + { + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + }, + { + "label": "keep_records", + "type": { + "displayName": [ + "bool" + ], + "type": 18 + } + }, + { + "label": "keep_controller", + "type": { + "displayName": [ + "bool" + ], + "type": 18 + } + }, + { + "label": "keep_resolving", + "type": { + "displayName": [ + "bool" + ], + "type": 18 + } + }, + { + "label": "data", + "type": { + "displayName": [ + "Vec" + ], + "type": 25 + } + } + ], + "default": false, + "docs": [ + " Transfer owner to another address." + ], + "label": "transfer", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 26 + }, + "selector": "0x84a15da1" + }, + { + "args": [ + { + "label": "names", + "type": { + "displayName": [ + "Vec" + ], + "type": 29 + } + } + ], + "default": false, + "docs": [ + " Removes the associated state of expired-names from storage" + ], + "label": "clear_expired_names", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 21 + }, + "selector": "0xd00a53e5" + }, + { + "args": [ + { + "label": "primary_name", + "type": { + "displayName": [ + "Option" + ], + "type": 13 + } + } + ], + "default": false, + "docs": [ + " Set primary name of an address (reverse record)", + " @note if name is set to None then the primary-name for the caller will be removed (if exists)" + ], + "label": "set_primary_name", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 14 + }, + "selector": "0xad11843c" + }, + { + "args": [ + { + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + }, + { + "label": "new_address", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "default": false, + "docs": [ + " Set resolved address for specific name." + ], + "label": "set_address", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 14 + }, + "selector": "0xb8a4d3d9" + }, + { + "args": [ + { + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + }, + { + "label": "new_controller", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "default": false, + "docs": [], + "label": "set_controller", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 14 + }, + "selector": "0xc5e161ea" + }, + { + "args": [ + { + "label": "names", + "type": { + "displayName": [ + "Vec" + ], + "type": 29 + } + } + ], + "default": false, + "docs": [], + "label": "reset_resolved_address", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 14 + }, + "selector": "0x955299c9" + }, + { + "args": [ + { + "label": "names", + "type": { + "displayName": [ + "Vec" + ], + "type": 29 + } + } + ], + "default": false, + "docs": [], + "label": "reset_controller", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 14 + }, + "selector": "0x1dffd33a" + }, + { + "args": [ + { + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + }, + { + "label": "records", + "type": { + "displayName": [ + "Vec" + ], + "type": 30 + } + }, + { + "label": "remove_rest", + "type": { + "displayName": [ + "bool" + ], + "type": 18 + } + } + ], + "default": false, + "docs": [], + "label": "update_records", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 14 + }, + "selector": "0xde84a1ba" + }, + { + "args": [ + { + "label": "names", + "type": { + "displayName": [ + "Vec" + ], + "type": 29 + } + } + ], + "default": false, + "docs": [ + " Returns the current status of the name" + ], + "label": "get_name_status", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 32 + }, + "selector": "0x964d7612" + }, + { + "args": [ + { + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + } + ], + "default": false, + "docs": [ + " Get the addresses related to specific name" + ], + "label": "get_address_dict", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 36 + }, + "selector": "0xf069dff3" + }, + { + "args": [ + { + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + } + ], + "default": false, + "docs": [ + " Get owner of specific name." + ], + "label": "get_owner", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 38 + }, + "selector": "0x07fcd0b1" + }, + { + "args": [ + { + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + } + ], + "default": false, + "docs": [ + " Get controller of specific name." + ], + "label": "get_controller", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 38 + }, + "selector": "0x0abf0e97" + }, + { + "args": [ + { + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + } + ], + "default": false, + "docs": [ + " Get address for specific name." + ], + "label": "get_address", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 38 + }, + "selector": "0xd259f7ba" + }, + { + "args": [ + { + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + } + ], + "default": false, + "docs": [], + "label": "get_registration_period", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 40 + }, + "selector": "0x61437185" + }, + { + "args": [ + { + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + } + ], + "default": false, + "docs": [ + " Gets all records" + ], + "label": "get_all_records", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 43 + }, + "selector": "0x528be9f1" + }, + { + "args": [ + { + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + }, + { + "label": "key", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + } + ], + "default": false, + "docs": [ + " Gets an arbitrary record by key" + ], + "label": "get_record", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 44 + }, + "selector": "0x7e6cb4ce" + }, + { + "args": [ + { + "label": "owner", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "default": false, + "docs": [ + " Returns all names the address owns" + ], + "label": "get_owned_names_of_address", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 46 + }, + "selector": "0xe413b13a" + }, + { + "args": [ + { + "label": "controller", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "default": false, + "docs": [], + "label": "get_controlled_names_of_address", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 46 + }, + "selector": "0x9f25301e" + }, + { + "args": [ + { + "label": "address", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "default": false, + "docs": [], + "label": "get_resolving_names_of_address", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 46 + }, + "selector": "0xadd2f457" + }, + { + "args": [ + { + "label": "address", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "default": false, + "docs": [], + "label": "get_primary_name", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 44 + }, + "selector": "0x404f1d73" + }, + { + "args": [ + { + "label": "address", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "default": false, + "docs": [], + "label": "get_primary_domain", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 47 + }, + "selector": "0xbf5b5677" + }, + { + "args": [ + { + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + } + ], + "default": false, + "docs": [], + "label": "get_lock_info", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 48 + }, + "selector": "0x5974dd04" + }, + { + "args": [ + { + "label": "address", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "default": false, + "docs": [], + "label": "get_names_of_address", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 46 + }, + "selector": "0xf82caf60" + }, + { + "args": [ + { + "label": "user", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "default": false, + "docs": [], + "label": "get_owner_to_name_count", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 49 + }, + "selector": "0xb779edfe" + }, + { + "args": [ + { + "label": "user", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "default": false, + "docs": [], + "label": "get_controller_to_name_count", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 49 + }, + "selector": "0xf5e0d676" + }, + { + "args": [ + { + "label": "user", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "default": false, + "docs": [], + "label": "get_resolving_to_name_count", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 49 + }, + "selector": "0x28610555" + }, + { + "args": [], + "default": false, + "docs": [], + "label": "get_records_size_limit", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 50 + }, + "selector": "0x8405efa0" + }, + { + "args": [], + "default": false, + "docs": [], + "label": "get_tld", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 52 + }, + "selector": "0xd61daed4" + }, + { + "args": [], + "default": false, + "docs": [], + "label": "get_base_uri", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 52 + }, + "selector": "0x6e06617c" + }, + { + "args": [ + { + "label": "beneficiary", + "type": { + "displayName": [ + "Option" + ], + "type": 9 + } + }, + { + "label": "value", + "type": { + "displayName": [ + "Option" + ], + "type": 53 + } + } + ], + "default": false, + "docs": [ + " (ADMIN-OPERATION)", + " Transfers `value` amount of tokens to the caller." + ], + "label": "withdraw", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 14 + }, + "selector": "0x410fcc9d" + }, + { + "args": [ + { + "label": "set", + "type": { + "displayName": [ + "Vec" + ], + "type": 54 + } + }, + { + "label": "skip_name_checker", + "type": { + "displayName": [ + "bool" + ], + "type": 18 + } + } + ], + "default": false, + "docs": [ + " (ADMIN-OPERATION)", + " Reserve name name for specific addresses" + ], + "label": "add_reserved_names", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 14 + }, + "selector": "0x6e0d3fa8" + }, + { + "args": [ + { + "label": "set", + "type": { + "displayName": [ + "Vec" + ], + "type": 29 + } + } + ], + "default": false, + "docs": [ + " (ADMIN-OPERATION)", + " Remove given names from the list of reserved names" + ], + "label": "remove_reserved_name", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 14 + }, + "selector": "0x9ccff6c5" + }, + { + "args": [ + { + "label": "limit", + "type": { + "displayName": [ + "Option" + ], + "type": 51 + } + } + ], + "default": false, + "docs": [ + " (ADMIN-OPERATION)", + " Update the limit of records allowed to store per name" + ], + "label": "set_records_size_limit", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 14 + }, + "selector": "0x7c9baef6" + }, + { + "args": [ + { + "label": "name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + }, + { + "label": "recipient", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + }, + { + "label": "years_to_register", + "type": { + "displayName": [ + "u8" + ], + "type": 2 + } + }, + { + "label": "referrer", + "type": { + "displayName": [ + "Option" + ], + "type": 13 + } + } + ], + "default": false, + "docs": [], + "label": "get_name_price", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 56 + }, + "selector": "0xb565be46" + }, + { + "args": [ + { + "label": "input", + "type": { + "displayName": [ + "Vec" + ], + "type": 59 + } + } + ], + "default": false, + "docs": [], + "label": "batch_get_name_price", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 61 + }, + "selector": "0xfc5a5fc3" + }, + { + "args": [ + { + "label": "recipient", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + }, + { + "label": "referrer_name", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + } + ], + "default": false, + "docs": [], + "label": "validate_referrer", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 63 + }, + "selector": "0x30fc989d" + }, + { + "args": [], + "default": false, + "docs": [], + "label": "get_admin", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 64 + }, + "selector": "0x57b8a8a7" + }, + { + "args": [], + "default": false, + "docs": [], + "label": "get_pending_admin", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 48 + }, + "selector": "0xbcd31d76" + }, + { + "args": [ + { + "label": "account", + "type": { + "displayName": [ + "Option" + ], + "type": 9 + } + } + ], + "default": false, + "docs": [], + "label": "transfer_ownership", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 14 + }, + "selector": "0x107e33ea" + }, + { + "args": [], + "default": false, + "docs": [], + "label": "accept_ownership", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 14 + }, + "selector": "0xb55be9f0" + }, + { + "args": [ + { + "label": "code_hash", + "type": { + "displayName": [], + "type": 1 + } + } + ], + "default": false, + "docs": [], + "label": "upgrade_contract", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 10 + }, + "selector": "0x1345543d" + }, + { + "args": [], + "default": false, + "docs": [], + "label": "PSP34::collection_id", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 65 + }, + "selector": "0xffa27a5f" + }, + { + "args": [ + { + "label": "owner", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + } + ], + "default": false, + "docs": [], + "label": "PSP34::balance_of", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 68 + }, + "selector": "0xcde7e55f" + }, + { + "args": [ + { + "label": "id", + "type": { + "displayName": [ + "Id" + ], + "type": 66 + } + } + ], + "default": false, + "docs": [], + "label": "PSP34::owner_of", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 48 + }, + "selector": "0x1168624d" + }, + { + "args": [ + { + "label": "owner", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + }, + { + "label": "operator", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + }, + { + "label": "id", + "type": { + "displayName": [ + "Option" + ], + "type": 69 + } + } + ], + "default": false, + "docs": [], + "label": "PSP34::allowance", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 63 + }, + "selector": "0x4790f55a" + }, + { + "args": [ + { + "label": "operator", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + }, + { + "label": "id", + "type": { + "displayName": [ + "Option" + ], + "type": 69 + } + }, + { + "label": "approved", + "type": { + "displayName": [ + "bool" + ], + "type": 18 + } + } + ], + "default": false, + "docs": [], + "label": "PSP34::approve", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 26 + }, + "selector": "0x1932a8b0" + }, + { + "args": [ + { + "label": "to", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + }, + { + "label": "id", + "type": { + "displayName": [ + "Id" + ], + "type": 66 + } + }, + { + "label": "data", + "type": { + "displayName": [ + "Vec" + ], + "type": 25 + } + } + ], + "default": false, + "docs": [], + "label": "PSP34::transfer", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 26 + }, + "selector": "0x3128d61b" + }, + { + "args": [], + "default": false, + "docs": [], + "label": "PSP34::total_supply", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 49 + }, + "selector": "0x628413fe" + }, + { + "args": [ + { + "label": "owner", + "type": { + "displayName": [ + "AccountId" + ], + "type": 0 + } + }, + { + "label": "index", + "type": { + "displayName": [ + "u128" + ], + "type": 4 + } + } + ], + "default": false, + "docs": [], + "label": "PSP34Enumerable::owners_token_by_index", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 70 + }, + "selector": "0x3bcfb511" + }, + { + "args": [ + { + "label": "_index", + "type": { + "displayName": [ + "u128" + ], + "type": 4 + } + } + ], + "default": false, + "docs": [], + "label": "PSP34Enumerable::token_by_index", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 70 + }, + "selector": "0xcd0340d0" + }, + { + "args": [ + { + "label": "id", + "type": { + "displayName": [ + "Id" + ], + "type": 66 + } + }, + { + "label": "key", + "type": { + "displayName": [ + "Vec" + ], + "type": 25 + } + } + ], + "default": false, + "docs": [], + "label": "PSP34Metadata::get_attribute", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 72 + }, + "selector": "0xf19d48d1" + }, + { + "args": [], + "default": false, + "docs": [], + "label": "Psp34Traits::get_owner", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 64 + }, + "selector": "0x8e1d8d71" + }, + { + "args": [ + { + "label": "token_id", + "type": { + "displayName": [ + "Id" + ], + "type": 66 + } + } + ], + "default": false, + "docs": [], + "label": "Psp34Traits::token_uri", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 52 + }, + "selector": "0x249dfd4f" + }, + { + "args": [ + { + "label": "uri", + "type": { + "displayName": [ + "String" + ], + "type": 3 + } + } + ], + "default": false, + "docs": [], + "label": "Psp34Traits::set_base_uri", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 74 + }, + "selector": "0x4de6850b" + }, + { + "args": [], + "default": false, + "docs": [], + "label": "Psp34Traits::get_attribute_count", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 68 + }, + "selector": "0x61c50d69" + }, + { + "args": [ + { + "label": "index", + "type": { + "displayName": [ + "u32" + ], + "type": 5 + } + } + ], + "default": false, + "docs": [], + "label": "Psp34Traits::get_attribute_name", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 52 + }, + "selector": "0xfcfe34de" + }, + { + "args": [ + { + "label": "token_id", + "type": { + "displayName": [ + "Id" + ], + "type": 66 + } + }, + { + "label": "attributes", + "type": { + "displayName": [ + "Vec" + ], + "type": 29 + } + } + ], + "default": false, + "docs": [], + "label": "Psp34Traits::get_attributes", + "mutates": false, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 46 + }, + "selector": "0x18209102" + }, + { + "args": [ + { + "label": "_token_id", + "type": { + "displayName": [ + "Id" + ], + "type": 66 + } + }, + { + "label": "_metadata", + "type": { + "displayName": [ + "Vec" + ], + "type": 7 + } + } + ], + "default": false, + "docs": [], + "label": "Psp34Traits::set_multiple_attributes", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 74 + }, + "selector": "0x5bf8416b" + } + ] + }, + "storage": { + "root": { + "layout": { + "struct": { + "fields": [ + { + "layout": { + "leaf": { + "key": "0x00000000", + "ty": 0 + } + }, + "name": "admin" + }, + { + "layout": { + "enum": { + "dispatchKey": "0x00000000", + "name": "Option", + "variants": { + "0": { + "fields": [], + "name": "None" + }, + "1": { + "fields": [ + { + "layout": { + "leaf": { + "key": "0x00000000", + "ty": 0 + } + }, + "name": "0" + } + ], + "name": "Some" + } + } + } + }, + "name": "pending_admin" + }, + { + "layout": { + "leaf": { + "key": "0x00000000", + "ty": 3 + } + }, + "name": "tld" + }, + { + "layout": { + "leaf": { + "key": "0x00000000", + "ty": 3 + } + }, + "name": "base_uri" + }, + { + "layout": { + "leaf": { + "key": "0x00000000", + "ty": 4 + } + }, + "name": "total_supply" + }, + { + "layout": { + "enum": { + "dispatchKey": "0x00000000", + "name": "Option", + "variants": { + "0": { + "fields": [], + "name": "None" + }, + "1": { + "fields": [ + { + "layout": { + "leaf": { + "key": "0x00000000", + "ty": 5 + } + }, + "name": "0" + } + ], + "name": "Some" + } + } + } + }, + "name": "records_size_limit" + }, + { + "layout": { + "enum": { + "dispatchKey": "0x00000000", + "name": "Option", + "variants": { + "0": { + "fields": [], + "name": "None" + }, + "1": { + "fields": [ + { + "layout": { + "struct": { + "fields": [ + { + "layout": { + "struct": { + "fields": [ + { + "layout": { + "leaf": { + "key": "0x00000000", + "ty": 0 + } + }, + "name": "account_id" + } + ], + "name": "CallBuilder" + } + }, + "name": "inner" + } + ], + "name": "NameCheckerRef" + } + }, + "name": "0" + } + ], + "name": "Some" + } + } + } + }, + "name": "name_checker" + }, + { + "layout": { + "enum": { + "dispatchKey": "0x00000000", + "name": "Option", + "variants": { + "0": { + "fields": [], + "name": "None" + }, + "1": { + "fields": [ + { + "layout": { + "struct": { + "fields": [ + { + "layout": { + "struct": { + "fields": [ + { + "layout": { + "leaf": { + "key": "0x00000000", + "ty": 0 + } + }, + "name": "account_id" + } + ], + "name": "CallBuilder" + } + }, + "name": "inner" + } + ], + "name": "FeeCalculatorRef" + } + }, + "name": "0" + } + ], + "name": "Some" + } + } + } + }, + "name": "fee_calculator" + }, + { + "layout": { + "root": { + "layout": { + "enum": { + "dispatchKey": "0x00000064", + "name": "Option", + "variants": { + "0": { + "fields": [], + "name": "None" + }, + "1": { + "fields": [ + { + "layout": { + "leaf": { + "key": "0x00000064", + "ty": 0 + } + }, + "name": "0" + } + ], + "name": "Some" + } + } + } + }, + "root_key": "0x00000064" + } + }, + "name": "reserved_names" + }, + { + "layout": { + "root": { + "layout": { + "leaf": { + "key": "0x00000065", + "ty": 6 + } + }, + "root_key": "0x00000065" + } + }, + "name": "operator_approvals" + }, + { + "layout": { + "root": { + "layout": { + "struct": { + "fields": [ + { + "layout": { + "leaf": { + "key": "0x000000c8", + "ty": 0 + } + }, + "name": "owner" + }, + { + "layout": { + "leaf": { + "key": "0x000000c8", + "ty": 0 + } + }, + "name": "controller" + }, + { + "layout": { + "leaf": { + "key": "0x000000c8", + "ty": 0 + } + }, + "name": "resolved" + } + ], + "name": "AddressDict" + } + }, + "root_key": "0x000000c8" + } + }, + "name": "name_to_address_dict" + }, + { + "layout": { + "root": { + "layout": { + "leaf": { + "key": "0x000000c9", + "ty": 0 + } + }, + "root_key": "0x000000c9" + } + }, + "name": "name_to_lock" + }, + { + "layout": { + "root": { + "layout": { + "struct": { + "fields": [ + { + "layout": { + "leaf": { + "key": "0x000000ca", + "ty": 6 + } + }, + "name": "0" + }, + { + "layout": { + "leaf": { + "key": "0x000000ca", + "ty": 6 + } + }, + "name": "1" + } + ], + "name": "(A, B)" + } + }, + "root_key": "0x000000ca" + } + }, + "name": "name_to_period" + }, + { + "layout": { + "root": { + "layout": { + "leaf": { + "key": "0x000000cb", + "ty": 7 + } + }, + "root_key": "0x000000cb" + } + }, + "name": "records" + }, + { + "layout": { + "root": { + "layout": { + "leaf": { + "key": "0x0000012c", + "ty": 4 + } + }, + "root_key": "0x0000012c" + } + }, + "name": "owner_to_name_count" + }, + { + "layout": { + "root": { + "layout": { + "leaf": { + "key": "0x0000012d", + "ty": 3 + } + }, + "root_key": "0x0000012d" + } + }, + "name": "owner_to_names" + }, + { + "layout": { + "root": { + "layout": { + "leaf": { + "key": "0x0000012e", + "ty": 4 + } + }, + "root_key": "0x0000012e" + } + }, + "name": "name_to_owner_index" + }, + { + "layout": { + "root": { + "layout": { + "leaf": { + "key": "0x00000136", + "ty": 4 + } + }, + "root_key": "0x00000136" + } + }, + "name": "controller_to_name_count" + }, + { + "layout": { + "root": { + "layout": { + "leaf": { + "key": "0x00000137", + "ty": 3 + } + }, + "root_key": "0x00000137" + } + }, + "name": "controller_to_names" + }, + { + "layout": { + "root": { + "layout": { + "leaf": { + "key": "0x00000138", + "ty": 4 + } + }, + "root_key": "0x00000138" + } + }, + "name": "name_to_controller_index" + }, + { + "layout": { + "root": { + "layout": { + "leaf": { + "key": "0x00000140", + "ty": 4 + } + }, + "root_key": "0x00000140" + } + }, + "name": "resolving_to_name_count" + }, + { + "layout": { + "root": { + "layout": { + "leaf": { + "key": "0x00000141", + "ty": 3 + } + }, + "root_key": "0x00000141" + } + }, + "name": "resolving_to_names" + }, + { + "layout": { + "root": { + "layout": { + "leaf": { + "key": "0x00000143", + "ty": 4 + } + }, + "root_key": "0x00000143" + } + }, + "name": "name_to_resolving_index" + }, + { + "layout": { + "root": { + "layout": { + "leaf": { + "key": "0x0000018f", + "ty": 3 + } + }, + "root_key": "0x0000018f" + } + }, + "name": "address_to_primary_name" + }, + { + "layout": { + "root": { + "layout": { + "enum": { + "dispatchKey": "0x000003e7", + "name": "Option", + "variants": { + "0": { + "fields": [], + "name": "None" + }, + "1": { + "fields": [ + { + "layout": { + "struct": { + "fields": [ + { + "layout": { + "struct": { + "fields": [ + { + "layout": { + "leaf": { + "key": "0x000003e7", + "ty": 0 + } + }, + "name": "account_id" + } + ], + "name": "CallBuilder" + } + }, + "name": "inner" + } + ], + "name": "MerkleVerifierRef" + } + }, + "name": "0" + } + ], + "name": "Some" + } + } + } + }, + "root_key": "0x000003e7" + } + }, + "name": "whitelisted_address_verifier" + } + ], + "name": "Registry" + } + }, + "root_key": "0x00000000" + } + }, + "types": [ + { + "id": 0, + "type": { + "def": { + "composite": { + "fields": [ + { + "type": 1, + "typeName": "[u8; 32]" + } + ] + } + }, + "path": [ + "ink_primitives", + "types", + "AccountId" + ] + } + }, + { + "id": 1, + "type": { + "def": { + "array": { + "len": 32, + "type": 2 + } + } + } + }, + { + "id": 2, + "type": { + "def": { + "primitive": "u8" + } + } + }, + { + "id": 3, + "type": { + "def": { + "primitive": "str" + } + } + }, + { + "id": 4, + "type": { + "def": { + "primitive": "u128" + } + } + }, + { + "id": 5, + "type": { + "def": { + "primitive": "u32" + } + } + }, + { + "id": 6, + "type": { + "def": { + "primitive": "u64" + } + } + }, + { + "id": 7, + "type": { + "def": { + "sequence": { + "type": 8 + } + } + } + }, + { + "id": 8, + "type": { + "def": { + "tuple": [ + 3, + 3 + ] + } + } + }, + { + "id": 9, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 0 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 0 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 10, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 11 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 11 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 11, + "type": { + "def": { + "tuple": [] + } + } + }, + { + "id": 12, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 1, + "name": "CouldNotReadInput" + } + ] + } + }, + "path": [ + "ink_primitives", + "LangError" + ] + } + }, + { + "id": 13, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 3 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 3 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 14, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 15 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 15 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 15, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 11 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 16 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 11 + }, + { + "name": "E", + "type": 16 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 16, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "NotAdmin" + }, + { + "index": 1, + "name": "NameAlreadyExists" + }, + { + "index": 2, + "name": "NameDoesntExist" + }, + { + "index": 3, + "name": "NameNotAllowed" + }, + { + "index": 4, + "name": "CallerIsNotOwner" + }, + { + "index": 5, + "name": "CallerIsNotController" + }, + { + "index": 6, + "name": "FeeNotPaid" + }, + { + "index": 7, + "name": "NameEmpty" + }, + { + "index": 8, + "name": "RecordNotFound" + }, + { + "index": 9, + "name": "WithdrawFailed" + }, + { + "index": 10, + "name": "InsufficientBalance" + }, + { + "index": 11, + "name": "NoResolvedAddress" + }, + { + "index": 12, + "name": "AlreadyClaimed" + }, + { + "index": 13, + "name": "InvalidMerkleProof" + }, + { + "index": 14, + "name": "CannotBuyReservedName" + }, + { + "index": 15, + "name": "NotReservedName" + }, + { + "index": 16, + "name": "NotAuthorised" + }, + { + "index": 17, + "name": "ZeroAddress" + }, + { + "index": 18, + "name": "RecordsOverflow" + }, + { + "fields": [ + { + "type": 17, + "typeName": "azns_fee_calculator::Error" + } + ], + "index": 19, + "name": "FeeError" + }, + { + "index": 20, + "name": "OnlyDuringWhitelistPhase" + }, + { + "index": 21, + "name": "RestrictedDuringWhitelistPhase" + } + ] + } + }, + "path": [ + "azns_registry", + "azns_registry", + "Error" + ] + } + }, + { + "id": 17, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "NotAdmin" + }, + { + "index": 1, + "name": "InvalidDuration" + }, + { + "index": 2, + "name": "ZeroLength" + }, + { + "index": 3, + "name": "ZeroPrice" + } + ] + } + }, + "path": [ + "azns_fee_calculator", + "Error" + ] + } + }, + { + "id": 18, + "type": { + "def": { + "primitive": "bool" + } + } + }, + { + "id": 19, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 20 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 20 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 20, + "type": { + "def": { + "sequence": { + "type": 1 + } + } + } + }, + { + "id": 21, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 22 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 22 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 22, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 4 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 16 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 4 + }, + { + "name": "E", + "type": 16 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 23, + "type": { + "def": { + "sequence": { + "type": 24 + } + } + } + }, + { + "id": 24, + "type": { + "def": { + "tuple": [ + 3, + 2, + 13 + ] + } + } + }, + { + "id": 25, + "type": { + "def": { + "sequence": { + "type": 2 + } + } + } + }, + { + "id": 26, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 27 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 27 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 27, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 11 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 28 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 11 + }, + { + "name": "E", + "type": 28 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 28, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 3, + "typeName": "String" + } + ], + "index": 0, + "name": "Custom" + }, + { + "index": 1, + "name": "SelfApprove" + }, + { + "index": 2, + "name": "NotApproved" + }, + { + "index": 3, + "name": "TokenExists" + }, + { + "index": 4, + "name": "TokenNotExists" + }, + { + "fields": [ + { + "type": 3, + "typeName": "String" + } + ], + "index": 5, + "name": "SafeTransferCheckFailed" + } + ] + } + }, + "path": [ + "interfaces", + "psp34_standard", + "PSP34Error" + ] + } + }, + { + "id": 29, + "type": { + "def": { + "sequence": { + "type": 3 + } + } + } + }, + { + "id": 30, + "type": { + "def": { + "sequence": { + "type": 31 + } + } + } + }, + { + "id": 31, + "type": { + "def": { + "tuple": [ + 3, + 13 + ] + } + } + }, + { + "id": 32, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 33 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 33 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 33, + "type": { + "def": { + "sequence": { + "type": 34 + } + } + } + }, + { + "id": 34, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 35, + "typeName": "AddressDict" + }, + { + "type": 9, + "typeName": "Option" + } + ], + "index": 0, + "name": "Registered" + }, + { + "fields": [ + { + "type": 9, + "typeName": "Option" + } + ], + "index": 1, + "name": "Reserved" + }, + { + "index": 2, + "name": "Available" + }, + { + "index": 3, + "name": "Unavailable" + } + ] + } + }, + "path": [ + "azns_registry", + "azns_registry", + "NameStatus" + ] + } + }, + { + "id": 35, + "type": { + "def": { + "composite": { + "fields": [ + { + "name": "owner", + "type": 0, + "typeName": "AccountId" + }, + { + "name": "controller", + "type": 0, + "typeName": "AccountId" + }, + { + "name": "resolved", + "type": 0, + "typeName": "AccountId" + } + ] + } + }, + "path": [ + "azns_registry", + "address_dict", + "AddressDict" + ] + } + }, + { + "id": 36, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 37 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 37 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 37, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 35 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 16 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 35 + }, + { + "name": "E", + "type": 16 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 38, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 39 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 39 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 39, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 0 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 16 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 0 + }, + { + "name": "E", + "type": 16 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 40, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 41 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 41 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 41, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 42 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 16 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 42 + }, + { + "name": "E", + "type": 16 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 42, + "type": { + "def": { + "tuple": [ + 6, + 6 + ] + } + } + }, + { + "id": 43, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 7 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 7 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 44, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 45 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 45 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 45, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 3 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 16 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 3 + }, + { + "name": "E", + "type": 16 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 46, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 29 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 29 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 47, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 13 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 13 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 48, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 9 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 9 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 49, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 4 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 4 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 50, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 51 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 51 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 51, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 5 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 5 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 52, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 3 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 3 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 53, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 4 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 4 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 54, + "type": { + "def": { + "sequence": { + "type": 55 + } + } + } + }, + { + "id": 55, + "type": { + "def": { + "tuple": [ + 3, + 9 + ] + } + } + }, + { + "id": 56, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 57 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 57 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 57, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 58 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 16 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 58 + }, + { + "name": "E", + "type": 16 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 58, + "type": { + "def": { + "tuple": [ + 4, + 4, + 4, + 9 + ] + } + } + }, + { + "id": 59, + "type": { + "def": { + "sequence": { + "type": 60 + } + } + } + }, + { + "id": 60, + "type": { + "def": { + "tuple": [ + 3, + 0, + 2, + 13 + ] + } + } + }, + { + "id": 61, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 62 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 62 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 62, + "type": { + "def": { + "sequence": { + "type": 57 + } + } + } + }, + { + "id": 63, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 18 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 18 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 64, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 0 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 0 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 65, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 66 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 66 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 66, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 2, + "typeName": "u8" + } + ], + "index": 0, + "name": "U8" + }, + { + "fields": [ + { + "type": 67, + "typeName": "u16" + } + ], + "index": 1, + "name": "U16" + }, + { + "fields": [ + { + "type": 5, + "typeName": "u32" + } + ], + "index": 2, + "name": "U32" + }, + { + "fields": [ + { + "type": 6, + "typeName": "u64" + } + ], + "index": 3, + "name": "U64" + }, + { + "fields": [ + { + "type": 4, + "typeName": "u128" + } + ], + "index": 4, + "name": "U128" + }, + { + "fields": [ + { + "type": 25, + "typeName": "Vec" + } + ], + "index": 5, + "name": "Bytes" + } + ] + } + }, + "path": [ + "interfaces", + "psp34_standard", + "Id" + ] + } + }, + { + "id": 67, + "type": { + "def": { + "primitive": "u16" + } + } + }, + { + "id": 68, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 5 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 5 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 69, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 66 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 66 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 70, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 71 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 71 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 71, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 66 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 28 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 66 + }, + { + "name": "E", + "type": 28 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 72, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 73 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 73 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 73, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 25 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 25 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 74, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 75 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 12 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 75 + }, + { + "name": "E", + "type": 12 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 75, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 11 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 76 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 11 + }, + { + "name": "E", + "type": 76 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 76, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 3, + "typeName": "String" + } + ], + "index": 0, + "name": "Custom" + } + ] + } + }, + "path": [ + "interfaces", + "art_zero_traits", + "ArtZeroError" + ] + } + }, + { + "id": 77, + "type": { + "def": { + "composite": { + "fields": [ + { + "type": 1, + "typeName": "[u8; 32]" + } + ] + } + }, + "path": [ + "ink_primitives", + "types", + "Hash" + ] + } + }, + { + "id": 78, + "type": { + "def": { + "variant": {} + }, + "path": [ + "ink_env", + "types", + "NoChainExtension" + ] + } + } + ], + "version": "4" +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 253755f..97ab442 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2235,11 +2235,23 @@ undici "5.5.1" ws "^8.2.2" +"@noble/curves@^1.3.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.5.0.tgz#7a9b9b507065d516e6dce275a1e31db8d2a100dd" + integrity sha512-J5EKamIHnKPyClwVrzmaf5wSdQXgdHcPZIZLu3bwnbeCx8/7NPK5q2ZBWF+5FvYGByjiQQsJYX6jfgB2wDPn3A== + dependencies: + "@noble/hashes" "1.4.0" + "@noble/hashes@1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.2.tgz#e9e035b9b166ca0af657a7848eb2718f0f22f183" integrity sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA== +"@noble/hashes@1.4.0", "@noble/hashes@^1.3.1", "@noble/hashes@^1.3.3": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" + integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== + "@noble/hashes@~1.1.1": version "1.1.3" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.3.tgz#360afc77610e0a61f3417e497dcf36862e4f8111" @@ -2530,6 +2542,394 @@ resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.7.0.tgz#3092d70ea60e3d1835466266b1d68ad47035a2d5" integrity sha512-52Qb+A1DdOss8QvJrijYYPSf32GUg2pGaG/yCxtaA3cu4jduouTdg4XZSMLW9op54m1jH7J8hoajhHKOPsoJFw== +"@polkadot-api/json-rpc-provider-proxy@0.0.1": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@polkadot-api/json-rpc-provider-proxy/-/json-rpc-provider-proxy-0.0.1.tgz#bb5c943642cdf0ec7bc48c0a2647558b9fcd7bdb" + integrity sha512-gmVDUP8LpCH0BXewbzqXF2sdHddq1H1q+XrAW2of+KZj4woQkIGBRGTJHeBEVHe30EB+UejR1N2dT4PO/RvDdg== + +"@polkadot-api/json-rpc-provider@0.0.1": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@polkadot-api/json-rpc-provider/-/json-rpc-provider-0.0.1.tgz#333645d40ccd9bccfd1f32503f17e4e63e76e297" + integrity sha512-/SMC/l7foRjpykLTUTacIH05H3mr9ip8b5xxfwXlVezXrNVLp3Cv0GX6uItkKd+ZjzVPf3PFrDF2B2/HLSNESA== + +"@polkadot-api/metadata-builders@0.0.1": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@polkadot-api/metadata-builders/-/metadata-builders-0.0.1.tgz#a76b48febef9ea72be8273d889e2677101045a05" + integrity sha512-GCI78BHDzXAF/L2pZD6Aod/yl82adqQ7ftNmKg51ixRL02JpWUA+SpUKTJE5MY1p8kiJJIo09P2um24SiJHxNA== + dependencies: + "@polkadot-api/substrate-bindings" "0.0.1" + "@polkadot-api/utils" "0.0.1" + +"@polkadot-api/observable-client@0.1.0": + version "0.1.0" + resolved "https://registry.yarnpkg.com/@polkadot-api/observable-client/-/observable-client-0.1.0.tgz#472045ea06a2bc4bccdc2db5c063eadcbf6f5351" + integrity sha512-GBCGDRztKorTLna/unjl/9SWZcRmvV58o9jwU2Y038VuPXZcr01jcw/1O3x+yeAuwyGzbucI/mLTDa1QoEml3A== + dependencies: + "@polkadot-api/metadata-builders" "0.0.1" + "@polkadot-api/substrate-bindings" "0.0.1" + "@polkadot-api/substrate-client" "0.0.1" + "@polkadot-api/utils" "0.0.1" + +"@polkadot-api/substrate-bindings@0.0.1": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@polkadot-api/substrate-bindings/-/substrate-bindings-0.0.1.tgz#c4b7f4d6c3672d2c15cbc6c02964f014b73cbb0b" + integrity sha512-bAe7a5bOPnuFVmpv7y4BBMRpNTnMmE0jtTqRUw/+D8ZlEHNVEJQGr4wu3QQCl7k1GnSV1wfv3mzIbYjErEBocg== + dependencies: + "@noble/hashes" "^1.3.1" + "@polkadot-api/utils" "0.0.1" + "@scure/base" "^1.1.1" + scale-ts "^1.6.0" + +"@polkadot-api/substrate-client@0.0.1": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@polkadot-api/substrate-client/-/substrate-client-0.0.1.tgz#0e8010a0abe2fb47d6fa7ab94e45e1d0de083314" + integrity sha512-9Bg9SGc3AwE+wXONQoW8GC00N3v6lCZLW74HQzqB6ROdcm5VAHM4CB/xRzWSUF9CXL78ugiwtHx3wBcpx4H4Wg== + +"@polkadot-api/utils@0.0.1": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@polkadot-api/utils/-/utils-0.0.1.tgz#908b22becac705149d7cc946532143d0fb003bfc" + integrity sha512-3j+pRmlF9SgiYDabSdZsBSsN5XHbpXOAce1lWj56IEEaFZVjsiCaxDOA7C9nCcgfVXuvnbxqqEGQvnY+QfBAUw== + +"@polkadot/api-augment@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/api-augment/-/api-augment-12.3.1.tgz#07c1b510310868e01f89e4d2f2313595d068b228" + integrity sha512-KfofZVEUeTgLzcexdxKBT2vihazDheUoTLxbsa2ztmmw4UB/IjOL911y04pjg2obZQAI9B+oCyxJXyCfzauWEg== + dependencies: + "@polkadot/api-base" "12.3.1" + "@polkadot/rpc-augment" "12.3.1" + "@polkadot/types" "12.3.1" + "@polkadot/types-augment" "12.3.1" + "@polkadot/types-codec" "12.3.1" + "@polkadot/util" "^13.0.2" + tslib "^2.6.2" + +"@polkadot/api-base@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/api-base/-/api-base-12.3.1.tgz#084801da4e54820ec0e91c51a237bcd861665c1d" + integrity sha512-vNbxXNjn4APfXg+ui99gurX2Jzns+eezmWranxoGXT7q0mme1zAtWus5t4e+qe1qRjDNZZYPruF7YJA8dL5k8A== + dependencies: + "@polkadot/rpc-core" "12.3.1" + "@polkadot/types" "12.3.1" + "@polkadot/util" "^13.0.2" + rxjs "^7.8.1" + tslib "^2.6.2" + +"@polkadot/api-contract@^12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/api-contract/-/api-contract-12.3.1.tgz#4cf287ed9de9e3d67b82d793d64c1138316ad6e4" + integrity sha512-/HHkMWdrhBwD3nMZHVMA2BVt+RfsJlOnd0tUnsQq6milGgm+AaptsZ6gaa+M5vidM/gV1k+pwGzROXNkcEjdAQ== + dependencies: + "@polkadot/api" "12.3.1" + "@polkadot/api-augment" "12.3.1" + "@polkadot/types" "12.3.1" + "@polkadot/types-codec" "12.3.1" + "@polkadot/types-create" "12.3.1" + "@polkadot/util" "^13.0.2" + "@polkadot/util-crypto" "^13.0.2" + rxjs "^7.8.1" + tslib "^2.6.2" + +"@polkadot/api-derive@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/api-derive/-/api-derive-12.3.1.tgz#2da05346fed18ff29ed2a581a3270591de11662c" + integrity sha512-2MbK1h4GcKEdSgDKKYI28iZESw0VOm0kekV6YGQflZNWe84jJOn2rohP8pACseUjQjwWDgbPPBvTlRZTk7zdAw== + dependencies: + "@polkadot/api" "12.3.1" + "@polkadot/api-augment" "12.3.1" + "@polkadot/api-base" "12.3.1" + "@polkadot/rpc-core" "12.3.1" + "@polkadot/types" "12.3.1" + "@polkadot/types-codec" "12.3.1" + "@polkadot/util" "^13.0.2" + "@polkadot/util-crypto" "^13.0.2" + rxjs "^7.8.1" + tslib "^2.6.2" + +"@polkadot/api@12.3.1", "@polkadot/api@^12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/api/-/api-12.3.1.tgz#bce62c902293295460832d15ee8fa2119a36ae42" + integrity sha512-VCrtadJRJttya5NhZ8slkD/UQyOZv4qABjagQMaG1eTZpn5k1wskmDUGdHrZZpYO5jBPewnCgaN8+LPKO2qiOw== + dependencies: + "@polkadot/api-augment" "12.3.1" + "@polkadot/api-base" "12.3.1" + "@polkadot/api-derive" "12.3.1" + "@polkadot/keyring" "^13.0.2" + "@polkadot/rpc-augment" "12.3.1" + "@polkadot/rpc-core" "12.3.1" + "@polkadot/rpc-provider" "12.3.1" + "@polkadot/types" "12.3.1" + "@polkadot/types-augment" "12.3.1" + "@polkadot/types-codec" "12.3.1" + "@polkadot/types-create" "12.3.1" + "@polkadot/types-known" "12.3.1" + "@polkadot/util" "^13.0.2" + "@polkadot/util-crypto" "^13.0.2" + eventemitter3 "^5.0.1" + rxjs "^7.8.1" + tslib "^2.6.2" + +"@polkadot/keyring@^13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/keyring/-/keyring-13.0.2.tgz#05a655eb06c965ae5ee5f181d25916797ea50849" + integrity sha512-NeLbhyKDT5W8LI9seWTZGePxNTOVpDhv2018HSrEDwJq9Ie0C4TZhUf3KNERCkSveuThXjfQJMs+1CF33ZXPWw== + dependencies: + "@polkadot/util" "13.0.2" + "@polkadot/util-crypto" "13.0.2" + tslib "^2.6.2" + +"@polkadot/networks@13.0.2", "@polkadot/networks@^13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/networks/-/networks-13.0.2.tgz#0f8fc896b8fb2141212b6448739f4a00bc72b29c" + integrity sha512-ABAL+vug/gIwkdFEzeh87JoJd0YKrxSYg/HjUrZ+Zis2ucxQEKpvtCpJ34ku+YrjacBfVqIAkkwd3ZdIPGq9aQ== + dependencies: + "@polkadot/util" "13.0.2" + "@substrate/ss58-registry" "^1.46.0" + tslib "^2.6.2" + +"@polkadot/rpc-augment@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-augment/-/rpc-augment-12.3.1.tgz#9a896c4578753055ab25326243e716344a895a8a" + integrity sha512-/tZLl5IuQ4vdGlUAbd8x3ShZ35XDSeyknKHCC+9kIrM/+KIyoCYBob2RXP9uqX8m516AWkXUrjsSO6DFPBpRGg== + dependencies: + "@polkadot/rpc-core" "12.3.1" + "@polkadot/types" "12.3.1" + "@polkadot/types-codec" "12.3.1" + "@polkadot/util" "^13.0.2" + tslib "^2.6.2" + +"@polkadot/rpc-core@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-core/-/rpc-core-12.3.1.tgz#6107c507c30839313e0325c82bffae9f1b08dbab" + integrity sha512-bNo26P20nRpLfANTK4sWEakxvqBJpKwAp/Gt7KlxoGgoTUbWFapyGKScFxp/pblycEziEbC+ZjkLMkaWaqi69g== + dependencies: + "@polkadot/rpc-augment" "12.3.1" + "@polkadot/rpc-provider" "12.3.1" + "@polkadot/types" "12.3.1" + "@polkadot/util" "^13.0.2" + rxjs "^7.8.1" + tslib "^2.6.2" + +"@polkadot/rpc-provider@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/rpc-provider/-/rpc-provider-12.3.1.tgz#90bfbb8518bd63d94141bf4d2643c89b89e61413" + integrity sha512-Tg1Oj/1ldivqwnnOWepcNHEHYgpOBffxlrZMEXH1XX6D3AZaUhAWbatizyisydpuMbknTQ9FGYSnb9rOc2QBJw== + dependencies: + "@polkadot/keyring" "^13.0.2" + "@polkadot/types" "12.3.1" + "@polkadot/types-support" "12.3.1" + "@polkadot/util" "^13.0.2" + "@polkadot/util-crypto" "^13.0.2" + "@polkadot/x-fetch" "^13.0.2" + "@polkadot/x-global" "^13.0.2" + "@polkadot/x-ws" "^13.0.2" + eventemitter3 "^5.0.1" + mock-socket "^9.3.1" + nock "^13.5.0" + tslib "^2.6.2" + optionalDependencies: + "@substrate/connect" "0.8.10" + +"@polkadot/types-augment@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-augment/-/types-augment-12.3.1.tgz#c7853049829d39d35b94fb01a84c1ea0d61ca9e0" + integrity sha512-I3ggJt7W3UOScP6WA6PNmNsmpCfZtXkRJvSJkX7bi2LsSm/iF0xo0KdpQK02dHu7nGRFD9O5cSoVawzZJifGLA== + dependencies: + "@polkadot/types" "12.3.1" + "@polkadot/types-codec" "12.3.1" + "@polkadot/util" "^13.0.2" + tslib "^2.6.2" + +"@polkadot/types-codec@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-codec/-/types-codec-12.3.1.tgz#4eb113a5a2c9e7784f1393db4d6cfe39b24da014" + integrity sha512-yZ4exsQI+eVkE/fZNuJBOajAgOH/YncKWOOf0N4lc6iq28oYp22DCAXc50Ym372l4HO+uhC9QdMPH9EiWwT2pQ== + dependencies: + "@polkadot/util" "^13.0.2" + "@polkadot/x-bigint" "^13.0.2" + tslib "^2.6.2" + +"@polkadot/types-create@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-create/-/types-create-12.3.1.tgz#867ff2971f0d1c7b68788eb3b9f7c060fcbc648f" + integrity sha512-Jf9BByWB64FPW3lM5/Mcc/foyPJ3L9t0QwHVHaYWaonZt6l7SPX71rQmD7twJiTj9q1d1WidDKg/TtRDNbm1yA== + dependencies: + "@polkadot/types-codec" "12.3.1" + "@polkadot/util" "^13.0.2" + tslib "^2.6.2" + +"@polkadot/types-known@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-known/-/types-known-12.3.1.tgz#11aade98492e37c2e6d095c78fcd229a212ee933" + integrity sha512-G8t0uiIW1iu3KwylHDPnqdHxg5qwBxzPZQJvsjnGx2qBUk2VqXditKWcNFLEwCTnJPL95t2AzEO711lS99WRbg== + dependencies: + "@polkadot/networks" "^13.0.2" + "@polkadot/types" "12.3.1" + "@polkadot/types-codec" "12.3.1" + "@polkadot/types-create" "12.3.1" + "@polkadot/util" "^13.0.2" + tslib "^2.6.2" + +"@polkadot/types-support@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/types-support/-/types-support-12.3.1.tgz#7111f3a7a55a5f4f50b11450c62b7fe5340e4a21" + integrity sha512-TwL5M5HkZ4jQGKekD+qJFLba7UXWASfwlPy2OpKj0LOnnmq4tudXgN13UFdQ7HoOmisPhr+vYo9vteYeBZ0jTA== + dependencies: + "@polkadot/util" "^13.0.2" + tslib "^2.6.2" + +"@polkadot/types@12.3.1": + version "12.3.1" + resolved "https://registry.yarnpkg.com/@polkadot/types/-/types-12.3.1.tgz#46a44aaa672d9c3c8598bbf8b8668e575c55f76a" + integrity sha512-4MkTF1znpgp9mZc/ZZPdFe7/5it9v+EJmzXc/DEOX9kVWs2BuKOWopzOFyO3reVUUB+v7dxfSOArSsxkMUcuoA== + dependencies: + "@polkadot/keyring" "^13.0.2" + "@polkadot/types-augment" "12.3.1" + "@polkadot/types-codec" "12.3.1" + "@polkadot/types-create" "12.3.1" + "@polkadot/util" "^13.0.2" + "@polkadot/util-crypto" "^13.0.2" + rxjs "^7.8.1" + tslib "^2.6.2" + +"@polkadot/util-crypto@13.0.2", "@polkadot/util-crypto@^13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/util-crypto/-/util-crypto-13.0.2.tgz#fee602bcb39e9424300410f4144f170ee2a29292" + integrity sha512-woUsJJ6zd/caL7U+D30a5oM/+WK9iNI00Y8aNUHSj6Zq/KPzK9uqDBaLGWwlgrejoMQkxxiU2X0f2LzP15AtQg== + dependencies: + "@noble/curves" "^1.3.0" + "@noble/hashes" "^1.3.3" + "@polkadot/networks" "13.0.2" + "@polkadot/util" "13.0.2" + "@polkadot/wasm-crypto" "^7.3.2" + "@polkadot/wasm-util" "^7.3.2" + "@polkadot/x-bigint" "13.0.2" + "@polkadot/x-randomvalues" "13.0.2" + "@scure/base" "^1.1.5" + tslib "^2.6.2" + +"@polkadot/util@13.0.2", "@polkadot/util@^13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/util/-/util-13.0.2.tgz#f0a2572d74730fda8dfd690b60d53c131a688f3b" + integrity sha512-/6bS9sfhJLhs8QuqWaR1eRapzfDdGC5XAQZEPL9NN5sTTA7HxWos8rVleai0UERm8QUMabjZ9rK9KpzbXl7ojg== + dependencies: + "@polkadot/x-bigint" "13.0.2" + "@polkadot/x-global" "13.0.2" + "@polkadot/x-textdecoder" "13.0.2" + "@polkadot/x-textencoder" "13.0.2" + "@types/bn.js" "^5.1.5" + bn.js "^5.2.1" + tslib "^2.6.2" + +"@polkadot/wasm-bridge@7.3.2": + version "7.3.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-bridge/-/wasm-bridge-7.3.2.tgz#e1b01906b19e06cbca3d94f10f5666f2ae0baadc" + integrity sha512-AJEXChcf/nKXd5Q/YLEV5dXQMle3UNT7jcXYmIffZAo/KI394a+/24PaISyQjoNC0fkzS1Q8T5pnGGHmXiVz2g== + dependencies: + "@polkadot/wasm-util" "7.3.2" + tslib "^2.6.2" + +"@polkadot/wasm-crypto-asmjs@7.3.2": + version "7.3.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-7.3.2.tgz#c6d41bc4b48b5359d57a24ca3066d239f2d70a34" + integrity sha512-QP5eiUqUFur/2UoF2KKKYJcesc71fXhQFLT3D4ZjG28Mfk2ZPI0QNRUfpcxVQmIUpV5USHg4geCBNuCYsMm20Q== + dependencies: + tslib "^2.6.2" + +"@polkadot/wasm-crypto-init@7.3.2": + version "7.3.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-init/-/wasm-crypto-init-7.3.2.tgz#7e1fe79ba978fb0a4a0f74a92d976299d38bc4b8" + integrity sha512-FPq73zGmvZtnuJaFV44brze3Lkrki3b4PebxCy9Fplw8nTmisKo9Xxtfew08r0njyYh+uiJRAxPCXadkC9sc8g== + dependencies: + "@polkadot/wasm-bridge" "7.3.2" + "@polkadot/wasm-crypto-asmjs" "7.3.2" + "@polkadot/wasm-crypto-wasm" "7.3.2" + "@polkadot/wasm-util" "7.3.2" + tslib "^2.6.2" + +"@polkadot/wasm-crypto-wasm@7.3.2": + version "7.3.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-7.3.2.tgz#44e08ed5cf6499ce4a3aa7247071a5d01f6a74f4" + integrity sha512-15wd0EMv9IXs5Abp1ZKpKKAVyZPhATIAHfKsyoWCEFDLSOA0/K0QGOxzrAlsrdUkiKZOq7uzSIgIDgW8okx2Mw== + dependencies: + "@polkadot/wasm-util" "7.3.2" + tslib "^2.6.2" + +"@polkadot/wasm-crypto@^7.3.2": + version "7.3.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-crypto/-/wasm-crypto-7.3.2.tgz#61bbcd9e591500705c8c591e6aff7654bdc8afc9" + integrity sha512-+neIDLSJ6jjVXsjyZ5oLSv16oIpwp+PxFqTUaZdZDoA2EyFRQB8pP7+qLsMNk+WJuhuJ4qXil/7XiOnZYZ+wxw== + dependencies: + "@polkadot/wasm-bridge" "7.3.2" + "@polkadot/wasm-crypto-asmjs" "7.3.2" + "@polkadot/wasm-crypto-init" "7.3.2" + "@polkadot/wasm-crypto-wasm" "7.3.2" + "@polkadot/wasm-util" "7.3.2" + tslib "^2.6.2" + +"@polkadot/wasm-util@7.3.2", "@polkadot/wasm-util@^7.3.2": + version "7.3.2" + resolved "https://registry.yarnpkg.com/@polkadot/wasm-util/-/wasm-util-7.3.2.tgz#4fe6370d2b029679b41a5c02cd7ebf42f9b28de1" + integrity sha512-bmD+Dxo1lTZyZNxbyPE380wd82QsX+43mgCm40boyKrRppXEyQmWT98v/Poc7chLuskYb6X8IQ6lvvK2bGR4Tg== + dependencies: + tslib "^2.6.2" + +"@polkadot/x-bigint@13.0.2", "@polkadot/x-bigint@^13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-bigint/-/x-bigint-13.0.2.tgz#25adca9ce0c5ed691f9bced283f44f7e7d824300" + integrity sha512-h2jKT/UaxiEal8LhQeH6+GCjO7GwEqVAD2SNYteCOXff6yNttqAZYJuHZsndbVjVNwqRNf8D5q/zZkD0HUd6xQ== + dependencies: + "@polkadot/x-global" "13.0.2" + tslib "^2.6.2" + +"@polkadot/x-fetch@^13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-fetch/-/x-fetch-13.0.2.tgz#841d901fae36cbc4157297324ca0d73fbe4d200e" + integrity sha512-B/gf9iriUr6za/Ui7zIFBfHz7UBZ68rJEIteWHx1UHRCZPcLqv+hgpev6xIGrkfFljI0/lI7IwtN2qy6HYzFBg== + dependencies: + "@polkadot/x-global" "13.0.2" + node-fetch "^3.3.2" + tslib "^2.6.2" + +"@polkadot/x-global@13.0.2", "@polkadot/x-global@^13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-global/-/x-global-13.0.2.tgz#77afc4fbd4cfac8ba78cf120836f30ecc7322a74" + integrity sha512-OoNIXLB5y8vIKpk4R+XmpDPhipNXWSUvEwUnpQT7NAxNLmzgMq1FhbrwBWWPRNHPrQonp7mqxV/X+v5lv1HW/g== + dependencies: + tslib "^2.6.2" + +"@polkadot/x-randomvalues@13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-randomvalues/-/x-randomvalues-13.0.2.tgz#78ae28b345895cc816ffcad0b336c31cadfcf928" + integrity sha512-SGj+L0H/7TWZtSmtkWlixO4DFzXDdluI0UscN2h285os2Ns8PnmBbue+iJ8PVSzpY1BOxd66gvkkpboPz+jXFQ== + dependencies: + "@polkadot/x-global" "13.0.2" + tslib "^2.6.2" + +"@polkadot/x-textdecoder@13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-textdecoder/-/x-textdecoder-13.0.2.tgz#662a6855af8e7a5af17f86890e59ab44f829243a" + integrity sha512-mauglOkTJxLGmLwLc3J5Jlq/W+SHP53eiy3F8/8JxxfnXrZKgWoQXGpvXYPjFnMZj0MzDSy/6GjyGWnDCgdQFA== + dependencies: + "@polkadot/x-global" "13.0.2" + tslib "^2.6.2" + +"@polkadot/x-textencoder@13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-textencoder/-/x-textencoder-13.0.2.tgz#5e178e0f759df50592e6870346c8db2a445af957" + integrity sha512-Lq08H2OnVXj97uaOwg7tcmRS7a4VJYkHEeWO4FyEMOk6P6lU6W8OVNjjxG0se9PCEgmyZPUDbJI//1ynzP4cXw== + dependencies: + "@polkadot/x-global" "13.0.2" + tslib "^2.6.2" + +"@polkadot/x-ws@^13.0.2": + version "13.0.2" + resolved "https://registry.yarnpkg.com/@polkadot/x-ws/-/x-ws-13.0.2.tgz#d0392a87adcba851a44fc6f7f56792e529228f3e" + integrity sha512-nC5e2eY5D5ZR5teQOB7ib+dWLbmNws86cTz3BjKCalSMBBIn6i3V9ElgABpierBmnSJe9D94EyrH1BxdVfDxUg== + dependencies: + "@polkadot/x-global" "13.0.2" + tslib "^2.6.2" + ws "^8.16.0" + "@resolver-engine/core@^0.3.3": version "0.3.3" resolved "https://registry.yarnpkg.com/@resolver-engine/core/-/core-0.3.3.tgz#590f77d85d45bc7ecc4e06c654f41345db6ca967" @@ -2624,6 +3024,11 @@ estree-walker "^1.0.1" picomatch "^2.2.2" +"@scure/base@^1.1.1", "@scure/base@^1.1.5": + version "1.1.7" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.7.tgz#fe973311a5c6267846aa131bc72e96c5d40d2b30" + integrity sha512-PPNYBslrLNNUQ/Yad37MHYsNQtK67EhWb6WtSvNLLPo7SdVZgkUjD6Dg+5On7zNwmskf8OX7I7Nx5oN+MIWE0g== + "@scure/base@~1.1.0": version "1.1.1" resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.1.tgz#ebb651ee52ff84f420097055f4bf46cfba403938" @@ -2749,6 +3154,44 @@ "@size-limit/esbuild" "7.0.8" "@size-limit/file" "7.0.8" +"@substrate/connect-extension-protocol@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@substrate/connect-extension-protocol/-/connect-extension-protocol-2.0.0.tgz#badaa6e6b5f7c7d56987d778f4944ddb83cd9ea7" + integrity sha512-nKu8pDrE3LNCEgJjZe1iGXzaD6OSIDD4Xzz/yo4KO9mQ6LBvf49BVrt4qxBFGL6++NneLiWUZGoh+VSd4PyVIg== + +"@substrate/connect-known-chains@^1.1.4": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@substrate/connect-known-chains/-/connect-known-chains-1.2.2.tgz#fd0b290d9270d7bfc1e60cd9b6f1d39ecd9e11eb" + integrity sha512-gOGrXSWA2d/3kf8Yco00VlHZl48smzAGW5Z9MDxMht98hRpT2yEEN4N5QdoEKMI4ihDW8goXGzmp79D0hFPpuA== + +"@substrate/connect@0.8.10": + version "0.8.10" + resolved "https://registry.yarnpkg.com/@substrate/connect/-/connect-0.8.10.tgz#810b6589f848828aa840c731a1f36b84fe0e5956" + integrity sha512-DIyQ13DDlXqVFnLV+S6/JDgiGowVRRrh18kahieJxhgvzcWicw5eLc6jpfQ0moVVLBYkO7rctB5Wreldwpva8w== + dependencies: + "@substrate/connect-extension-protocol" "^2.0.0" + "@substrate/connect-known-chains" "^1.1.4" + "@substrate/light-client-extension-helpers" "^0.0.6" + smoldot "2.0.22" + +"@substrate/light-client-extension-helpers@^0.0.6": + version "0.0.6" + resolved "https://registry.yarnpkg.com/@substrate/light-client-extension-helpers/-/light-client-extension-helpers-0.0.6.tgz#bec1c7997241226db50b44ad85a992b4348d21c3" + integrity sha512-girltEuxQ1BvkJWmc8JJlk4ZxnlGXc/wkLcNguhY+UoDEMBK0LsdtfzQKIfrIehi4QdeSBlFEFBoI4RqPmsZzA== + dependencies: + "@polkadot-api/json-rpc-provider" "0.0.1" + "@polkadot-api/json-rpc-provider-proxy" "0.0.1" + "@polkadot-api/observable-client" "0.1.0" + "@polkadot-api/substrate-client" "0.0.1" + "@substrate/connect-extension-protocol" "^2.0.0" + "@substrate/connect-known-chains" "^1.1.4" + rxjs "^7.8.1" + +"@substrate/ss58-registry@^1.46.0": + version "1.49.0" + resolved "https://registry.yarnpkg.com/@substrate/ss58-registry/-/ss58-registry-1.49.0.tgz#ed9507316d13f49b2bccb65f08ec97180f71fc39" + integrity sha512-leW6Ix4LD7XgvxT7+aobPWSw+WvPcN2Rxof1rmd0mNC5t2n99k1N7UNEvz7YEFSOUeHWmKIY7F5q8KeIqYoHfA== + "@szmarczak/http-timer@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-1.1.2.tgz#b1665e2c461a2cd92f4c1bbf50d5454de0d4b421" @@ -2901,6 +3344,13 @@ dependencies: "@types/node" "*" +"@types/bn.js@^5.1.5": + version "5.1.5" + resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.5.tgz#2e0dacdcce2c0f16b905d20ff87aedbc6f7b4bf0" + integrity sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A== + dependencies: + "@types/node" "*" + "@types/chai-as-promised@^7.1.4": version "7.1.5" resolved "https://registry.yarnpkg.com/@types/chai-as-promised/-/chai-as-promised-7.1.5.tgz#6e016811f6c7a64f2eed823191c3a6955094e255" @@ -5441,6 +5891,11 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" +data-uri-to-buffer@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz#d8feb2b2881e6a4f58c2e08acfd0e2834e26222e" + integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A== + data-urls@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" @@ -6976,6 +7431,11 @@ eventemitter3@4.0.4: resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.4.tgz#b5463ace635a083d018bdc7c917b4c5f10a85384" integrity sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ== +eventemitter3@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4" + integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA== + events@^3.0.0: version "3.3.0" resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" @@ -7229,6 +7689,14 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" +fetch-blob@^3.1.2, fetch-blob@^3.1.4: + version "3.2.0" + resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.2.0.tgz#f09b8d4bbd45adc6f0c20b7e787e793e309dcce9" + integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ== + dependencies: + node-domexception "^1.0.0" + web-streams-polyfill "^3.0.3" + fetch-ponyfill@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/fetch-ponyfill/-/fetch-ponyfill-4.1.0.tgz#ae3ce5f732c645eab87e4ae8793414709b239893" @@ -7430,6 +7898,13 @@ form-data@~2.3.2: combined-stream "^1.0.6" mime-types "^2.1.12" +formdata-polyfill@^4.0.10: + version "4.0.10" + resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423" + integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g== + dependencies: + fetch-blob "^3.1.2" + forwarded@0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" @@ -9312,7 +9787,7 @@ json-stable-stringify@^1.0.1: dependencies: jsonify "~0.0.0" -json-stringify-safe@~5.0.1: +json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== @@ -10239,6 +10714,11 @@ mock-fs@^4.1.0: resolved "https://registry.yarnpkg.com/mock-fs/-/mock-fs-4.14.0.tgz#ce5124d2c601421255985e6e94da80a7357b1b18" integrity sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw== +mock-socket@^9.3.1: + version "9.3.1" + resolved "https://registry.yarnpkg.com/mock-socket/-/mock-socket-9.3.1.tgz#24fb00c2f573c84812aa4a24181bb025de80cc8e" + integrity sha512-qxBgB7Qa2sEQgHFjj0dSigq7fX4k6Saisd5Nelwp2q8mlbAFh5dHV9JTTlF8viYJLSSWgMCZFUom8PJcMNBoJw== + module-error@^1.0.1, module-error@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/module-error/-/module-error-1.0.2.tgz#8d1a48897ca883f47a45816d4fb3e3c6ba404d86" @@ -10407,11 +10887,25 @@ no-case@^3.0.4: lower-case "^2.0.2" tslib "^2.0.3" +nock@^13.5.0: + version "13.5.4" + resolved "https://registry.yarnpkg.com/nock/-/nock-13.5.4.tgz#8918f0addc70a63736170fef7106a9721e0dc479" + integrity sha512-yAyTfdeNJGGBFxWdzSKCBYxs5FxLbCg5X5Q4ets974hcQzG1+qCxvIyOo4j2Ry6MUlhWVMX4OoYDefAIIwupjw== + dependencies: + debug "^4.1.0" + json-stringify-safe "^5.0.1" + propagate "^2.0.0" + node-addon-api@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== +node-domexception@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5" + integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== + node-fetch@^2.6.1, node-fetch@^2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" @@ -10419,6 +10913,15 @@ node-fetch@^2.6.1, node-fetch@^2.6.7: dependencies: whatwg-url "^5.0.0" +node-fetch@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.2.tgz#d1e889bacdf733b4ff3b2b243eb7a12866a0b78b" + integrity sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA== + dependencies: + data-uri-to-buffer "^4.0.0" + fetch-blob "^3.1.4" + formdata-polyfill "^4.0.10" + node-fetch@~1.7.1: version "1.7.3" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef" @@ -11240,6 +11743,11 @@ prop-types@^15.8.1: object-assign "^4.1.1" react-is "^16.13.1" +propagate@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/propagate/-/propagate-2.0.1.tgz#40cdedab18085c792334e64f0ac17256d38f9a45" + integrity sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag== + proxy-addr@~2.0.7: version "2.0.7" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" @@ -11951,6 +12459,13 @@ rxjs@^6.6.0: dependencies: tslib "^1.9.0" +rxjs@^7.8.1: + version "7.8.1" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.8.1.tgz#6f6f3d99ea8044291efd92e7c7fcf562c4057543" + integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== + dependencies: + tslib "^2.1.0" + sade@^1.4.2: version "1.8.1" resolved "https://registry.yarnpkg.com/sade/-/sade-1.8.1.tgz#0a78e81d658d394887be57d2a409bf703a3b2701" @@ -12009,6 +12524,11 @@ saxes@^3.1.9: dependencies: xmlchars "^2.1.1" +scale-ts@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/scale-ts/-/scale-ts-1.6.0.tgz#e9641093c5a9e50f964ddb1607139034e3e932e9" + integrity sha512-Ja5VCjNZR8TGKhUumy9clVVxcDpM+YFjAnkMuwQy68Hixio3VRRvWdE3g8T/yC+HXA0ZDQl2TGyUmtmbcVl40Q== + scrypt-js@2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.4.tgz#32f8c5149f0797672e551c07e230f834b6af5f16" @@ -12326,6 +12846,13 @@ slice-ansi@^4.0.0: astral-regex "^2.0.0" is-fullwidth-code-point "^3.0.0" +smoldot@2.0.22: + version "2.0.22" + resolved "https://registry.yarnpkg.com/smoldot/-/smoldot-2.0.22.tgz#1e924d2011a31c57416e79a2b97a460f462a31c7" + integrity sha512-B50vRgTY6v3baYH6uCgL15tfaag5tcS2o/P5q1OiXcKGv1axZDfz2dzzMuIkVpyMR2ug11F6EAtQlmYBQd292g== + dependencies: + ws "^8.8.1" + snake-case@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-2.1.0.tgz#41bdb1b73f30ec66a04d4e2cad1b76387d4d6d9f" @@ -13200,6 +13727,11 @@ tslib@^2.0.3, tslib@^2.3.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== +tslib@^2.1.0, tslib@^2.6.2: + version "2.6.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0" + integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ== + tsort@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/tsort/-/tsort-0.0.1.tgz#e2280f5e817f8bf4275657fd0f9aebd44f5a2786" @@ -13642,6 +14174,11 @@ wcwidth@^1.0.1: dependencies: defaults "^1.0.3" +web-streams-polyfill@^3.0.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz#2073b91a2fdb1fbfbd401e7de0ac9f8214cecb4b" + integrity sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw== + web3-bzz@1.2.11: version "1.2.11" resolved "https://registry.yarnpkg.com/web3-bzz/-/web3-bzz-1.2.11.tgz#41bc19a77444bd5365744596d778b811880f707f" @@ -14604,6 +15141,11 @@ ws@^7.0.0, ws@^7.4.6: resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.8.tgz#ac2729881ab9e7cbaf8787fe3469a48c5c7f636a" integrity sha512-ri1Id1WinAX5Jqn9HejiGb8crfRio0Qgu8+MtL36rlTA6RLsMdWt1Az/19A2Qij6uSHUMphEFaTKa4WG+UNHNw== +ws@^8.16.0, ws@^8.8.1: + version "8.18.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" + integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== + ws@^8.2.2: version "8.8.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.8.0.tgz#8e71c75e2f6348dbf8d78005107297056cb77769" From 44b4f2566ac1d5f97faf93c7d4dcaaaa8395c5ec Mon Sep 17 00:00:00 2001 From: Nimish Agrawal Date: Fri, 9 Aug 2024 04:21:07 +0530 Subject: [PATCH 03/14] feat: implement fetchRecord --- packages/gateway/src/azero-id.ts | 35 ++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/packages/gateway/src/azero-id.ts b/packages/gateway/src/azero-id.ts index 5b98ce2..fdf44e3 100644 --- a/packages/gateway/src/azero-id.ts +++ b/packages/gateway/src/azero-id.ts @@ -41,13 +41,44 @@ export class AzeroId implements Database { return { addr: ZERO_ADDRESS, ttl: this.ttl }; } - text(name: string, key: string) { + async text(name: string, key: string) { console.log("text", name, key); - return { value: '', ttl: this.ttl }; + const value = await this.fetchRecord(name, key) || ''; + return { value, ttl: this.ttl }; } contenthash(name: string) { console.log("contenthash", name); return { contenthash: EMPTY_CONTENT_HASH, ttl: this.ttl }; } + + private async fetchRecord(name: string, key: string) { + name = this.processName(name); + const resp: any = await this.contract.query.getRecord( + '', + { + gasLimit: this.maxGasLimit + }, + name, + key + ); + + return resp.output?.toHuman().Ok.Ok; + } + + private processName(domain: string) { + // TODO: maybe add it as a class variable + const supportedTLDs = ['azero', 'tzero']; + const labels = domain.split('.'); + console.log("Labels:", labels); + + const name = labels.shift(); + if(labels.length != 0) { + const tld = labels.join('.'); + if (!supportedTLDs.includes(tld)) + throw new Error(`TLD (.${tld}) not supported`); + } + + return name || ''; + } } From 62101ab857cf796a6ee5057a3d083523a0cf4f80 Mon Sep 17 00:00:00 2001 From: Nimish Agrawal Date: Fri, 23 Aug 2024 04:27:32 +0530 Subject: [PATCH 04/14] fix: invalid signature length --- packages/gateway/src/server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gateway/src/server.ts b/packages/gateway/src/server.ts index ebd0be3..3a5dd43 100644 --- a/packages/gateway/src/server.ts +++ b/packages/gateway/src/server.ts @@ -114,7 +114,7 @@ export function makeServer(signer: ethers.utils.SigningKey, db: Database) { ] ); const sig = signer.signDigest(messageHash); - const sigData = hexConcat([sig.r, sig._vs]); + const sigData = hexConcat([sig.r, sig.s, ethers.utils.hexlify(sig.v)]); return [result, validUntil, sigData]; }, }, From 7c7ac47be0d72adef9321fcbdf73bf25f3e40908 Mon Sep 17 00:00:00 2001 From: Nimish Agrawal Date: Wed, 28 Aug 2024 02:39:25 +0530 Subject: [PATCH 05/14] feat: make OffchainResolver state variables updatable --- .../contracts/contracts/OffchainResolver.sol | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/contracts/contracts/OffchainResolver.sol b/packages/contracts/contracts/OffchainResolver.sol index 42df5b1..bad08f9 100644 --- a/packages/contracts/contracts/OffchainResolver.sol +++ b/packages/contracts/contracts/OffchainResolver.sol @@ -1,6 +1,7 @@ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; +import "@openzeppelin/contracts/access/Ownable.sol"; import "@ensdomains/ens-contracts/contracts/resolvers/SupportsInterface.sol"; import "./IExtendedResolver.sol"; import "./SignatureVerifier.sol"; @@ -13,11 +14,12 @@ interface IResolverService { * Implements an ENS resolver that directs all queries to a CCIP read gateway. * Callers must implement EIP 3668 and ENSIP 10. */ -contract OffchainResolver is IExtendedResolver, SupportsInterface { +contract OffchainResolver is Ownable, IExtendedResolver, SupportsInterface { string public url; mapping(address=>bool) public signers; event NewSigners(address[] signers); + event SignersRemoved(address[] signers); error OffchainLookup(address sender, string[] urls, bytes callData, bytes4 callbackFunction, bytes extraData); constructor(string memory _url, address[] memory _signers) { @@ -28,6 +30,24 @@ contract OffchainResolver is IExtendedResolver, SupportsInterface { emit NewSigners(_signers); } + function setUrl(string calldata _url) external onlyOwner { + url = _url; + } + + function addSigners(address[] calldata _signers) external onlyOwner { + for(uint i = 0; i < _signers.length; i++) { + signers[_signers[i]] = true; + } + emit NewSigners(_signers); + } + + function removeSigners(address[] calldata _signers) external onlyOwner { + for(uint i = 0; i < _signers.length; i++) { + signers[_signers[i]] = false; + } + emit SignersRemoved(_signers); + } + function makeSignatureHash(address target, uint64 expires, bytes memory request, bytes memory result) external pure returns(bytes32) { return SignatureVerifier.makeSignatureHash(target, expires, request, result); } From 4bacf0670447140e5f1f51da8d2fe088dd8b1b24 Mon Sep 17 00:00:00 2001 From: Nimish Agrawal Date: Wed, 4 Sep 2024 14:00:06 +0530 Subject: [PATCH 06/14] chore(scripts): clean the code --- packages/contracts/hardhat.config.js | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/packages/contracts/hardhat.config.js b/packages/contracts/hardhat.config.js index 82fe413..43e76dc 100644 --- a/packages/contracts/hardhat.config.js +++ b/packages/contracts/hardhat.config.js @@ -6,17 +6,10 @@ require('hardhat-deploy'); require('hardhat-deploy-ethers'); real_accounts = undefined; -if (process.env.DEPLOYER_KEY && process.env.OWNER_KEY) { - real_accounts = [process.env.OWNER_KEY, process.env.DEPLOYER_KEY]; -} -const gatewayurl = - 'https://offchain-resolver-example.uc.r.appspot.com/{sender}/{data}.json'; - -let devgatewayurl = 'http://localhost:8080/{sender}/{data}.json'; -if (process.env.REMOTE_GATEWAY) { - devgatewayurl = - `${process.env.REMOTE_GATEWAY}/{sender}/{data}.json`; +if (process.env.DEPLOYER_KEY) { + real_accounts = [process.env.DEPLOYER_KEY]; } +const gatewayurl = process.env.REMOTE_GATEWAY || 'http://localhost:8080/'; /** * @type import('hardhat/config').HardhatUserConfig */ @@ -26,7 +19,7 @@ module.exports = { networks: { hardhat: { throwOnCallFailures: false, - gatewayurl: devgatewayurl, + gatewayurl, }, ropsten: { url: `https://ropsten.infura.io/v3/${process.env.INFURA_ID}`, @@ -61,11 +54,11 @@ module.exports = { apiKey: process.env.ETHERSCAN_API_KEY, }, namedAccounts: { - signer: { - default: '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266', - }, deployer: { - default: 1, + default: 0, + }, + signer: { + default: process.env.SIGNER_ADDR, }, }, }; From d73317523b7c94e4987ec9c3fabfa220256e0061 Mon Sep 17 00:00:00 2001 From: Nimish Agrawal Date: Wed, 4 Sep 2024 14:00:36 +0530 Subject: [PATCH 07/14] feat(scripts): add sepolia network --- packages/contracts/hardhat.config.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/contracts/hardhat.config.js b/packages/contracts/hardhat.config.js index 43e76dc..1e18917 100644 --- a/packages/contracts/hardhat.config.js +++ b/packages/contracts/hardhat.config.js @@ -42,6 +42,13 @@ module.exports = { accounts: real_accounts, gatewayurl, }, + sepolia: { + url: `https://sepolia.infura.io/v3/${process.env.INFURA_ID}`, + tags: ['test', 'demo'], + chainId: 11155111, + accounts: real_accounts, + gatewayurl, + }, mainnet: { url: `https://mainnet.infura.io/v3/${process.env.INFURA_ID}`, tags: ['demo'], From 675e5c0b649b4bc2e0c5c308463f53325002c47d Mon Sep 17 00:00:00 2001 From: Nimish Agrawal Date: Wed, 4 Sep 2024 14:05:35 +0530 Subject: [PATCH 08/14] feat(scripts): add support of dotenv --- packages/contracts/.env.example | 5 +++++ packages/contracts/hardhat.config.js | 1 + packages/contracts/package.json | 1 + yarn.lock | 5 +++++ 4 files changed, 12 insertions(+) create mode 100644 packages/contracts/.env.example diff --git a/packages/contracts/.env.example b/packages/contracts/.env.example new file mode 100644 index 0000000..4b93bdb --- /dev/null +++ b/packages/contracts/.env.example @@ -0,0 +1,5 @@ +REMOTE_GATEWAY= +DEPLOYER_KEY= +SIGNER_ADDR= +INFURA_ID= +ETHERSCAN_API_KEY= diff --git a/packages/contracts/hardhat.config.js b/packages/contracts/hardhat.config.js index 1e18917..48a271d 100644 --- a/packages/contracts/hardhat.config.js +++ b/packages/contracts/hardhat.config.js @@ -4,6 +4,7 @@ require('@nomiclabs/hardhat-ethers'); require('@nomiclabs/hardhat-waffle'); require('hardhat-deploy'); require('hardhat-deploy-ethers'); +require('dotenv').config(); real_accounts = undefined; if (process.env.DEPLOYER_KEY) { diff --git a/packages/contracts/package.json b/packages/contracts/package.json index aa2374f..52cd4d0 100644 --- a/packages/contracts/package.json +++ b/packages/contracts/package.json @@ -29,6 +29,7 @@ "dependencies": { "@ensdomains/ens-contracts": "^0.0.8", "@nomiclabs/hardhat-etherscan": "^3.0.0", + "dotenv": "^16.4.5", "hardhat-deploy-ethers": "^0.3.0-beta.13" } } diff --git a/yarn.lock b/yarn.lock index 97ab442..edc6c08 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6192,6 +6192,11 @@ dotenv@^15.0.0: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-15.0.1.tgz#bf96a46782923e17a64b5edb35eb50d2292efd65" integrity sha512-4OnbwRfzR+xQThp7uq1xpUS9fmgZ//njexOtPjPSbK3yHGrSHSJnaJRsXderSSm2elfvVj+Y5awDC0I8Oy8rkA== +dotenv@^16.4.5: + version "16.4.5" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.5.tgz#cdd3b3b604cb327e286b4762e13502f717cb099f" + integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg== + dotignore@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/dotignore/-/dotignore-0.1.2.tgz#f942f2200d28c3a76fbdd6f0ee9f3257c8a2e905" From e18f6c0f0554ea9f7e5e8b0d8ec51b5a6086f5cc Mon Sep 17 00:00:00 2001 From: Nimish Agrawal Date: Wed, 4 Sep 2024 14:30:58 +0530 Subject: [PATCH 09/14] feat(scripts): add deployment script & instructions --- packages/contracts/README.md | 27 +++++++++++++++++++++++++++ packages/contracts/deploy.sh | 11 +++++++++++ 2 files changed, 38 insertions(+) create mode 100755 packages/contracts/deploy.sh diff --git a/packages/contracts/README.md b/packages/contracts/README.md index b0a2b72..987c08e 100644 --- a/packages/contracts/README.md +++ b/packages/contracts/README.md @@ -16,3 +16,30 @@ This library facilitates checking signatures over CCIP read responses. ### [OffchainResolver.sol](contracts/OffchainResolver.sol) This contract implements the offchain resolution system. Set this contract as the resolver for a name, and that name and all its subdomains that are not present in the ENS registry will be resolved via the provided gateway by supported clients. + +## Deployment instruction + +1. Set the following env variables: + + * *REMOTE_GATEWAY* + The target url (default: localhost:8080) + + * *DEPLOYER_KEY* (*mandatory) + The private key use to deploy the contract (also the contract owner) + + * *SIGNER_KEY* (*mandatory) + The public key which is approved as the trusted signer + + * *INFURA_ID* + API key for network provider + + * *ETHERSCAN_API_KEY* + + * *NETWORK* + The target network (default: sepolia) + +2. Run the following command + +```bash +./deploy.sh +``` \ No newline at end of file diff --git a/packages/contracts/deploy.sh b/packages/contracts/deploy.sh new file mode 100755 index 0000000..4d7c8f5 --- /dev/null +++ b/packages/contracts/deploy.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -eu + +# Can only be overwritten from the .env file, not from the command line! +NETWORK=sepolia + +# Load .env +source .env + +# Deploy OffchainResolver +npx hardhat --network $NETWORK deploy --tags demo \ No newline at end of file From d8727c6ac6c5727f05d571b1b16ba7dcee6dbd67 Mon Sep 17 00:00:00 2001 From: Nimish Agrawal Date: Thu, 5 Sep 2024 02:31:17 +0530 Subject: [PATCH 10/14] feat: implement `addr` --- packages/gateway/src/azero-id.ts | 47 ++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/packages/gateway/src/azero-id.ts b/packages/gateway/src/azero-id.ts index fdf44e3..1ca9352 100644 --- a/packages/gateway/src/azero-id.ts +++ b/packages/gateway/src/azero-id.ts @@ -36,9 +36,27 @@ export class AzeroId implements Database { ); } - addr(name: string, coinType: number) { + async addr(name: string, coinType: number) { console.log("addr", name, coinType); - return { addr: ZERO_ADDRESS, ttl: this.ttl }; + + let value; + if (coinType == 643) { + // AlephZero + value = await this.fetchA0ResolverAddress(name); + } else { + let alias = AzeroId.getAlias(""+coinType); + if (alias !== undefined) { + const serviceKey = "address." + alias; + value = await this.fetchRecord(name, serviceKey); + } + if (value === undefined) { + const serviceKey = "address." + coinType; + value = await this.fetchRecord(name, serviceKey); + } + } + + value = value ?? (coinType == 60? ZERO_ADDRESS:'0x'); + return { addr: value, ttl: this.ttl }; } async text(name: string, key: string) { @@ -66,6 +84,19 @@ export class AzeroId implements Database { return resp.output?.toHuman().Ok.Ok; } + private async fetchA0ResolverAddress(name: string) { + name = this.processName(name); + const resp: any = await this.contract.query.getAddress( + '', + { + gasLimit: this.maxGasLimit + }, + name + ); + + return resp.output?.toHuman().Ok.Ok; + } + private processName(domain: string) { // TODO: maybe add it as a class variable const supportedTLDs = ['azero', 'tzero']; @@ -81,4 +112,16 @@ export class AzeroId implements Database { return name || ''; } + + static getAlias(coinType: string) { + const alias = new Map([ + ['0', 'btc'], + ['60', 'eth'], + ['354', 'dot'], + ['434', 'ksm'], + ['501', 'sol'], + ]); + + return alias.get(coinType); + } } From a8d5aea0d330e082f5d25fee1104dfd3b9bea9f7 Mon Sep 17 00:00:00 2001 From: Nimish Agrawal Date: Thu, 5 Sep 2024 19:34:59 +0530 Subject: [PATCH 11/14] feat: pass binary-encoded value of address --- packages/gateway/package.json | 1 + packages/gateway/src/azero-id.ts | 36 +++++++++++++++++++++++++++++--- yarn.lock | 21 +++++++++++++++++++ 3 files changed, 55 insertions(+), 3 deletions(-) diff --git a/packages/gateway/package.json b/packages/gateway/package.json index 4e3b47f..eb5d33c 100644 --- a/packages/gateway/package.json +++ b/packages/gateway/package.json @@ -58,6 +58,7 @@ "dependencies": { "@chainlink/ccip-read-server": "^0.2.1", "@chainlink/ethers-ccip-read-provider": "^0.2.3", + "@ensdomains/address-encoder": "^1.1.2", "@ensdomains/ens-contracts": "^0.0.8", "@ensdomains/offchain-resolver-contracts": "^0.2.1", "@polkadot/api": "^12.3.1", diff --git a/packages/gateway/src/azero-id.ts b/packages/gateway/src/azero-id.ts index 1ca9352..1257d4a 100644 --- a/packages/gateway/src/azero-id.ts +++ b/packages/gateway/src/azero-id.ts @@ -3,7 +3,11 @@ import { ApiPromise, WsProvider } from '@polkadot/api'; import { Database } from './server'; import { ContractPromise } from '@polkadot/api-contract'; import type { WeightV2 } from '@polkadot/types/interfaces'; +import { getCoderByCoinType } from "@ensdomains/address-encoder"; +import { createDotAddressDecoder } from '@ensdomains/address-encoder/utils' +import { hexlify } from 'ethers/lib/utils'; +const AZERO_COIN_TYPE = 643; const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'; const EMPTY_CONTENT_HASH = '0x'; @@ -37,11 +41,11 @@ export class AzeroId implements Database { } async addr(name: string, coinType: number) { + coinType = Number(coinType); // convert BigNumber to number console.log("addr", name, coinType); let value; - if (coinType == 643) { - // AlephZero + if (coinType == AZERO_COIN_TYPE) { value = await this.fetchA0ResolverAddress(name); } else { let alias = AzeroId.getAlias(""+coinType); @@ -55,7 +59,12 @@ export class AzeroId implements Database { } } - value = value ?? (coinType == 60? ZERO_ADDRESS:'0x'); + if (value === undefined) { + value = coinType == 60? ZERO_ADDRESS:'0x'; + } else { + value = AzeroId.encodeAddress(value, coinType); + } + return { addr: value, ttl: this.ttl }; } @@ -124,4 +133,25 @@ export class AzeroId implements Database { return alias.get(coinType); } + + static encodeAddress(addr: string, coinType: number) { + const isEvmCoinType = (c: number) => { + return c == 60 || (c & 0x80000000)!=0 + } + + if (coinType == AZERO_COIN_TYPE) { + const azeroCoder = createDotAddressDecoder(42); + return hexlify(azeroCoder(addr)); + } + if (isEvmCoinType(coinType) && !addr.startsWith('0x')) { + addr = '0x' + addr; + } + + try { + const coder = getCoderByCoinType(coinType); + return hexlify(coder.decode(addr)); + } catch { + return addr; + } + } } diff --git a/yarn.lock b/yarn.lock index edc6c08..75711ab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -994,6 +994,15 @@ nano-base32 "^1.0.1" ripemd160 "^2.0.2" +"@ensdomains/address-encoder@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@ensdomains/address-encoder/-/address-encoder-1.1.2.tgz#29bb2346f4da21f8e2f7f05a4755d9ccd3ecab6e" + integrity sha512-x+uUZbtvtWDh23dLH/U//re0s9v341tFB6SJeUElkQ31O3jkoUh3jvgnx+NxiohWW6JWW6QrXS4kigxuvwbi2A== + dependencies: + "@noble/curves" "^1.2.0" + "@noble/hashes" "^1.3.2" + "@scure/base" "^1.1.5" + "@ensdomains/buffer@^0.0.13": version "0.0.13" resolved "https://registry.yarnpkg.com/@ensdomains/buffer/-/buffer-0.0.13.tgz#b9f60defb78fc5f2bee30faca17e63dfbef19253" @@ -2235,6 +2244,13 @@ undici "5.5.1" ws "^8.2.2" +"@noble/curves@^1.2.0": + version "1.6.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.6.0.tgz#be5296ebcd5a1730fccea4786d420f87abfeb40b" + integrity sha512-TlaHRXDehJuRNR9TfZDNQ45mMEd5dwUwmicsafcIX4SsNiqnCHKjE/1alYPd/lDRVhxdhUAlv8uEhMCI5zjIJQ== + dependencies: + "@noble/hashes" "1.5.0" + "@noble/curves@^1.3.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.5.0.tgz#7a9b9b507065d516e6dce275a1e31db8d2a100dd" @@ -2252,6 +2268,11 @@ resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426" integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg== +"@noble/hashes@1.5.0", "@noble/hashes@^1.3.2": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.5.0.tgz#abadc5ca20332db2b1b2aa3e496e9af1213570b0" + integrity sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA== + "@noble/hashes@~1.1.1": version "1.1.3" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.3.tgz#360afc77610e0a61f3417e497dcf36862e4f8111" From a87c4c279ce382dcd56f039c534248c3c8ad85e8 Mon Sep 17 00:00:00 2001 From: Nimish Agrawal Date: Sat, 7 Sep 2024 00:49:35 +0530 Subject: [PATCH 12/14] feat: make supportedTLDs as class variable with its individual target contracts --- packages/gateway/src/azero-id.ts | 44 +++++++++++++++++--------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/packages/gateway/src/azero-id.ts b/packages/gateway/src/azero-id.ts index 1257d4a..c86ab27 100644 --- a/packages/gateway/src/azero-id.ts +++ b/packages/gateway/src/azero-id.ts @@ -18,24 +18,29 @@ export interface GasLimit { export class AzeroId implements Database { ttl: number; - contract: ContractPromise; + tldToContract: Map; maxGasLimit: WeightV2; - constructor(ttl: number, contract: ContractPromise, maxGasLimit: WeightV2) { + constructor(ttl: number, tldToContract: Map, maxGasLimit: WeightV2) { this.ttl = ttl; - this.contract = contract; + this.tldToContract = tldToContract; this.maxGasLimit = maxGasLimit; } - static async init(ttl: number, providerURL: string, contractAddress: string, gasLimit: GasLimit) { + static async init(ttl: number, providerURL: string, tldToContractAddress: Map, gasLimit: GasLimit) { const wsProvider = new WsProvider(providerURL); const api = await ApiPromise.create({ provider: wsProvider }); - const contract = new ContractPromise(api, abi, contractAddress); + + const tldToContract = new Map(); + tldToContractAddress.forEach((addr, tld) => { + tldToContract.set(tld, new ContractPromise(api, abi, addr)) + }) + const maxGasLimit = api.registry.createType('WeightV2', gasLimit) as WeightV2; return new AzeroId( ttl, - contract, + tldToContract, maxGasLimit, ); } @@ -79,9 +84,9 @@ export class AzeroId implements Database { return { contenthash: EMPTY_CONTENT_HASH, ttl: this.ttl }; } - private async fetchRecord(name: string, key: string) { - name = this.processName(name); - const resp: any = await this.contract.query.getRecord( + private async fetchRecord(domain: string, key: string) { + let {name, contract} = this.processName(domain); + const resp: any = await contract.query.getRecord( '', { gasLimit: this.maxGasLimit @@ -93,9 +98,9 @@ export class AzeroId implements Database { return resp.output?.toHuman().Ok.Ok; } - private async fetchA0ResolverAddress(name: string) { - name = this.processName(name); - const resp: any = await this.contract.query.getAddress( + private async fetchA0ResolverAddress(domain: string) { + let {name, contract} = this.processName(domain); + const resp: any = await contract.query.getAddress( '', { gasLimit: this.maxGasLimit @@ -107,19 +112,18 @@ export class AzeroId implements Database { } private processName(domain: string) { - // TODO: maybe add it as a class variable - const supportedTLDs = ['azero', 'tzero']; const labels = domain.split('.'); console.log("Labels:", labels); - const name = labels.shift(); - if(labels.length != 0) { - const tld = labels.join('.'); - if (!supportedTLDs.includes(tld)) - throw new Error(`TLD (.${tld}) not supported`); + const name = labels.shift() || ''; + const tld = labels.join('.'); + const contract = this.tldToContract.get(tld); + + if (contract === undefined) { + throw new Error(`TLD (.${tld}) not supported`); } - return name || ''; + return {name, contract}; } static getAlias(coinType: string) { From 0ab2665d0f87f8a1152bc622b0949ad0c7bc053b Mon Sep 17 00:00:00 2001 From: Nimish Agrawal Date: Sat, 7 Sep 2024 00:50:44 +0530 Subject: [PATCH 13/14] feat: read supported-tld from json file --- packages/gateway/src/index.ts | 7 +++++-- packages/gateway/src/supported-tlds.json | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 packages/gateway/src/supported-tlds.json diff --git a/packages/gateway/src/index.ts b/packages/gateway/src/index.ts index 6e27e8a..8aad458 100644 --- a/packages/gateway/src/index.ts +++ b/packages/gateway/src/index.ts @@ -3,6 +3,8 @@ import { Command } from 'commander'; import { readFileSync } from 'fs'; import { ethers } from 'ethers'; import { AzeroId, GasLimit } from './azero-id'; +import supportedTLDs from './supported-tlds.json'; + const program = new Command(); program .requiredOption( @@ -10,7 +12,6 @@ program 'Private key to sign responses with. Prefix with @ to read from a file' ) .option('--provider-url ', 'Provider URL of the substrate chain', 'wss://ws.test.azero.dev') - .option('-c --contract ', 'Target contract address', '5FsB91tXSEuMj6akzdPczAtmBaVKToqHmtAwSUzXh49AYzaD') .option('-t --ttl ', 'TTL for signatures', '300') .option('-p --port ', 'Port number to serve on', '8080'); program.parse(process.argv); @@ -30,10 +31,12 @@ const defaultGasLimit: GasLimit = { proofSize: 1_000_000, }; +const tldToContractAddress = new Map(Object.entries(supportedTLDs)); + AzeroId.init( parseInt(options.ttl), options.providerUrl, - options.contract, + tldToContractAddress, defaultGasLimit, ).then(db => { const app = makeApp(signer, '/', db); diff --git a/packages/gateway/src/supported-tlds.json b/packages/gateway/src/supported-tlds.json new file mode 100644 index 0000000..f815329 --- /dev/null +++ b/packages/gateway/src/supported-tlds.json @@ -0,0 +1,5 @@ +{ + "azero": "5CTQBfBC9SfdrCDBJdfLiyW2pg9z5W6C6Es8sK313BLnFgDf", + "tzero": "5FsB91tXSEuMj6akzdPczAtmBaVKToqHmtAwSUzXh49AYzaD", + "eth": "5FsB91tXSEuMj6akzdPczAtmBaVKToqHmtAwSUzXh49AYzaD" +} \ No newline at end of file From 118c9d5d4c3cf0cb4fd0d9c13d815536c076b878 Mon Sep 17 00:00:00 2001 From: Nimish Agrawal Date: Sat, 7 Sep 2024 01:11:41 +0530 Subject: [PATCH 14/14] docs: add instruction on customisation --- packages/contracts/.env.example | 1 + packages/gateway/README.md | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/contracts/.env.example b/packages/contracts/.env.example index 4b93bdb..e902b19 100644 --- a/packages/contracts/.env.example +++ b/packages/contracts/.env.example @@ -1,3 +1,4 @@ +NETWORK=sepolia REMOTE_GATEWAY= DEPLOYER_KEY= SIGNER_ADDR= diff --git a/packages/gateway/README.md b/packages/gateway/README.md index 074677d..1bcd15c 100644 --- a/packages/gateway/README.md +++ b/packages/gateway/README.md @@ -6,12 +6,12 @@ You can run the gateway as a command line tool; in its default configuration it ``` yarn && yarn build -yarn start --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --data test.eth.json +yarn start --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --provider-url ``` `private-key` should be an Ethereum private key that will be used to sign messages. You should configure your resolver contract to expect messages to be signed using the corresponding address. -`data` is the path to the data file; an example file is provided in `test.eth.json`. +`` is the websocket endpoint of the target substrate chain (default: wss://ws.test.azero.dev) ## Customisation The JSON backend is implemented in [json.ts](src/json.ts), and implements the `Database` interface from [server.ts](src/server.ts). You can replace this with your own database service by implementing the methods provided in that interface. If a record does not exist, you should return the zero value for that type - for example, requests for nonexistent text records should be responded to with the empty string, and requests for nonexistent addresses should be responded to with the all-zero address. @@ -25,3 +25,6 @@ const db = JSONDatabase.fromFilename(options.data, parseInt(options.ttl)); const app = makeApp(signer, '/', db); app.listen(parseInt(options.port)); ``` + +## AZERO-ID implementation +The AzeroId gateway implementation in [azero-id.ts](src/azero-id.ts) reads the state from the AZERO-ID registry contract on AlephZero network. [supported-tlds.json](src/supported-tlds.json) stores the TLDs mapped to their target registry. Update it as per need. \ No newline at end of file