Skip to content

Commit

Permalink
chore: remove not yet implmented register domain call
Browse files Browse the repository at this point in the history
  • Loading branch information
pikonha committed Jun 5, 2024
1 parent e14e85c commit 421d228
Showing 1 changed file with 0 additions and 43 deletions.
43 changes: 0 additions & 43 deletions packages/client/src/write.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,50 +59,7 @@ const _ = (async () => {
args: [toHex(packetToBytes(publicAddress))],
})) as Hash[]

// REGISTER NEW DOMAIN
try {
await client.simulateContract({
functionName: 'register',
abi: l1Abi,
args: [toHex(packetToBytes(publicAddress)), 99999999n],
account: signer.address,
address: resolverAddr,
})
} catch (err) {
const data = getRevertErrorData(err)
switch (data?.errorName) {
case 'StorageHandledByOffChainDatabase': {
const [domain, url, message] = data.args as [
DomainData,
string,
MessageData,
]
await handleDBStorage({ domain, url, message, signer })
break
}
case 'StorageHandledByL2': {
const [chainId, contractAddress] = data.args as [bigint, `0x${string}`]

handleL2Storage({
chainId,
l2Url: providerL2,
args: {
functionName: 'register',
abi: l2Abi,
args: [namehash(publicAddress)],
address: contractAddress,
account: signer.address,
},
})
break
}
default:
console.error({ err })
}
}

// SET TEXT

try {
await client.simulateContract({
functionName: 'setText',
Expand Down

0 comments on commit 421d228

Please sign in to comment.