Skip to content

Commit

Permalink
chore: optimize scdo、alephium call contract example
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteZhang1024 committed Sep 11, 2024
1 parent d65ccb7 commit 2a66d74
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 14 deletions.
8 changes: 7 additions & 1 deletion packages/example/components/chains/alephium/example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}}
/>
<ApiPayload
Expand All @@ -174,6 +178,8 @@ export function Example() {
description=""
allowCallWithoutProvider={!!wallet}
presupposeParams={params.signAndSubmitUnsignedTx(wallet?.account?.address ?? '')}
generateRequestFrom={() => getTokenTransferFrom(wallet?.account?.address ?? '')}
onGenerateRequest={tokenTransferFromToTx}
onExecute={async (request: string) => {
return wallet.signer.signAndSubmitUnsignedTx(JSON.parse(request));
}}
Expand Down
5 changes: 3 additions & 2 deletions packages/example/components/chains/alephium/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}),
},
];
Expand All @@ -97,7 +98,7 @@ export default {
value: JSON.stringify({
signerAddress: from,
bytecode:
'01010300000007b413c40de0b6b3a7640000a20c0c1440206c3b1f6262ffad9a4cb1e78f03f17f3593837505a69edbc18a59cf23c1f1c4020100',
'0101030001000d13020d0d144020c3fb9f552e7ab1138023ef0e313cf43483fc7fa35f2bbadc3f997ab17e52a10001001700160013020e2c2f0c7b',
}),
},
];
Expand Down
18 changes: 9 additions & 9 deletions packages/example/components/chains/scdo/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/example/components/chains/ton/example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export default function App() {
{
appName: "onekey",
name: "OneKey",
imageUrl: "https://common.onekey-asset.com/logo/onekey.png",
imageUrl: "https://common.onekey-asset.com/logo/onekey-x288.png",
aboutUrl: "https://onekey.so",
jsBridgeKey: "onekeyTonWallet",
platforms: ["chrome"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class ProviderAlph extends InteractiveSignerProvider implements AlephiumW
onDisconnected: (() => void | Promise<void>) | undefined = undefined
#nodeProvider: NodeProvider | undefined = undefined
#explorerProvider: ExplorerProvider | undefined = undefined

constructor(props: OneKeyTonProviderProps) {
super();

Expand Down

0 comments on commit 2a66d74

Please sign in to comment.