Skip to content

Commit

Permalink
chore: optimize eth example (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteZhang1024 authored Oct 31, 2024
1 parent 305487b commit d79843b
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 19 deletions.
4 changes: 2 additions & 2 deletions packages/example/components/chains/ethereum/example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -437,12 +437,12 @@ export default function Example() {
/>
<ApiPayload
title="wallet_watchAsset"
description="添加 Token"
description="添加资产 Token、NFT(EIP 747)"
presupposeParams={params.watchAsset}
onExecute={async (request) => {
const res = await provider?.request({
'method': 'wallet_watchAsset',
'params': [JSON.parse(request)],
'params': JSON.parse(request),
});
return JSON.stringify(res);
}}
Expand Down
71 changes: 55 additions & 16 deletions packages/example/components/chains/ethereum/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,35 +219,74 @@ export default {
}),
watchAsset: [
{
'id': 'watchAsset erc20',
'name': '添加 ERC20 资产',
'description': '添加 ERC20 资产',
'id': 'watchAsset erc20 foo',
'name': '主网 FOO ERC20',
'description': '测试添加主网 FOO ERC20 资产',
'value': JSON.stringify({
'type': 'ERC20',
type: 'ERC20',
options: {
address: '0xa9b4d559a98ff47c83b74522b7986146538cd4df',
symbol: 'FOO',
decimals: 18,
image: 'https://foo.io/token-image.svg',
},
}),
},
{
'id': 'watchAsset ERC721 Lido',
'name': '主网 Lido ERC721',
'description': '测试主网 Lido: stETH Withdrawal NFT ERC721 资产',
'value': JSON.stringify({
'type': 'ERC721',
'options': {
'address': '0xb60e8dd61c5d32be8058bb8eb970870f07233155',
'symbol': 'FOO',
'decimals': 18,
'image': 'https://foo.io/token-image.svg',
'address': '0x889edc2edab5f40e902b864ad4d7ade8e412f9b1',
'tokenId': '50632',
},
}),
},
{
'id': 'watchAsset ERC1155 Lido',
'name': '主网 ERC1155',
'description': '测试添加主网 ERC1155 资产',
'value': JSON.stringify({
'type': 'ERC1155',
'options': {
'address': '0xabcdef0123456789abcdef0123456789abcdef01',
'tokenId': '1337',
},
}),
},
{
'id': 'watchAsset erc20 Polygon WETH',
'name': 'Polygon WETH ERC20',
'description': '测试添加 Polygon WETH 资产',
'value': JSON.stringify({
type: 'ERC20',
options: {
address: '0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619',
symbol: 'WETH',
decimals: 18,
image: 'https://polygonscan.com/token/images/wETH_32.png',
},
}),
},
{
'id': 'watchAsset ERC721',
'name': '添加 ERC721 资产',
'description': '暂时不支持',
'id': 'watchAsset ERC721 Polygon unstoppable',
'name': 'Polygon Unstoppable ERC721',
'description': '测试 Polygon Unstoppable ERC721 资产',
'value': JSON.stringify({
'type': 'ERC721',
'options': {
'address': '0x123456789abcdef0123456789abcdef01234567',
'tokenId': '42',
'address': '0xa9a6a3626993d487d2dbda3173cf58ca1a9d9e9f',
'tokenId':
'17893201811739899534133387548294644234750447072813328765681112569786468116764',
},
}),
},
{
'id': 'watchAsset ERC1155',
'name': '资产 ERC1155 资产',
'description': '暂时不支持',
'id': 'watchAsset ERC1155 Polygon Lido',
'name': 'Polygon ERC1155',
'description': '测试添加 Polygon ERC1155 资产',
'value': JSON.stringify({
'type': 'ERC1155',
'options': {
Expand Down
12 changes: 11 additions & 1 deletion packages/example/components/chains/nostr/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,21 @@ export default {
},
],
signSchnorr: [
{
id: 'signSchnorr-32HexString',
name: '32 位 Hex String',
value: '2118c65161c7d68b4bdbe1374f658532670057ab1bb0c99937d0ff7cff45cb5e',
},
{
id: 'signSchnorr',
name: 'signSchnorr',
name: 'Hex String',
value: '010203',
},
// {
// id: 'signSchnorr-text',
// name: '普通文本',
// value: 'some text here',
// }
],
nip04encrypt: [
{
Expand Down

0 comments on commit d79843b

Please sign in to comment.