-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from everFinance/feat/support-moonbeam
Feat/support moonbeam
- Loading branch information
Showing
8 changed files
with
89 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export const NATIVE_CHAIN_TOKENS = [{ | ||
chainType: 'ethereum', | ||
network: 'mainnet', | ||
chainId: 1, | ||
nativeSymbol: 'eth' | ||
}, { | ||
chainType: 'ethereum', | ||
network: 'kovan', | ||
chainId: 42, | ||
nativeSymbol: 'eth' | ||
}, { | ||
chainType: 'moon', | ||
network: 'moonbeam', | ||
chainId: 1284, | ||
nativeSymbol: 'glmr' | ||
}, { | ||
chainType: 'moon', | ||
network: 'moonbase-alphanet', | ||
chainId: 1287, | ||
nativeSymbol: 'dev' | ||
}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import Everpay, { ChainType } from '../src/index' | ||
import { ethWalletHasUSDT } from './constants/wallet' | ||
import { ethers } from 'ethers' | ||
|
||
const providerURL = 'https://rpc.api.moonbase.moonbeam.network' | ||
// Define Provider | ||
const provider = new ethers.providers.StaticJsonRpcProvider(providerURL, { | ||
chainId: 1287, | ||
name: 'moonbase-alphanet' | ||
}) | ||
const signer = new ethers.Wallet(ethWalletHasUSDT.privateKey, provider) | ||
|
||
const everpay = new Everpay({ | ||
account: ethWalletHasUSDT.address, | ||
chainType: ChainType.moon, | ||
ethConnectedSigner: signer, | ||
debug: true | ||
}) | ||
|
||
test(`check moonbase ${ethWalletHasUSDT.address} deposit dev`, async () => { | ||
return await everpay.deposit({ | ||
symbol: 'dev', | ||
amount: '0.01' | ||
}).then(ethTx => { | ||
console.log('ethTx', ethTx) | ||
expect(ethTx).toBeTruthy() | ||
}) | ||
}) |