Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Wenfeng Wang tolak

🎯
Focusing
View GitHub Profile
View transfer_pha_to_evm_by_wanbridge.js
require('dotenv').config();
const { ApiPromise, WsProvider, Keyring } = require('@polkadot/api');
const { blake2AsU8a } = require('@polkadot/util-crypto');
const BN = require('bn.js');
const bn1e12 = new BN(10).pow(new BN(12));
function getPhaAssetId(khalaApi) {
return khalaApi.createType('XcmV1MultiassetAssetId', {
View gist:59fc93019e54ddc7748ff2dc04638617
This gist is owned by address: 0x7804e66ec9eea3d8daf6273ffbe0a8af25a8879cf43f14d0ebbb30941f578242
View MyCryptoProfile.md

Linking my account tolak on GitHub with my address 5En54NcpvxWur5BVk59Lw9ynwHnMA8Dr5zLeQfMtgs7HGAvs on Substrate in mycryptoprofile.io, and the challenge code is: 809a437cf6776ced2bc9b08a9184ed04. #LitentryVerifyMyAddress

View kovan-dai-to-parachain.js
require('dotenv').config();
const { ApiPromise, WsProvider, Keyring } = require('@polkadot/api');
const { blake2AsU8a } = require('@polkadot/util-crypto');
const BN = require('bn.js');
const ethers = require('ethers');
const BridgeJson = require('./Bridge.json');
const bn1e9 = new BN(10).pow(new BN(9));
const bn1e12 = new BN(10).pow(new BN(12));
View transfer-pha-from-ethereum-to-khala.js
require('dotenv').config();
const { ApiPromise, WsProvider, Keyring } = require('@polkadot/api');
const { blake2AsU8a } = require('@polkadot/util-crypto');
const BN = require('bn.js');
const ethers = require('ethers');
const BridgeJson = require('./Bridge.json');
const bn1e18 = new BN(10).pow(new BN(18));
const khalaParaId = 2004;
View transfer-pha-from-ethereum-to-karura.js
require('dotenv').config();
const { ApiPromise, WsProvider, Keyring } = require('@polkadot/api');
const { blake2AsU8a } = require('@polkadot/util-crypto');
const BN = require('bn.js');
const ethers = require('ethers');
const BridgeJson = require('./Bridge.json');
const bn1e18 = new BN(10).pow(new BN(18));
const khalaParaId = 2004;
View get-deposit-record.js
const ethers = require('ethers');
const ERC20HandlerJson = require('../build/contracts/ERC20Handler.json');
async function main() {
const handlerAddress = '0xDf2E83f33dB8A9CcF3a00FCe18C3F509b974353D';
const provider = new ethers.providers.JsonRpcProvider('https://kovan.infura.io/v3/6d61e7957c1c489ea8141e947447405b');
const handler = new ethers.Contract(handlerAddress, ERC20HandlerJson.abi, provider);
const depositRecord = await handler.getDepositRecord(50, 1);
console.log(depositRecord);
}