Skip to content

Commit 85f5fb2

Browse files
committed
fix polyfills
1 parent 6f334e8 commit 85f5fb2

9 files changed

Lines changed: 65 additions & 73 deletions

File tree

package-lock.json

Lines changed: 30 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
"url": "https://github.com/terra-money/bridge-sdk/issues"
2222
},
2323
"homepage": "https://github.com/terra-money/bridge-sdk#readme",
24+
"browserslist": [
25+
"IE 11",
26+
"last 3 Chrome versions"
27+
],
2428
"devDependencies": {
2529
"@types/node": "^18.6.5",
2630
"buffer": "^6.0.3",

src/const/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export * from './bridges'
22
export * from './chains'
33
export * from './coin'
4-
export * from './wallet'
4+
export * from './wallet'

src/util/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export * from './address'
1+
export * from './address'

src/wallets/metamask/MetaMaskWallet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { chainIDs, ChainType } from '../../const/chains'
44
import { getAxelarDepositAddress } from '../../packages/axelar'
55
import { Tx, TxResult, Wallet } from '../Wallet'
66
import { ethers } from 'ethers'
7-
import abi from './abi.json'
7+
import abi from './abi'
88

99
declare global {
1010
interface Window {

src/wallets/metamask/abi.json

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/wallets/metamask/abi.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
export default [
2+
'function balanceOf(address owner) view returns (uint256)',
3+
'function decimals() view returns (uint8)',
4+
'function symbol() view returns (string)',
5+
6+
'function earned(address account) public view returns (uint256)',
7+
'function allowance(address owner, address spender) external view returns (uint256)',
8+
9+
'function totalSupply() public view returns (uint256)',
10+
'function currentReward() public view returns (uint256)',
11+
'function lastTimeRewardApplicable() public view returns (uint256)',
12+
'function rewardPerToken() public view returns (uint256)',
13+
14+
'function transfer(address to, uint amount) returns (boolean)',
15+
'function burn(uint256 amount, bytes32 to) returns (boolean)',
16+
'function approve(address spender, uint256 amount) external returns (bool)',
17+
'function stake(uint256 amount) external',
18+
'function withdraw(uint256 amount) external',
19+
'function getReward() external',
20+
'function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) external',
21+
22+
'event Transfer(address indexed from, address indexed to, uint amount)',
23+
]

tsconfig.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
{
42
"include": ["src", "types"],
53
"exclude": ["/node_modules/", "./src/**/*.spec.ts"],
@@ -25,10 +23,10 @@
2523
"strictFunctionTypes": true,
2624
"strictNullChecks": true,
2725
"strictPropertyInitialization": true,
28-
"resolveJsonModule": true,
2926
"target": "es5",
3027
"paths": {
3128
"*": ["src/*"]
32-
}
29+
},
30+
"resolveJsonModule": true
3331
}
3432
}

webpack.config.js

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const webpack = require('webpack')
22
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin')
3-
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
43

54
const commonConfig = {
65
mode: 'production',
@@ -9,7 +8,7 @@ const commonConfig = {
98
module: {
109
rules: [
1110
{
12-
test: /\.tsx?$/,
11+
test: /\.ts$/,
1312
use: 'ts-loader',
1413
exclude: /node_modules/,
1514
},
@@ -26,16 +25,16 @@ const webConfig = {
2625
...commonConfig,
2726
target: 'web',
2827
output: {
29-
filename: 'bundle.js',
28+
filename: 'index.js',
3029
libraryTarget: 'umd',
3130
library: 'Terra',
3231
},
3332
resolve: {
3433
...commonConfig.resolve,
3534
fallback: {
3635
stream: require.resolve('stream-browserify'),
37-
crypto: require.resolve('crypto-browserify'),
3836
buffer: require.resolve('buffer'),
37+
crypto: require.resolve('crypto-browserify'),
3938
path: require.resolve('path-browserify'),
4039
},
4140
},
@@ -50,13 +49,4 @@ const webConfig = {
5049
],
5150
}
5251

53-
const nodeConfig = {
54-
...commonConfig,
55-
target: 'node',
56-
output: {
57-
libraryTarget: 'commonjs',
58-
filename: 'bundle.node.js',
59-
},
60-
}
61-
6252
module.exports = [webConfig]

0 commit comments

Comments
 (0)