UNPKG

@towns-protocol/generated

Version:

## How to generate contract types

336 lines (328 loc) 20.3 kB
/* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ import { Signer, utils, Contract, ContractFactory, Overrides } from "ethers"; import type { Provider, TransactionRequest } from "@ethersproject/providers"; import type { PromiseOrValue } from "../common"; import type { NodeRegistry, NodeRegistryInterface } from "../NodeRegistry"; const _abi = [ { type: "function", name: "getAllNodeAddresses", inputs: [], outputs: [ { name: "", type: "address[]", internalType: "address[]", }, ], stateMutability: "view", }, { type: "function", name: "getAllNodes", inputs: [], outputs: [ { name: "", type: "tuple[]", internalType: "struct Node[]", components: [ { name: "status", type: "uint8", internalType: "enum NodeStatus", }, { name: "url", type: "string", internalType: "string", }, { name: "nodeAddress", type: "address", internalType: "address", }, { name: "operator", type: "address", internalType: "address", }, ], }, ], stateMutability: "view", }, { type: "function", name: "getNode", inputs: [ { name: "nodeAddress", type: "address", internalType: "address", }, ], outputs: [ { name: "", type: "tuple", internalType: "struct Node", components: [ { name: "status", type: "uint8", internalType: "enum NodeStatus", }, { name: "url", type: "string", internalType: "string", }, { name: "nodeAddress", type: "address", internalType: "address", }, { name: "operator", type: "address", internalType: "address", }, ], }, ], stateMutability: "view", }, { type: "function", name: "getNodeCount", inputs: [], outputs: [ { name: "", type: "uint256", internalType: "uint256", }, ], stateMutability: "view", }, { type: "function", name: "isNode", inputs: [ { name: "nodeAddress", type: "address", internalType: "address", }, ], outputs: [ { name: "", type: "bool", internalType: "bool", }, ], stateMutability: "view", }, { type: "function", name: "registerNode", inputs: [ { name: "nodeAddress", type: "address", internalType: "address", }, { name: "url", type: "string", internalType: "string", }, { name: "status", type: "uint8", internalType: "enum NodeStatus", }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "removeNode", inputs: [ { name: "nodeAddress", type: "address", internalType: "address", }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "updateNodeStatus", inputs: [ { name: "nodeAddress", type: "address", internalType: "address", }, { name: "status", type: "uint8", internalType: "enum NodeStatus", }, ], outputs: [], stateMutability: "nonpayable", }, { type: "function", name: "updateNodeUrl", inputs: [ { name: "nodeAddress", type: "address", internalType: "address", }, { name: "url", type: "string", internalType: "string", }, ], outputs: [], stateMutability: "nonpayable", }, { type: "event", name: "NodeAdded", inputs: [ { name: "nodeAddress", type: "address", indexed: true, internalType: "address", }, { name: "operator", type: "address", indexed: true, internalType: "address", }, { name: "url", type: "string", indexed: false, internalType: "string", }, { name: "status", type: "uint8", indexed: false, internalType: "enum NodeStatus", }, ], anonymous: false, }, { type: "event", name: "NodeRemoved", inputs: [ { name: "nodeAddress", type: "address", indexed: true, internalType: "address", }, ], anonymous: false, }, { type: "event", name: "NodeStatusUpdated", inputs: [ { name: "nodeAddress", type: "address", indexed: true, internalType: "address", }, { name: "status", type: "uint8", indexed: false, internalType: "enum NodeStatus", }, ], anonymous: false, }, { type: "event", name: "NodeUrlUpdated", inputs: [ { name: "nodeAddress", type: "address", indexed: true, internalType: "address", }, { name: "url", type: "string", indexed: false, internalType: "string", }, ], anonymous: false, }, ] as const; const _bytecode = "0x6080604052348015600e575f5ffd5b506119ba8061001c5f395ff3fe608060405234801561000f575f5ffd5b506004361061009f575f3560e01c80639d20904811610072578063b2b99ec911610058578063b2b99ec914610168578063c8fe3a011461017b578063eecc66f414610190575f5ffd5b80639d20904814610133578063a1174e7d14610153575f5ffd5b806301750152146100a357806339bf397e146100f5578063581f8b9b1461010b5780637e4465e714610120575b5f5ffd5b6100e06100b1366004611294565b73ffffffffffffffffffffffffffffffffffffffff9081165f9081526007602052604090206002015416151590565b60405190151581526020015b60405180910390f35b6100fd6101a3565b6040519081526020016100ec565b61011e6101193660046112bb565b6101b3565b005b61011e61012e3660046113e1565b6103b4565b610146610141366004611294565b6105f8565b6040516100ec919061154f565b61015b610790565b6040516100ec9190611561565b61011e610176366004611294565b61097d565b610183610bbc565b6040516100ec91906115e2565b61011e61019e36600461163a565b610bc8565b5f6101ae6005610e04565b905090565b73ffffffffffffffffffffffffffffffffffffffff8083165f90815260076020526040902060020154839116610221576102216040518060400160405280600e81526020017f4e4f44455f4e4f545f464f554e44000000000000000000000000000000000000815250610e13565b3361022d600882610e36565b61026f5761026f6040518060400160405280600881526020017f4241445f41555448000000000000000000000000000000000000000000000000815250610e13565b73ffffffffffffffffffffffffffffffffffffffff8085165f90815260076020526040902060030154859133911681146102e1576102e16040518060400160405280600881526020017f4241445f41555448000000000000000000000000000000000000000000000000815250610e13565b73ffffffffffffffffffffffffffffffffffffffff86165f90815260076020526040902080546103149060ff1687610e67565b8054869082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660018360058111156103505761035061142c565b0217905550600281015460405173ffffffffffffffffffffffffffffffffffffffff909116907f20891cc7622c7951cbd8c70c61a5201eb45625b8c00e8f6c986cfca78f3dbfa0906103a3908990611694565b60405180910390a250505050505050565b336103c0600882610e36565b610402576104026040518060400160405280600881526020017f4241445f41555448000000000000000000000000000000000000000000000000815250610e13565b73ffffffffffffffffffffffffffffffffffffffff8084165f90815260076020526040902060020154849116610470576104706040518060400160405280600e81526020017f4e4f44455f4e4f545f464f554e44000000000000000000000000000000000000815250610e13565b73ffffffffffffffffffffffffffffffffffffffff8085165f90815260076020526040902060030154859133911681146104e2576104e26040518060400160405280600881526020017f4241445f41555448000000000000000000000000000000000000000000000000815250610e13565b73ffffffffffffffffffffffffffffffffffffffff86165f908152600760209081526040918290209151610518918891016116a2565b60405160208183030381529060405280519060200120816001016040516020016105429190611703565b604051602081830303815290604052805190602001200361059b5761059b6040518060400160405280600781526020017f4241445f41524700000000000000000000000000000000000000000000000000815250610e13565b600181016105a987826117de565b50600281015460405173ffffffffffffffffffffffffffffffffffffffff909116907f4505168a8705a16fd4d0575197fd0f510db69df93a065e158ad2c0957ba12bac906103a39089906118f5565b6106216040805160808101909152805f81526060602082018190525f6040830181905291015290565b61062c600583610e36565b61066e5761066e6040518060400160405280600e81526020017f4e4f44455f4e4f545f464f554e44000000000000000000000000000000000000815250610e13565b73ffffffffffffffffffffffffffffffffffffffff82165f90815260076020526040908190208151608081019092528054829060ff1660058111156106b5576106b561142c565b60058111156106c6576106c661142c565b81526020016001820180546106da906116b8565b80601f0160208091040260200160405190810160405280929190818152602001828054610706906116b8565b80156107515780601f1061072857610100808354040283529160200191610751565b820191905f5260205f20905b81548152906001019060200180831161073457829003601f168201915b5050509183525050600282015473ffffffffffffffffffffffffffffffffffffffff908116602083015260039092015490911660409091015292915050565b60605f61079d6005610e04565b67ffffffffffffffff8111156107b5576107b56112ec565b60405190808252806020026020018201604052801561080f57816020015b6107fc6040805160808101909152805f81526060602082018190525f6040830181905291015290565b8152602001906001900390816107d35790505b5090505f5b61081e6005610e04565b8110156109775760075f610833600584611013565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260409081015f208151608081019092528054829060ff16600581111561087b5761087b61142c565b600581111561088c5761088c61142c565b81526020016001820180546108a0906116b8565b80601f01602080910402602001604051908101604052809291908181526020018280546108cc906116b8565b80156109175780601f106108ee57610100808354040283529160200191610917565b820191905f5260205f20905b8154815290600101906020018083116108fa57829003601f168201915b5050509183525050600282015473ffffffffffffffffffffffffffffffffffffffff9081166020830152600390920154909116604090910152825183908390811061096457610964611907565b6020908102919091010152600101610814565b50919050565b73ffffffffffffffffffffffffffffffffffffffff8082165f90815260076020526040902060030154829133911681146109ef576109ef6040518060400160405280600881526020017f4241445f41555448000000000000000000000000000000000000000000000000815250610e13565b73ffffffffffffffffffffffffffffffffffffffff8381165f9081526007602052604090206002015416610a5b57610a5b6040518060400160405280600e81526020017f4e4f44455f4e4f545f464f554e44000000000000000000000000000000000000815250610e13565b600573ffffffffffffffffffffffffffffffffffffffff84165f9081526007602052604090205460ff166005811115610a9657610a9661142c565b14610ad957610ad96040518060400160405280601681526020017f4e4f44455f53544154455f4e4f545f414c4c4f57454400000000000000000000815250610e13565b610ae460058461101e565b5073ffffffffffffffffffffffffffffffffffffffff83165f90815260076020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016815590610b3d600183018261121a565b506002810180547fffffffffffffffffffffffff000000000000000000000000000000000000000090811690915560039091018054909116905560405173ffffffffffffffffffffffffffffffffffffffff8416907fcfc24166db4bb677e857cacabd1541fb2b30645021b27c5130419589b84db52b905f90a2505050565b60606101ae600561103f565b33610bd4600882610e36565b610c1657610c166040518060400160405280600881526020017f4241445f41555448000000000000000000000000000000000000000000000000815250610e13565b73ffffffffffffffffffffffffffffffffffffffff8481165f908152600760205260409020600201541615610c8357610c836040518060400160405280600e81526020017f414c52454144595f455849535453000000000000000000000000000000000000815250610e13565b5f6040518060800160405280846005811115610ca157610ca161142c565b81526020810186905273ffffffffffffffffffffffffffffffffffffffff87166040820152336060909101529050610cda60058661104b565b5073ffffffffffffffffffffffffffffffffffffffff85165f908152600760205260409020815181548392919082907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001836005811115610d3f57610d3f61142c565b021790555060208201516001820190610d5890826117de565b506040828101516002830180547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff938416179091556060909401516003909301805490941692811692909217909255905133918716907f759154d15a6aec80ceab7bc8820f46ebc53ad68bb18f47afb77483fea9dcc9ff90610df59088908890611934565b60405180910390a35050505050565b5f610e0d825490565b92915050565b6308c379a06040820352602080820352601f19601f825101166044810160248303fd5b73ffffffffffffffffffffffffffffffffffffffff81165f90815260018301602052604081205415155b9392505050565b5f826005811115610e7a57610e7a61142c565b1480610eea57506001826005811115610e9557610e9561142c565b148015610eea57506003816005811115610eb157610eb161142c565b1480610ece57506004816005811115610ecc57610ecc61142c565b145b80610eea57506002816005811115610ee857610ee861142c565b145b80610f3d57506002826005811115610f0457610f0461142c565b148015610f3d57506003816005811115610f2057610f2061142c565b1480610f3d57506004816005811115610f3b57610f3b61142c565b145b80610f9057506004826005811115610f5757610f5761142c565b148015610f9057506003816005811115610f7357610f7361142c565b1480610f9057506005816005811115610f8e57610f8e61142c565b145b80610fc857506003826005811115610faa57610faa61142c565b148015610fc857506005816005811115610fc657610fc661142c565b145b15610fd1575050565b61100f6040518060400160405280601681526020017f4e4f44455f53544154455f4e4f545f414c4c4f57454400000000000000000000815250610e13565b5050565b5f610e60838361106c565b5f610e608373ffffffffffffffffffffffffffffffffffffffff8416611092565b60605f610e6083611175565b5f610e608373ffffffffffffffffffffffffffffffffffffffff84166111ce565b5f825f01828154811061108157611081611907565b905f5260205f200154905092915050565b5f818152600183016020526040812054801561116c575f6110b4600183611955565b85549091505f906110c790600190611955565b9050808214611126575f865f0182815481106110e5576110e5611907565b905f5260205f200154905080875f01848154811061110557611105611907565b5f918252602080832090910192909255918252600188019052604090208390555b85548690806111375761113761198d565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f905560019350505050610e0d565b5f915050610e0d565b6060815f018054806020026020016040519081016040528092919081815260200182805480156111c257602002820191905f5260205f20905b8154815260200190600101908083116111ae575b50505050509050919050565b5f81815260018301602052604081205461121357508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155610e0d565b505f610e0d565b508054611226906116b8565b5f825580601f10611235575050565b601f0160209004905f5260205f20908101906112519190611254565b50565b5b80821115611268575f8155600101611255565b5090565b803573ffffffffffffffffffffffffffffffffffffffff8116811461128f575f5ffd5b919050565b5f602082840312156112a4575f5ffd5b610e608261126c565b80356006811061128f575f5ffd5b5f5f604083850312156112cc575f5ffd5b6112d58361126c565b91506112e3602084016112ad565b90509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f82601f830112611328575f5ffd5b813567ffffffffffffffff811115611342576113426112ec565b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8501160116810181811067ffffffffffffffff821117156113ae576113ae6112ec565b6040528181528382016020018510156113c5575f5ffd5b816020850160208301375f918101602001919091529392505050565b5f5f604083850312156113f2575f5ffd5b6113fb8361126c565b9150602083013567ffffffffffffffff811115611416575f5ffd5b61142285828601611319565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b6006811061148e577f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b9052565b5f81518084528060208401602086015e5f6020828601015260207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f83011685010191505092915050565b6114e9828251611459565b5f6020820151608060208501526115036080850182611492565b905073ffffffffffffffffffffffffffffffffffffffff604084015116604085015273ffffffffffffffffffffffffffffffffffffffff60608401511660608501528091505092915050565b602081525f610e6060208301846114de565b5f602082016020835280845180835260408501915060408160051b8601019250602086015f5b828110156115d6577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc08786030184526115c18583516114de565b94506020938401939190910190600101611587565b50929695505050505050565b602080825282518282018190525f918401906040840190835b8181101561162f57835173ffffffffffffffffffffffffffffffffffffffff168352602093840193909201916001016115fb565b509095945050505050565b5f5f5f6060848603121561164c575f5ffd5b6116558461126c565b9250602084013567ffffffffffffffff811115611670575f5ffd5b61167c86828701611319565b92505061168b604085016112ad565b90509250925092565b60208101610e0d8284611459565b5f82518060208501845e5f920191825250919050565b600181811c908216806116cc57607f821691505b602082108103610977577f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f5f8354611710816116b8565b600182168015611727576001811461175a57611787565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083168652811515820286019350611787565b865f5260205f205f5b8381101561177f57815488820152600190910190602001611763565b505081860193505b509195945050505050565b601f8211156117d957805f5260205f20601f840160051c810160208510156117b75750805b601f840160051c820191505b818110156117d6575f81556001016117c3565b50505b505050565b815167ffffffffffffffff8111156117f8576117f86112ec565b61180c8161180684546116b8565b84611792565b6020601f82116001811461185d575f83156118275750848201515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600385901b1c1916600184901b1784556117d6565b5f848152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08516915b828110156118aa578785015182556020948501946001909201910161188a565b50848210156118e657868401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600387901b60f8161c191681555b50505050600190811b01905550565b602081525f610e606020830184611492565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b604081525f6119466040830185611492565b9050610e606020830184611459565b81810381811115610e0d577f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603160045260245ffd"; type NodeRegistryConstructorParams = | [signer?: Signer] | ConstructorParameters<typeof ContractFactory>; const isSuperArgs = ( xs: NodeRegistryConstructorParams ): xs is ConstructorParameters<typeof ContractFactory> => xs.length > 1; export class NodeRegistry__factory extends ContractFactory { constructor(...args: NodeRegistryConstructorParams) { if (isSuperArgs(args)) { super(...args); } else { super(_abi, _bytecode, args[0]); } } override deploy( overrides?: Overrides & { from?: PromiseOrValue<string> } ): Promise<NodeRegistry> { return super.deploy(overrides || {}) as Promise<NodeRegistry>; } override getDeployTransaction( overrides?: Overrides & { from?: PromiseOrValue<string> } ): TransactionRequest { return super.getDeployTransaction(overrides || {}); } override attach(address: string): NodeRegistry { return super.attach(address) as NodeRegistry; } override connect(signer: Signer): NodeRegistry__factory { return super.connect(signer) as NodeRegistry__factory; } static readonly bytecode = _bytecode; static readonly abi = _abi; static createInterface(): NodeRegistryInterface { return new utils.Interface(_abi) as NodeRegistryInterface; } static connect( address: string, signerOrProvider: Signer | Provider ): NodeRegistry { return new Contract(address, _abi, signerOrProvider) as NodeRegistry; } }