1.0.1 • Published 4 years ago
@white-matrix/metamask-wallet v1.0.1
🚀 Welcome to your new awesome project!
This project has been created using webpack scaffold, you can now run
npm run compileor
yarn compileto bundle your application
注册 wallet
const registerWallet = ctx.registerWallet({
walletId: string,
walletProvider: any,
init: () => Promise<void | Error>,
fetchNetWork: () => Promise<string>,
fetchAccount: () => Promise<Wallet.IWalletAccount[]>,
deploy: (
data: Wallet.IDeployContractActionData
) => Observable<IEvent<EEventType>>,
interact: (
data: Wallet.IInteractContractActionData
) => Observable<IEvent<EEventType>>,
})
ctx.subscriptions.push(registerWallet);
const config: PluginConfigurations = {
pluginId: 'MetamaskWallet',
version: '0.0.1',
type: PluginType.server,
projectIds: [],
active: true,
description: {
title: 'Metamask Wallet Service',
icon: '#CommentSolid',
description: 'metamask wallet service'
}
}打包 wallet
将package.json的name修改为walletId,并在chain ide中添加相应的钱包数据