钱包本
更新钱包本
增加第一党钱包
简单地添加一个条目到 firstPartyWalletsData 内 packages/wallet-book/src/build/sources/firstParty/index.ts 财务报告和审定财务报表 编译和出版
例如:
argentx: {
brand: {
alt: 'Argent Wallet',
primaryColor: '#FF875B',
spriteId: 'argentx',
},
desktop: {
chromeId: 'dlcobpjiigpikoobohmabehhmhfoodbb',
firefoxId: 'argent-x',
},
name: 'Argent X',
injectedConfig: [
{
chain: 'EVM',
extensionLocators:
}
]
},
需要的字段 :
brandaltprimaryColorspriteId- 标志性svg中使用的IDname
参见 WalletRecordsSchema 用于更多计划选项
添加已注射( 浏览扩展名) 钱包
类似 添加第一党钱包我们再加一把钥匙, injectedConfig 到钱包对象.
...
injectedConfig: [
{
chain: 'EVM',
extensionLocators: [
{ flag: 'isOkxWallet', value: true },
{ flag: 'isOkexWallet', value: true }
],
windowLocations: ['okxwallet']
}
],
name: 'OKX'
如果您需要覆盖以下任何功能: signedMessage, getAddress, getSigner, isInsstalled OnBrowser等...
- 创建相应的文件
ethereum/src/injected/或者说solana/src/injected/。基本文件应该遵循此表单 :
export class <NameOfConnector> extends InjectedWalletBase {
override name = '<Name Here>';
override walletConnectorFallback = true; // only specified on evm wallet connectors
constructor(props: EthereumWalletConnectorOpts) {
super(props);
this.wallet = findWalletBookWallet(this.walletBook, this.key);
}
// override the methods you need below
override async getAddress() {
...
}
}
- 打开
fetchInjectedWalletConnectors.ts网络软件包etherem/solana/...)并添加新的注射式WalletBase类injectedWalletOverrides和filterInjectedWalletKeyOverrides
添加新钱包时要记住的事
If the new wallet is also in walletconnect.json:确保所使用的密钥firstParty/index.ts这是same作为来自walletconnect.json从钱包定义中继承属性.- 数值 :
windowLocations地图到window.<value from windowLocations>也就是说.okxwallet表示window.okxwallet。这些值可以是一条被划定的嵌入路径。 如果钱包在下面window.ethereum或者说window.ethereum.providers,这些窗口位置默认为导入. - 对于您为新钱包添加的每个扩展名定位符, 请添加否定
[{ flag: 'isOkxWallet', value: false }, ...]扩展标记metamask键在第一党. - 如果启用新钱包连接( 存在于
walletconnect.json),确保添加:filterFromWalletConnect: true作为兄弟injectedConfig它将从钱包连接器列表中过滤钱包,并将钱包连接作为倒置连接.
提交 PR 之前的核对表数字 :
[ ]: 如果修改后在插入的文件夹中添加了新文件, 请将钱包密钥添加到 walletBookFallbackList 内 packages/wallet-book/src/build/index.ts
[ ]: 如果钱包簿中的名称正在更改, 请确保如果没有新文件 injected/ 文件夹,您至少确定 shortName 普通化到钱包密钥
myawesomenewwallet: {
...
injectedConfig: { ... },
shortName: 'My Awesome New Wallet', // maps down to the key if you lowercase and remove special characters and spaces
name: 'Awesome Wallet' // this will be displayed in the wallet list and can be changed as long as the `shortName` normalizes to the key
}
注:
参见 injectedConfigSchema 用于计划选项
更新钱包连接数据
- 从 : https://explorer-api.walletconnect.com/v3/wallets?projectId-=XXXX 替换
- 替换软件包/Wallet-book/src/building/ sources/walletConnect/walletconnection.json 页面存档备份,存于互联网档案馆
- 编译和出版
在钱包上添加覆盖
- 修改软件包/Wallet-book/src/building/ sources/walletConnectOverrides/index.ts
- 编译和出版
编译和出版
编译的json 存储于 packages/wallet-book/wallet-book.json当文件更新时
并合并为主机,将自动发布到S3.
简而言之,做出你需要的任何改变,以及:
- 清除钱包簿逻辑的任何缓存
npm run nuke
- 编译
npx nx compile wallet-book