From 0ea66fd3fb9a72af450bbcaff0bf276b456b9f27 Mon Sep 17 00:00:00 2001 From: ByteZhang Date: Tue, 10 Sep 2024 17:35:49 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20optimize=20scdo=E3=80=81alephium=20cal?= =?UTF-8?q?l=20contract=20example?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/chains/alephium/example.tsx | 8 +++++++- .../components/chains/alephium/params.ts | 5 +++-- .../example/components/chains/scdo/params.ts | 18 +++++++++--------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/packages/example/components/chains/alephium/example.tsx b/packages/example/components/chains/alephium/example.tsx index f96b6d4cd..5af8189e1 100644 --- a/packages/example/components/chains/alephium/example.tsx +++ b/packages/example/components/chains/alephium/example.tsx @@ -157,7 +157,11 @@ export function Example() { allowCallWithoutProvider={!!wallet} presupposeParams={params.signAndSubmitDeployContractTx(wallet?.account?.address ?? '')} onExecute={async (request: string) => { - return wallet.signer.signAndSubmitDeployContractTx(JSON.parse(request)); + console.log('xxx=====>>>>>>> 1'); + const xxx = await wallet.signer.signAndSubmitDeployContractTx(JSON.parse(request)); + console.log('xxx=====>>>>>>> 2', xxx); + + return xxx; }} /> getTokenTransferFrom(wallet?.account?.address ?? '')} + onGenerateRequest={tokenTransferFromToTx} onExecute={async (request: string) => { return wallet.signer.signAndSubmitUnsignedTx(JSON.parse(request)); }} diff --git a/packages/example/components/chains/alephium/params.ts b/packages/example/components/chains/alephium/params.ts index 43d64b8bc..289f3d3c0 100644 --- a/packages/example/components/chains/alephium/params.ts +++ b/packages/example/components/chains/alephium/params.ts @@ -82,9 +82,10 @@ export default { { id: 'signAndSubmitDeployContractTx-test', name: 'Deploy test contract', + description: 'Deploy test contract 最少需要 0.1 ALPH', value: JSON.stringify({ signerAddress: from, - bytecode: '000117010100000004d362d46012b413c40de0b6b3a7640000a90000', + bytecode: '000110010001010105d3eb23039a16000e2c020000', }), }, ]; @@ -97,7 +98,7 @@ export default { value: JSON.stringify({ signerAddress: from, bytecode: - '01010300000007b413c40de0b6b3a7640000a20c0c1440206c3b1f6262ffad9a4cb1e78f03f17f3593837505a69edbc18a59cf23c1f1c4020100', + '0101030001000d13020d0d144020c3fb9f552e7ab1138023ef0e313cf43483fc7fa35f2bbadc3f997ab17e52a10001001700160013020e2c2f0c7b', }), }, ]; diff --git a/packages/example/components/chains/scdo/params.ts b/packages/example/components/chains/scdo/params.ts index c836ad432..e689895e9 100644 --- a/packages/example/components/chains/scdo/params.ts +++ b/packages/example/components/chains/scdo/params.ts @@ -34,15 +34,15 @@ export default { to: '1S015daca201b66f96f74b4230916f9db8db0c0002', }), }, - // { - // id: 'sendTransaction-big-payload', - // name: 'Big Payload', - // value: JSON.stringify({ - // from: from, - // payload: `0x${'010203040506070809'.repeat(600)}`, - // to: from, - // }), - // }, + { + id: 'sendTransaction-big-payload', + name: 'Big Payload', + value: JSON.stringify({ + from: from, + payload: `0x${'010203040506070809'.repeat(600)}`, + to: from, + }), + }, ], estimateGas: (from: string, to: string) => [ {