Skip to content

Commit

Permalink
feat: document update (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
andybin-cdc authored Aug 19, 2022
1 parent 141ce84 commit 4dd9911
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
13 changes: 8 additions & 5 deletions packages/provider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,19 @@ the global variable is: `DeFiConnectProvider`
import { DeFiConnectProvider } from '@deficonnect/provider'

const provider = new DeFiConnectProvider({
appName: 'your app name'
chainType: 'eth'
chainId: '28' // for eth is 1
appName: 'your app name',
chainType: 'eth', // currently support 'eth' | 'cosmos'
chainId: '25', // for eth is 1
rpcUrls: {
1: 'https://mainnet.infura.io/v3/INFURA_API_KEY',
28: 'https://evm-cronos.crypto.org/',
}
25: 'https://evm-cronos.crypto.org/',
},
})
```

> if you want to support cosmos like chain, please read: [@deficonnect/cosmos-signer](https://github.com/crypto-com/deficonnect-monorepo/tree/develop/packages/cosmos-signer)
> cosmos support: [docs](https://github.com/crypto-com/deficonnect-monorepo/wiki/Chrome-Extension-Wallet-Integration#cosmos-rpc-api)
### Provider(EIP-1193)
```typescript
interface RequestArguments {
Expand Down
23 changes: 13 additions & 10 deletions packages/web3-connector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,19 @@ the global variable is: `DeFiWeb3Connector`
```javascript
const connector = new DeFiWeb3Connector({
supportedChainIds: [1],
appName: 'your app name'
chainType: 'eth'
chainId: '28' // for eth is 1
appName: 'your app name',
chainType: 'eth', // only support 'eth' for DeFiWeb3Connector
chainId: '25', // for eth is 1
rpcUrls: {
1: 'https://mainnet.infura.io/v3/INFURA_API_KEY',
28: 'https://evm-cronos.crypto.org/',
}
25: 'https://evm-cronos.crypto.org/',
},
})

```

> if you want to support cosmos like chain, please use: [@deficonnect/provider](https://github.com/crypto-com/deficonnect-monorepo/tree/develop/packages/cosmos-signer) directly
## Usage

### connect wallet
Expand All @@ -43,13 +46,13 @@ import { DeFiWeb3Connector } from '@deficonnect/web3-connector'

const connector = new DeFiWeb3Connector({
supportedChainIds: [1],
appName: 'your app name'
chainType: 'eth'
chainId: '28' // for eth is 1
appName: 'your app name',
chainType: 'eth', // only support 'eth' for DeFiWeb3Connector
chainId: '25', // for eth is 1
rpcUrls: {
1: 'https://mainnet.infura.io/v3/INFURA_API_KEY',
28: 'https://evm-cronos.crypto.org/',
}
25: 'https://evm-cronos.crypto.org/',
},
})
connector.activate()
```
Expand Down

0 comments on commit 4dd9911

Please sign in to comment.