From f530c914fcdd98ee9d63238f240342a4232c9ccd Mon Sep 17 00:00:00 2001 From: storywithoutend Date: Thu, 9 Jan 2025 19:08:01 +0800 Subject: [PATCH] add more abi snippet for ethcontroller and legacyethcontroller --- .../src/contracts/ethRegistrarController.ts | 41 +++++++++++++ packages/ensjs/src/contracts/index.ts | 15 +++++ .../contracts/legacyEthRegistrarController.ts | 57 +++++++++++++++---- 3 files changed, 102 insertions(+), 11 deletions(-) diff --git a/packages/ensjs/src/contracts/ethRegistrarController.ts b/packages/ensjs/src/contracts/ethRegistrarController.ts index 41349ac0..389a4071 100644 --- a/packages/ensjs/src/contracts/ethRegistrarController.ts +++ b/packages/ensjs/src/contracts/ethRegistrarController.ts @@ -206,3 +206,44 @@ export const ethRegistrarControllerRenewSnippet = [ type: 'function', }, ] as const + +export const ethRegistrarControllerNameRegisteredEventSnippet = [ + { + anonymous: false, + inputs: [ + { + indexed: false, + name: 'name', + type: 'string', + }, + { + indexed: true, + name: 'label', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: false, + name: 'baseCost', + type: 'uint256', + }, + { + indexed: false, + name: 'premium', + type: 'uint256', + }, + { + indexed: false, + name: 'expires', + type: 'uint256', + }, + ], + name: 'NameRegistered', + type: 'event', + }, +] as const diff --git a/packages/ensjs/src/contracts/index.ts b/packages/ensjs/src/contracts/index.ts index b998202a..57a0af38 100644 --- a/packages/ensjs/src/contracts/index.ts +++ b/packages/ensjs/src/contracts/index.ts @@ -40,8 +40,23 @@ export { ethRegistrarControllerRegisterSnippet, ethRegistrarControllerRenewSnippet, ethRegistrarControllerRentPriceSnippet, + ethRegistrarControllerNameRegisteredEventSnippet, } from './ethRegistrarController.js' export { getChainContractAddress } from './getChainContractAddress.js' +export { + legacyEthRegistrarControllerAvailableSnippet, + legacyEthRegistrarControllerCommitSnippet, + legacyEthRegistrarControllerCommitmentsSnippet, + legacyEthRegistrarControllerMakeCommitmentSnippet, + legacyEthRegistrarControllerMakeCommitmentWithConfigSnippet, + legacyEthRegistrarControllerRegisterSnippet, + legacyEthRegistrarControllerRegisterWithConfigSnippet, + legacyEthRegistrarControllerRenewSnippet, + legacyEthRegistrarControllerRentPriceSnippet, + legacyEthRegistrarControllerSupportsInterfaceSnippet, + legacyEthRegistrarControllerTransferOwnershipSnippet, + legacyEthRegistrarControllerNameRegisteredEventSnippet as legacyNameRegisteredEventSnippet, +} from './legacyEthRegistrarController.js' export { multicallGetCurrentBlockTimestampSnippet, multicallTryAggregateSnippet, diff --git a/packages/ensjs/src/contracts/legacyEthRegistrarController.ts b/packages/ensjs/src/contracts/legacyEthRegistrarController.ts index 166bf9b5..c92ed99a 100644 --- a/packages/ensjs/src/contracts/legacyEthRegistrarController.ts +++ b/packages/ensjs/src/contracts/legacyEthRegistrarController.ts @@ -8,7 +8,7 @@ export const legacyEthRegistrarControllerAvailableSnippet = [ stateMutability: 'view', type: 'function', }, -] +] as const export const legacyEthRegistrarControllerCommitSnippet = [ { @@ -20,7 +20,7 @@ export const legacyEthRegistrarControllerCommitSnippet = [ stateMutability: 'nonpayable', type: 'function', }, -] +] as const export const legacyEthRegistrarControllerCommitmentsSnippet = [ { @@ -32,7 +32,7 @@ export const legacyEthRegistrarControllerCommitmentsSnippet = [ stateMutability: 'view', type: 'function', }, -] +] as const export const legacyEthRegistrarControllerMakeCommitmentSnippet = [ { @@ -48,7 +48,7 @@ export const legacyEthRegistrarControllerMakeCommitmentSnippet = [ stateMutability: 'pure', type: 'function', }, -] +] as const export const legacyEthRegistrarControllerMakeCommitmentWithConfigSnippet = [ { @@ -66,7 +66,7 @@ export const legacyEthRegistrarControllerMakeCommitmentWithConfigSnippet = [ stateMutability: 'pure', type: 'function', }, -] +] as const export const legacyEthRegistrarControllerRegisterSnippet = [ { @@ -83,7 +83,7 @@ export const legacyEthRegistrarControllerRegisterSnippet = [ stateMutability: 'payable', type: 'function', }, -] +] as const export const legacyEthRegistrarControllerRegisterWithConfigSnippet = [ { @@ -102,7 +102,7 @@ export const legacyEthRegistrarControllerRegisterWithConfigSnippet = [ stateMutability: 'payable', type: 'function', }, -] +] as const export const legacyEthRegistrarControllerRenewSnippet = [ { @@ -117,7 +117,7 @@ export const legacyEthRegistrarControllerRenewSnippet = [ stateMutability: 'payable', type: 'function', }, -] +] as const export const legacyEthRegistrarControllerRentPriceSnippet = [ { @@ -132,7 +132,7 @@ export const legacyEthRegistrarControllerRentPriceSnippet = [ stateMutability: 'view', type: 'function', }, -] +] as const export const legacyEthRegistrarControllerSupportsInterfaceSnippet = [ { @@ -144,7 +144,7 @@ export const legacyEthRegistrarControllerSupportsInterfaceSnippet = [ stateMutability: 'pure', type: 'function', }, -] +] as const export const legacyEthRegistrarControllerTransferOwnershipSnippet = [ { @@ -156,4 +156,39 @@ export const legacyEthRegistrarControllerTransferOwnershipSnippet = [ stateMutability: 'nonpayable', type: 'function', }, -] +] as const + +export const legacyEthRegistrarControllerNameRegisteredEventSnippet = [ + { + anonymous: false, + inputs: [ + { indexed: false, internalType: 'string', name: 'name', type: 'string' }, + { + indexed: true, + internalType: 'bytes32', + name: 'label', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'cost', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'expires', + type: 'uint256', + }, + ], + name: 'NameRegistered', + type: 'event', + }, +] as const