Skip to content

Commit

Permalink
feat: update blob to contract
Browse files Browse the repository at this point in the history
  • Loading branch information
wagmi-x committed Aug 9, 2024
1 parent 58a6129 commit 7ced1e4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1,361 deletions.
6 changes: 4 additions & 2 deletions app/blobtx/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,11 @@ const BlobTX = () => {
const sender: Address = walletClient.account?.address as any
const balance = await publicClient.getBalance({ address: sender })
const needGas = parseEther('0.001')
console.info('needGas:', needGas)
console.info('needGas:', needGas, balance, sender)
if (balance < needGas) {
let needTransValue = needGas
// parseEther('0.001') > needTransValue && (needTransValue = parseEther('0.001'))
console.info(`Transfer balance: ${ethda.id}, ${account.address}, ${sender}, ${needTransValue}`)
const hash = await sendTransactionAsync({ chainId: ethda.id, account: account.address, to: sender, value: needTransValue })
await publicClient.waitForTransactionReceipt({ hash, confirmations: 3 })
// return setLoading({ loading: false, error: true, errorMsg: 'Insufficient funds for gas' })
Expand Down Expand Up @@ -296,8 +297,9 @@ const BlobTX = () => {
data: blobsMetadataHex,
type: 'legacy',
chain: ethda,
extra: blobsMeta,
})
console.info('tx:', request.gas, request.gasPrice, request.maxPriorityFeePerGas)
console.info('tx:', to, request.gas, request.gasPrice, request.maxPriorityFeePerGas)
// @ts-ignore
const res = await walletClient.account.signTransaction(request)
// const res = await walletClient.signTransaction(request as any)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@
"volta": {
"node": "18.18.0"
}
}
}
2 changes: 1 addition & 1 deletion utils/wagmi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const ethda = defineChain({
contracts: {
// blobTo: { address: '0x9FC2d50067AC5B732cA4D02a2d1A8F286882D909' },
// blobTo: { address: zeroAddress },
blobTo: { address: '0xCC0BC5927905ba756659A0c4e90A6dcD626416ee' },
blobTo: { address: '0xC23fD87AB80750075Ed34D0aAa6d302C9df4a7f9' },
},
custom: {
bridgeUrl: 'https://bridge-testnet.ethda.io',
Expand Down
Loading

0 comments on commit 7ced1e4

Please sign in to comment.