From 038160af5d5c95b29fc6e8ac91d541b58e18935f Mon Sep 17 00:00:00 2001 From: Sebastian Pape Date: Mon, 19 Jun 2023 11:29:04 +0200 Subject: [PATCH] v10.1.0: adds Token[blockchain].WRAPPED for WETH abi --- README.md | 3 + dist/esm/index.evm.js | 288 ++++++++++++++++++++++++++++++++++++++++++ dist/esm/index.js | 288 ++++++++++++++++++++++++++++++++++++++++++ dist/umd/index.evm.js | 288 ++++++++++++++++++++++++++++++++++++++++++ dist/umd/index.js | 288 ++++++++++++++++++++++++++++++++++++++++++ package.evm.json | 2 +- package.json | 2 +- package.solana.json | 2 +- src/Token.js | 18 +++ src/standards/WETH.js | 279 ++++++++++++++++++++++++++++++++++++++++ 10 files changed, 1455 insertions(+), 3 deletions(-) create mode 100644 src/standards/WETH.js diff --git a/README.md b/README.md index 3272a12..76c61b1 100644 --- a/README.md +++ b/README.md @@ -181,6 +181,9 @@ Token.bsc['20'] // [...] 20 standard Token.ethereum.ERC20 // [...] ERC20 ABI Token.bsc.BEP20 // [...] BEP20 ABI +Token.ethereum.WRAPPED // [...] WETH ABI +Token.bsc.WRAPPED // [...] WETH ABI + ``` `DEFAULT` references the broad default token standard on the respective blockchain: diff --git a/dist/esm/index.evm.js b/dist/esm/index.evm.js index 9d7d1ed..84c81ae 100644 --- a/dist/esm/index.evm.js +++ b/dist/esm/index.evm.js @@ -482,6 +482,286 @@ var ERC20 = [ }, ]; +var WETH = [ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "guy", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "src", + "type": "address" + }, + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "wad", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "deposit", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + }, + { + "name": "", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": true, + "name": "guy", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": true, + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Withdrawal", + "type": "event" + } +]; + const uriAPI = [{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]; const uriToName = (tokenURI)=>{ @@ -657,6 +937,7 @@ Token.ethereum = { ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.bsc = { @@ -664,6 +945,7 @@ Token.bsc = { BEP20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.polygon = { @@ -671,6 +953,7 @@ Token.polygon = { ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.fantom = { @@ -678,6 +961,7 @@ Token.fantom = { FTM20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.arbitrum = { @@ -685,6 +969,7 @@ Token.arbitrum = { ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.avalanche = { @@ -693,6 +978,7 @@ Token.avalanche = { ARC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.gnosis = { @@ -700,6 +986,7 @@ Token.gnosis = { ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.optimism = { @@ -707,6 +994,7 @@ Token.optimism = { ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; export { Token as default }; diff --git a/dist/esm/index.js b/dist/esm/index.js index bee070d..3f939b5 100644 --- a/dist/esm/index.js +++ b/dist/esm/index.js @@ -483,6 +483,286 @@ var ERC20 = [ }, ]; +var WETH = [ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "guy", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "src", + "type": "address" + }, + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "wad", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "deposit", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + }, + { + "name": "", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": true, + "name": "guy", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": true, + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Withdrawal", + "type": "event" + } +]; + const uriAPI = [{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]; const uriToName = (tokenURI)=>{ @@ -938,6 +1218,7 @@ Token.ethereum = { ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.bsc = { @@ -945,6 +1226,7 @@ Token.bsc = { BEP20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.polygon = { @@ -952,6 +1234,7 @@ Token.polygon = { ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.fantom = { @@ -959,6 +1242,7 @@ Token.fantom = { FTM20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.arbitrum = { @@ -966,6 +1250,7 @@ Token.arbitrum = { ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.avalanche = { @@ -974,6 +1259,7 @@ Token.avalanche = { ARC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.gnosis = { @@ -981,6 +1267,7 @@ Token.gnosis = { ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.optimism = { @@ -988,6 +1275,7 @@ Token.optimism = { ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.solana = { diff --git a/dist/umd/index.evm.js b/dist/umd/index.evm.js index 718b118..e2ca46a 100644 --- a/dist/umd/index.evm.js +++ b/dist/umd/index.evm.js @@ -488,6 +488,286 @@ }, ]; + var WETH = [ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "guy", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "src", + "type": "address" + }, + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "wad", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "deposit", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + }, + { + "name": "", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": true, + "name": "guy", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": true, + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Withdrawal", + "type": "event" + } + ]; + const uriAPI = [{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]; const uriToName = (tokenURI)=>{ @@ -663,6 +943,7 @@ ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.bsc = { @@ -670,6 +951,7 @@ BEP20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.polygon = { @@ -677,6 +959,7 @@ ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.fantom = { @@ -684,6 +967,7 @@ FTM20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.arbitrum = { @@ -691,6 +975,7 @@ ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.avalanche = { @@ -699,6 +984,7 @@ ARC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.gnosis = { @@ -706,6 +992,7 @@ ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.optimism = { @@ -713,6 +1000,7 @@ ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; return Token; diff --git a/dist/umd/index.js b/dist/umd/index.js index 87fa778..0e4b402 100644 --- a/dist/umd/index.js +++ b/dist/umd/index.js @@ -488,6 +488,286 @@ }, ]; + var WETH = [ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "guy", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "src", + "type": "address" + }, + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "wad", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "deposit", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + }, + { + "name": "", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": true, + "name": "guy", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": true, + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Withdrawal", + "type": "event" + } + ]; + const uriAPI = [{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]; const uriToName = (tokenURI)=>{ @@ -943,6 +1223,7 @@ ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.bsc = { @@ -950,6 +1231,7 @@ BEP20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.polygon = { @@ -957,6 +1239,7 @@ ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.fantom = { @@ -964,6 +1247,7 @@ FTM20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.arbitrum = { @@ -971,6 +1255,7 @@ ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.avalanche = { @@ -979,6 +1264,7 @@ ARC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.gnosis = { @@ -986,6 +1272,7 @@ ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.optimism = { @@ -993,6 +1280,7 @@ ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, }; Token.solana = { diff --git a/package.evm.json b/package.evm.json index e09c4a4..d9094a0 100644 --- a/package.evm.json +++ b/package.evm.json @@ -1,7 +1,7 @@ { "name": "@depay/web3-tokens-evm", "moduleName": "Web3Tokens", - "version": "10.0.0", + "version": "10.1.0", "description": "JavaScript library providing basic functionalities to interact with web3 tokens.", "main": "dist/umd/index.evm.js", "module": "dist/esm/index.evm.js", diff --git a/package.json b/package.json index 8055720..04e728e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@depay/web3-tokens", "moduleName": "Web3Tokens", - "version": "10.0.0", + "version": "10.1.0", "description": "JavaScript library providing basic functionalities to interact with web3 tokens.", "main": "dist/umd/index.js", "module": "dist/esm/index.js", diff --git a/package.solana.json b/package.solana.json index f0c7f6e..485872f 100644 --- a/package.solana.json +++ b/package.solana.json @@ -1,7 +1,7 @@ { "name": "@depay/web3-tokens-solana", "moduleName": "Web3Tokens", - "version": "10.0.0", + "version": "10.1.0", "description": "JavaScript library providing basic functionalities to interact with web3 tokens.", "main": "dist/umd/index.solana.js", "module": "dist/esm/index.solana.js", diff --git a/src/Token.js b/src/Token.js index bfe2d55..78036cd 100644 --- a/src/Token.js +++ b/src/Token.js @@ -5,6 +5,7 @@ import balanceOnEVM from './platforms/evm/balance' import decimalsOnEVM from './platforms/evm/decimals' import ERC1155 from './standards/ERC1155' import ERC20 from './standards/ERC20' +import WETH from './standards/WETH' import nameOnEVM from './platforms/evm/name' import symbolOnEVM from './platforms/evm/symbol' @@ -29,6 +30,7 @@ import balanceOnEVM from './platforms/evm/balance' import decimalsOnEVM from './platforms/evm/decimals' import ERC1155 from './standards/ERC1155' import ERC20 from './standards/ERC20' +import WETH from './standards/WETH' import nameOnEVM from './platforms/evm/name' import symbolOnEVM from './platforms/evm/symbol' @@ -245,6 +247,7 @@ Token.ethereum = { ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, } Token.bsc = { @@ -252,6 +255,7 @@ Token.bsc = { BEP20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, } Token.polygon = { @@ -259,6 +263,7 @@ Token.polygon = { ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, } Token.fantom = { @@ -266,6 +271,7 @@ Token.fantom = { FTM20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, } Token.arbitrum = { @@ -273,6 +279,7 @@ Token.arbitrum = { ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, } Token.avalanche = { @@ -281,6 +288,7 @@ Token.avalanche = { ARC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, } Token.gnosis = { @@ -288,6 +296,7 @@ Token.gnosis = { ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, } Token.optimism = { @@ -295,6 +304,7 @@ Token.optimism = { ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, } /*#elif _SOLANA @@ -320,6 +330,7 @@ Token.ethereum = { ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, } Token.bsc = { @@ -327,6 +338,7 @@ Token.bsc = { BEP20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, } Token.polygon = { @@ -334,6 +346,7 @@ Token.polygon = { ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, } Token.fantom = { @@ -341,6 +354,7 @@ Token.fantom = { FTM20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, } Token.arbitrum = { @@ -348,6 +362,7 @@ Token.arbitrum = { ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, } Token.avalanche = { @@ -356,6 +371,7 @@ Token.avalanche = { ARC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, } Token.gnosis = { @@ -363,6 +379,7 @@ Token.gnosis = { ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, } Token.optimism = { @@ -370,6 +387,7 @@ Token.optimism = { ERC20: ERC20, 20: ERC20, 1155: ERC1155, + WRAPPED: WETH, } Token.solana = { diff --git a/src/standards/WETH.js b/src/standards/WETH.js new file mode 100644 index 0000000..95e6740 --- /dev/null +++ b/src/standards/WETH.js @@ -0,0 +1,279 @@ +export default [ + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "guy", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "src", + "type": "address" + }, + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "wad", + "type": "uint256" + } + ], + "name": "withdraw", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "dst", + "type": "address" + }, + { + "name": "wad", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "deposit", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + }, + { + "name": "", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": true, + "name": "guy", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": true, + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "dst", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "src", + "type": "address" + }, + { + "indexed": false, + "name": "wad", + "type": "uint256" + } + ], + "name": "Withdrawal", + "type": "event" + } +]