Skip to content

Commit

Permalink
fix polyfills
Browse files Browse the repository at this point in the history
  • Loading branch information
alecande11 committed Oct 6, 2022
1 parent 6f334e8 commit 85f5fb2
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 73 deletions.
60 changes: 30 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"url": "https://github.com/terra-money/bridge-sdk/issues"
},
"homepage": "https://github.com/terra-money/bridge-sdk#readme",
"browserslist": [
"IE 11",
"last 3 Chrome versions"
],
"devDependencies": {
"@types/node": "^18.6.5",
"buffer": "^6.0.3",
Expand Down
2 changes: 1 addition & 1 deletion src/const/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './bridges'
export * from './chains'
export * from './coin'
export * from './wallet'
export * from './wallet'
2 changes: 1 addition & 1 deletion src/util/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './address'
export * from './address'
2 changes: 1 addition & 1 deletion src/wallets/metamask/MetaMaskWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { chainIDs, ChainType } from '../../const/chains'
import { getAxelarDepositAddress } from '../../packages/axelar'
import { Tx, TxResult, Wallet } from '../Wallet'
import { ethers } from 'ethers'
import abi from './abi.json'
import abi from './abi'

declare global {
interface Window {
Expand Down
23 changes: 0 additions & 23 deletions src/wallets/metamask/abi.json

This file was deleted.

23 changes: 23 additions & 0 deletions src/wallets/metamask/abi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export default [
'function balanceOf(address owner) view returns (uint256)',
'function decimals() view returns (uint8)',
'function symbol() view returns (string)',

'function earned(address account) public view returns (uint256)',
'function allowance(address owner, address spender) external view returns (uint256)',

'function totalSupply() public view returns (uint256)',
'function currentReward() public view returns (uint256)',
'function lastTimeRewardApplicable() public view returns (uint256)',
'function rewardPerToken() public view returns (uint256)',

'function transfer(address to, uint amount) returns (boolean)',
'function burn(uint256 amount, bytes32 to) returns (boolean)',
'function approve(address spender, uint256 amount) external returns (bool)',
'function stake(uint256 amount) external',
'function withdraw(uint256 amount) external',
'function getReward() external',
'function claim(uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof) external',

'event Transfer(address indexed from, address indexed to, uint amount)',
]
6 changes: 2 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


{
"include": ["src", "types"],
"exclude": ["/node_modules/", "./src/**/*.spec.ts"],
Expand All @@ -25,10 +23,10 @@
"strictFunctionTypes": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"resolveJsonModule": true,
"target": "es5",
"paths": {
"*": ["src/*"]
}
},
"resolveJsonModule": true
}
}
16 changes: 3 additions & 13 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const webpack = require('webpack')
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin')
// const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

const commonConfig = {
mode: 'production',
Expand All @@ -9,7 +8,7 @@ const commonConfig = {
module: {
rules: [
{
test: /\.tsx?$/,
test: /\.ts$/,
use: 'ts-loader',
exclude: /node_modules/,
},
Expand All @@ -26,16 +25,16 @@ const webConfig = {
...commonConfig,
target: 'web',
output: {
filename: 'bundle.js',
filename: 'index.js',
libraryTarget: 'umd',
library: 'Terra',
},
resolve: {
...commonConfig.resolve,
fallback: {
stream: require.resolve('stream-browserify'),
crypto: require.resolve('crypto-browserify'),
buffer: require.resolve('buffer'),
crypto: require.resolve('crypto-browserify'),
path: require.resolve('path-browserify'),
},
},
Expand All @@ -50,13 +49,4 @@ const webConfig = {
],
}

const nodeConfig = {
...commonConfig,
target: 'node',
output: {
libraryTarget: 'commonjs',
filename: 'bundle.node.js',
},
}

module.exports = [webConfig]

0 comments on commit 85f5fb2

Please sign in to comment.