Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tech/remove web3 #373

Merged
merged 4 commits into from
Jul 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"vue-router": "^3.1.6",
"vuex": "^3.1.3",
"vuex-class": "^0.3.2",
"web3": "^1.3.6",
"xstate": "^4.16.0"
},
"devDependencies": {
Expand Down
32 changes: 30 additions & 2 deletions src/utils/ethers-util.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import Web3 from 'web3'
import { ethers } from 'ethers'
import { AbiItem } from 'web3-utils'
import WalletConnectProvider from '@walletconnect/web3-provider'
import detectEthereumProvider from '@metamask/detect-provider'
import { decodeAddress } from '@polkadot/util-crypto'
Expand All @@ -9,6 +7,36 @@ import { BridgeNetworks } from '@sora-substrate/util'
import axios from '../api'
import storage from './storage'

type AbiType = 'function' | 'constructor' | 'event' | 'fallback';
type StateMutabilityType = 'pure' | 'view' | 'nonpayable' | 'payable';

interface AbiInput {
name: string;
type: string;
indexed?: boolean;
components?: AbiInput[];
internalType?: string;
}

interface AbiOutput {
name: string;
type: string;
components?: AbiOutput[];
internalType?: string;
}

interface AbiItem {
anonymous?: boolean;
constant?: boolean;
inputs?: AbiInput[];
name?: string;
outputs?: AbiOutput[];
payable?: boolean;
stateMutability?: StateMutabilityType;
type: AbiType;
gas?: number;
}

export const ABI = {
balance: [
// balanceOf
Expand Down
Loading