@railgun-community/shared-models 3.0.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/models/network-config.d.ts +3 -2
- package/dist/models/network-config.js +3 -2
- package/dist/models/network-config.js.map +1 -1
- package/dist/models/response-types.d.ts +12 -2
- package/dist/models/response-types.js.map +1 -1
- package/dist/utils/gas.js +2 -1
- package/dist/utils/gas.js.map +1 -1
- package/package.json +1 -1
|
@@ -77,8 +77,9 @@ export declare enum BaseTokenWrappedAddress {
|
|
|
77
77
|
* Type1 = EIP-1559 (maxFeePerGas and maxPriorityFeePerGas).
|
|
78
78
|
*/
|
|
79
79
|
export declare enum EVMGasType {
|
|
80
|
-
Type0 =
|
|
81
|
-
|
|
80
|
+
Type0 = 0,
|
|
81
|
+
Type1 = 1,
|
|
82
|
+
Type2 = 2
|
|
82
83
|
}
|
|
83
84
|
export declare const NETWORK_CONFIG: {
|
|
84
85
|
[name in NetworkName]: Network;
|
|
@@ -63,8 +63,9 @@ var BaseTokenWrappedAddress;
|
|
|
63
63
|
*/
|
|
64
64
|
var EVMGasType;
|
|
65
65
|
(function (EVMGasType) {
|
|
66
|
-
EVMGasType["Type0"] = "Type0";
|
|
67
|
-
EVMGasType["
|
|
66
|
+
EVMGasType[EVMGasType["Type0"] = 0] = "Type0";
|
|
67
|
+
EVMGasType[EVMGasType["Type1"] = 1] = "Type1";
|
|
68
|
+
EVMGasType[EVMGasType["Type2"] = 2] = "Type2";
|
|
68
69
|
})(EVMGasType = exports.EVMGasType || (exports.EVMGasType = {}));
|
|
69
70
|
exports.NETWORK_CONFIG = (_a = {},
|
|
70
71
|
_a[NetworkName.Railgun] = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network-config.js","sourceRoot":"","sources":["../../src/models/network-config.ts"],"names":[],"mappings":";;;;AAAA,mDAAoD;AAEpD,IAAY,WAcX;AAdD,WAAY,WAAW;IACrB,WAAW;IACX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E;IAAlE,CAAkE,CACrE,CAAC;AACJ,CAAC,CAAC;AALW,QAAA,eAAe,mBAK1B","sourcesContent":["import { Chain, ChainType } from './response-types';\n\nexport enum NetworkName {\n // Mainnets\n Railgun = 'Railgun',\n Ethereum = 'Ethereum',\n BNBChain = 'BNB_Chain',\n Polygon = 'Polygon',\n\n // Testnets\n EthereumRopsten_DEPRECATED = 'Ethereum_Ropsten',\n EthereumGoerli = 'Ethereum_Goerli',\n PolygonMumbai = 'Polygon_Mumbai',\n\n // Dev only\n Hardhat = 'Hardhat',\n}\n\nexport type FeesSerialized = {\n shield: string;\n unshield: string;\n nft: string;\n};\n\ntype BaseToken = {\n symbol: string;\n wrappedSymbol: string;\n wrappedAddress: BaseTokenWrappedAddress;\n decimals: number;\n};\n\nexport type Network = {\n chain: Chain;\n name: NetworkName;\n publicName: string;\n shortPublicName: string;\n coingeckoId: string;\n baseToken: BaseToken;\n proxyContract: RailgunProxyContract;\n relayAdaptContract: RelayAdaptContract;\n deploymentBlock: RailgunProxyDeploymentBlock;\n isDevOnlyNetwork?: boolean;\n isTestnet?: boolean;\n evmGasType: EVMGasType;\n shouldQuickSync: boolean;\n deprecated?: boolean;\n};\n\nexport enum RailgunProxyContract {\n Ethereum = '0xfa7093cdd9ee6932b4eb2c9e1cde7ce00b1fa4b9',\n EthereumRopsten = '0x1c2A4092e2a436d78FcdF3a178a4E1ed87f0bB8F',\n EthereumGoerli = '0xe8bEa99BB438C2f3D533604D33258d74d5eE4824',\n BNBChain = '0x590162bf4b50f6576a459b75309ee21d92178a10',\n PolygonPOS = '0x19b620929f97b7b990801496c3b361ca5def8c71',\n PolygonMumbai = '0x3ee8306321d992483BDC9c69B8F622Ba3FFF05B6',\n Hardhat = '0x610178dA211FEF7D417bC0e6FeD39F05609AD788',\n}\n\nexport enum RelayAdaptContract {\n Ethereum = '0x22af4EDBeA3De885dDa8f0a0653E6209e44e5B84',\n EthereumRopsten = '0x95abeff80554b23cefe1d3f8dcff3b7d90e28045',\n EthereumGoerli = '0x57F5925FeB79B1fd7Cc491F858D7fBc65502D3FE',\n BNBChain = '0x20d868C7F1Eb706C46641ADD2f849c5DBf4dB158',\n PolygonPOS = '0x30D8AD0339e2CF160620589f2DBa1765126A5fDC',\n PolygonMumbai = '0x80efF1a8939C9B6E8C61Ed5Be683Eda21088B7E6',\n Hardhat = '0xc5a5C42992dECbae36851359345FE25997F5C42d',\n}\n\nexport enum RailgunProxyDeploymentBlock {\n Ethereum = 14737691,\n EthereumRopsten = 12226000,\n EthereumGoerli = 7795991,\n BNBChain = 17633701,\n PolygonPOS = 28083766,\n Hardhat = 0,\n PolygonMumbai = 28697343,\n}\n\nexport enum BaseTokenWrappedAddress {\n EthereumWETH = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', // WETH\n EthereumRopstenWETH = '0xc778417e063141139fce010982780140aa0cd5ab', // (Ropsten) WETH\n EthereumGoerliWETH = '0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6', // (Goerli) WETH\n BinanceWBNB = '0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c', // WBNB\n PolygonWMATIC = '0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270', // WMATIC\n PolygonMumbaiWMATIC = '0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889', // (Mumbai) WMATIC\n HardhatWETH = '0x09635F643e140090A9A8Dcd712eD6285858ceBef', // (Hardhat) WETH\n}\n\n/**\n * Type0 = non-EIP-1559 (gasPrice).\n * Type1 = EIP-1559 (maxFeePerGas and maxPriorityFeePerGas).\n */\nexport enum EVMGasType {\n Type0 = 'Type0',\n Type2 = 'Type2',\n}\n\nexport const NETWORK_CONFIG: { [name in NetworkName]: Network } = {\n [NetworkName.Railgun]: {\n chain: {\n type: -1,\n id: -1,\n },\n name: NetworkName.Railgun,\n publicName: 'RAILGUN',\n shortPublicName: '',\n coingeckoId: '',\n baseToken: {} as BaseToken,\n proxyContract: RailgunProxyContract.Ethereum,\n relayAdaptContract: RelayAdaptContract.Ethereum,\n deploymentBlock: RailgunProxyDeploymentBlock.Ethereum,\n evmGasType: EVMGasType.Type2,\n shouldQuickSync: false,\n },\n [NetworkName.Ethereum]: {\n chain: {\n type: ChainType.EVM,\n id: 1,\n },\n name: NetworkName.Ethereum,\n publicName: 'Ethereum',\n shortPublicName: 'Ethereum',\n coingeckoId: 'ethereum',\n baseToken: {\n symbol: 'ETH',\n wrappedSymbol: 'WETH',\n wrappedAddress: BaseTokenWrappedAddress.EthereumWETH,\n decimals: 18,\n },\n proxyContract: RailgunProxyContract.Ethereum,\n relayAdaptContract: RelayAdaptContract.Ethereum,\n deploymentBlock: RailgunProxyDeploymentBlock.Ethereum,\n evmGasType: EVMGasType.Type2,\n shouldQuickSync: true,\n },\n [NetworkName.EthereumRopsten_DEPRECATED]: {\n deprecated: true,\n chain: {\n type: ChainType.EVM,\n id: 3,\n },\n name: NetworkName.EthereumRopsten_DEPRECATED,\n publicName: 'Ropsten Testnet',\n shortPublicName: 'Ropsten',\n coingeckoId: 'ethereum',\n baseToken: {\n symbol: 'ETH',\n wrappedSymbol: 'WETH',\n wrappedAddress: BaseTokenWrappedAddress.EthereumRopstenWETH,\n decimals: 18,\n },\n proxyContract: RailgunProxyContract.EthereumRopsten,\n relayAdaptContract: RelayAdaptContract.EthereumRopsten,\n deploymentBlock: RailgunProxyDeploymentBlock.EthereumRopsten,\n isDevOnlyNetwork: true,\n isTestnet: true,\n evmGasType: EVMGasType.Type2,\n shouldQuickSync: false,\n },\n [NetworkName.EthereumGoerli]: {\n chain: {\n type: ChainType.EVM,\n id: 5,\n },\n name: NetworkName.EthereumGoerli,\n publicName: 'Görli Testnet',\n shortPublicName: 'Görli',\n coingeckoId: 'ethereum',\n baseToken: {\n symbol: 'ETH',\n wrappedSymbol: 'WETH',\n wrappedAddress: BaseTokenWrappedAddress.EthereumGoerliWETH,\n decimals: 18,\n },\n proxyContract: RailgunProxyContract.EthereumGoerli,\n relayAdaptContract: RelayAdaptContract.EthereumGoerli,\n deploymentBlock: RailgunProxyDeploymentBlock.EthereumGoerli,\n isDevOnlyNetwork: true,\n isTestnet: true,\n evmGasType: EVMGasType.Type2,\n shouldQuickSync: true,\n },\n [NetworkName.BNBChain]: {\n chain: {\n type: ChainType.EVM,\n id: 56,\n },\n name: NetworkName.BNBChain,\n publicName: 'BNB Chain',\n shortPublicName: 'BSC',\n coingeckoId: 'binance-smart-chain',\n baseToken: {\n symbol: 'BNB',\n wrappedSymbol: 'WBNB',\n wrappedAddress: BaseTokenWrappedAddress.BinanceWBNB,\n decimals: 18,\n },\n proxyContract: RailgunProxyContract.BNBChain,\n relayAdaptContract: RelayAdaptContract.BNBChain,\n deploymentBlock: RailgunProxyDeploymentBlock.BNBChain,\n evmGasType: EVMGasType.Type0,\n shouldQuickSync: true,\n },\n [NetworkName.Polygon]: {\n chain: {\n type: ChainType.EVM,\n id: 137,\n },\n name: NetworkName.Polygon,\n publicName: 'Polygon PoS',\n shortPublicName: 'Polygon',\n coingeckoId: 'polygon-pos',\n baseToken: {\n symbol: 'MATIC',\n wrappedSymbol: 'WMATIC',\n wrappedAddress: BaseTokenWrappedAddress.PolygonWMATIC,\n decimals: 18,\n },\n proxyContract: RailgunProxyContract.PolygonPOS,\n relayAdaptContract: RelayAdaptContract.PolygonPOS,\n deploymentBlock: RailgunProxyDeploymentBlock.PolygonPOS,\n evmGasType: EVMGasType.Type2,\n shouldQuickSync: true,\n },\n [NetworkName.PolygonMumbai]: {\n chain: {\n type: ChainType.EVM,\n id: 80001,\n },\n name: NetworkName.PolygonMumbai,\n publicName: 'Mumbai Testnet',\n shortPublicName: 'Mumbai',\n coingeckoId: 'polygon-pos',\n baseToken: {\n symbol: 'MATIC',\n wrappedSymbol: 'WMATIC',\n wrappedAddress: BaseTokenWrappedAddress.PolygonMumbaiWMATIC,\n decimals: 18,\n },\n proxyContract: RailgunProxyContract.PolygonMumbai,\n relayAdaptContract: RelayAdaptContract.PolygonMumbai,\n deploymentBlock: RailgunProxyDeploymentBlock.PolygonMumbai,\n isDevOnlyNetwork: true,\n isTestnet: true,\n evmGasType: EVMGasType.Type2,\n shouldQuickSync: true,\n },\n [NetworkName.Hardhat]: {\n chain: {\n type: ChainType.EVM,\n id: 31337,\n },\n name: NetworkName.Hardhat,\n publicName: 'Hardhat Testnet',\n shortPublicName: 'Hardhat',\n coingeckoId: '',\n baseToken: {\n symbol: 'ETH',\n wrappedSymbol: 'WETH',\n wrappedAddress: BaseTokenWrappedAddress.HardhatWETH,\n decimals: 18,\n },\n proxyContract: RailgunProxyContract.Hardhat,\n relayAdaptContract: RelayAdaptContract.Hardhat,\n deploymentBlock: RailgunProxyDeploymentBlock.Hardhat,\n isDevOnlyNetwork: true,\n isTestnet: true,\n evmGasType: EVMGasType.Type2,\n shouldQuickSync: false,\n },\n};\n\nexport const networkForChain = (chain: Chain): Optional<Network> => {\n return Object.values(NETWORK_CONFIG).find(\n network =>\n network.chain.type === chain.type && network.chain.id === chain.id,\n );\n};\n"]}
|
|
1
|
+
{"version":3,"file":"network-config.js","sourceRoot":"","sources":["../../src/models/network-config.ts"],"names":[],"mappings":";;;;AAAA,mDAAoD;AAEpD,IAAY,WAcX;AAdD,WAAY,WAAW;IACrB,WAAW;IACX,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IACrB,qCAAsB,CAAA;IACtB,kCAAmB,CAAA;IAEnB,WAAW;IACX,8DAA+C,CAAA;IAC/C,iDAAkC,CAAA;IAClC,+CAAgC,CAAA;IAEhC,WAAW;IACX,kCAAmB,CAAA;AACrB,CAAC,EAdW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QActB;AAgCD,IAAY,oBAQX;AARD,WAAY,oBAAoB;IAC9B,+EAAuD,CAAA;IACvD,sFAA8D,CAAA;IAC9D,qFAA6D,CAAA;IAC7D,+EAAuD,CAAA;IACvD,iFAAyD,CAAA;IACzD,oFAA4D,CAAA;IAC5D,8EAAsD,CAAA;AACxD,CAAC,EARW,oBAAoB,GAApB,4BAAoB,KAApB,4B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E,0BAAS,CAAC,GAAG;YACnB,EAAE,EAAE,KAAK;SACV;QACD,IAAI,EAAE,WAAW,CAAC,OAAO;QACzB,UAAU,EAAE,iBAAiB;QAC7B,eAAe,EAAE,SAAS;QAC1B,WAAW,EAAE,EAAE;QACf,SAAS,EAAE;YACT,MAAM,EAAE,KAAK;YACb,aAAa,EAAE,MAAM;YACrB,cAAc,EAAE,uBAAuB,CAAC,WAAW;YACnD,QAAQ,EAAE,EAAE;SACb;QACD,aAAa,EAAE,oBAAoB,CAAC,OAAO;QAC3C,kBAAkB,EAAE,kBAAkB,CAAC,OAAO;QAC9C,eAAe,EAAE,2BAA2B,CAAC,OAAO;QACpD,gBAAgB,EAAE,IAAI;QACtB,SAAS,EAAE,IAAI;QACf,UAAU,EAAE,UAAU,CAAC,KAAK;QAC5B,eAAe,EAAE,KAAK;KACvB;QACD;AAEK,IAAM,eAAe,GAAG,UAAC,KAAY;IAC1C,OAAO,MAAM,CAAC,MAAM,CAAC,sBAAc,CAAC,CAAC,IAAI,CACvC,UAAA,OAAO;QACL,OAAA,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,CAAC,EAAE;IAAlE,CAAkE,CACrE,CAAC;AACJ,CAAC,CAAC;AALW,QAAA,eAAe,mBAK1B","sourcesContent":["import { Chain, ChainType } from './response-types';\n\nexport enum NetworkName {\n // Mainnets\n Railgun = 'Railgun',\n Ethereum = 'Ethereum',\n BNBChain = 'BNB_Chain',\n Polygon = 'Polygon',\n\n // Testnets\n EthereumRopsten_DEPRECATED = 'Ethereum_Ropsten',\n EthereumGoerli = 'Ethereum_Goerli',\n PolygonMumbai = 'Polygon_Mumbai',\n\n // Dev only\n Hardhat = 'Hardhat',\n}\n\nexport type FeesSerialized = {\n shield: string;\n unshield: string;\n nft: string;\n};\n\ntype BaseToken = {\n symbol: string;\n wrappedSymbol: string;\n wrappedAddress: BaseTokenWrappedAddress;\n decimals: number;\n};\n\nexport type Network = {\n chain: Chain;\n name: NetworkName;\n publicName: string;\n shortPublicName: string;\n coingeckoId: string;\n baseToken: BaseToken;\n proxyContract: RailgunProxyContract;\n relayAdaptContract: RelayAdaptContract;\n deploymentBlock: RailgunProxyDeploymentBlock;\n isDevOnlyNetwork?: boolean;\n isTestnet?: boolean;\n evmGasType: EVMGasType;\n shouldQuickSync: boolean;\n deprecated?: boolean;\n};\n\nexport enum RailgunProxyContract {\n Ethereum = '0xfa7093cdd9ee6932b4eb2c9e1cde7ce00b1fa4b9',\n EthereumRopsten = '0x1c2A4092e2a436d78FcdF3a178a4E1ed87f0bB8F',\n EthereumGoerli = '0xe8bEa99BB438C2f3D533604D33258d74d5eE4824',\n BNBChain = '0x590162bf4b50f6576a459b75309ee21d92178a10',\n PolygonPOS = '0x19b620929f97b7b990801496c3b361ca5def8c71',\n PolygonMumbai = '0x3ee8306321d992483BDC9c69B8F622Ba3FFF05B6',\n Hardhat = '0x610178dA211FEF7D417bC0e6FeD39F05609AD788',\n}\n\nexport enum RelayAdaptContract {\n Ethereum = '0x22af4EDBeA3De885dDa8f0a0653E6209e44e5B84',\n EthereumRopsten = '0x95abeff80554b23cefe1d3f8dcff3b7d90e28045',\n EthereumGoerli = '0x57F5925FeB79B1fd7Cc491F858D7fBc65502D3FE',\n BNBChain = '0x20d868C7F1Eb706C46641ADD2f849c5DBf4dB158',\n PolygonPOS = '0x30D8AD0339e2CF160620589f2DBa1765126A5fDC',\n PolygonMumbai = '0x80efF1a8939C9B6E8C61Ed5Be683Eda21088B7E6',\n Hardhat = '0xc5a5C42992dECbae36851359345FE25997F5C42d',\n}\n\nexport enum RailgunProxyDeploymentBlock {\n Ethereum = 14737691,\n EthereumRopsten = 12226000,\n EthereumGoerli = 7795991,\n BNBChain = 17633701,\n PolygonPOS = 28083766,\n Hardhat = 0,\n PolygonMumbai = 28697343,\n}\n\nexport enum BaseTokenWrappedAddress {\n EthereumWETH = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', // WETH\n EthereumRopstenWETH = '0xc778417e063141139fce010982780140aa0cd5ab', // (Ropsten) WETH\n EthereumGoerliWETH = '0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6', // (Goerli) WETH\n BinanceWBNB = '0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c', // WBNB\n PolygonWMATIC = '0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270', // WMATIC\n PolygonMumbaiWMATIC = '0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889', // (Mumbai) WMATIC\n HardhatWETH = '0x09635F643e140090A9A8Dcd712eD6285858ceBef', // (Hardhat) WETH\n}\n\n/**\n * Type0 = non-EIP-1559 (gasPrice).\n * Type1 = EIP-1559 (maxFeePerGas and maxPriorityFeePerGas).\n */\nexport enum EVMGasType {\n Type0 = 0,\n Type1 = 1,\n Type2 = 2,\n}\n\nexport const NETWORK_CONFIG: { [name in NetworkName]: Network } = {\n [NetworkName.Railgun]: {\n chain: {\n type: -1,\n id: -1,\n },\n name: NetworkName.Railgun,\n publicName: 'RAILGUN',\n shortPublicName: '',\n coingeckoId: '',\n baseToken: {} as BaseToken,\n proxyContract: RailgunProxyContract.Ethereum,\n relayAdaptContract: RelayAdaptContract.Ethereum,\n deploymentBlock: RailgunProxyDeploymentBlock.Ethereum,\n evmGasType: EVMGasType.Type2,\n shouldQuickSync: false,\n },\n [NetworkName.Ethereum]: {\n chain: {\n type: ChainType.EVM,\n id: 1,\n },\n name: NetworkName.Ethereum,\n publicName: 'Ethereum',\n shortPublicName: 'Ethereum',\n coingeckoId: 'ethereum',\n baseToken: {\n symbol: 'ETH',\n wrappedSymbol: 'WETH',\n wrappedAddress: BaseTokenWrappedAddress.EthereumWETH,\n decimals: 18,\n },\n proxyContract: RailgunProxyContract.Ethereum,\n relayAdaptContract: RelayAdaptContract.Ethereum,\n deploymentBlock: RailgunProxyDeploymentBlock.Ethereum,\n evmGasType: EVMGasType.Type2,\n shouldQuickSync: true,\n },\n [NetworkName.EthereumRopsten_DEPRECATED]: {\n deprecated: true,\n chain: {\n type: ChainType.EVM,\n id: 3,\n },\n name: NetworkName.EthereumRopsten_DEPRECATED,\n publicName: 'Ropsten Testnet',\n shortPublicName: 'Ropsten',\n coingeckoId: 'ethereum',\n baseToken: {\n symbol: 'ETH',\n wrappedSymbol: 'WETH',\n wrappedAddress: BaseTokenWrappedAddress.EthereumRopstenWETH,\n decimals: 18,\n },\n proxyContract: RailgunProxyContract.EthereumRopsten,\n relayAdaptContract: RelayAdaptContract.EthereumRopsten,\n deploymentBlock: RailgunProxyDeploymentBlock.EthereumRopsten,\n isDevOnlyNetwork: true,\n isTestnet: true,\n evmGasType: EVMGasType.Type2,\n shouldQuickSync: false,\n },\n [NetworkName.EthereumGoerli]: {\n chain: {\n type: ChainType.EVM,\n id: 5,\n },\n name: NetworkName.EthereumGoerli,\n publicName: 'Görli Testnet',\n shortPublicName: 'Görli',\n coingeckoId: 'ethereum',\n baseToken: {\n symbol: 'ETH',\n wrappedSymbol: 'WETH',\n wrappedAddress: BaseTokenWrappedAddress.EthereumGoerliWETH,\n decimals: 18,\n },\n proxyContract: RailgunProxyContract.EthereumGoerli,\n relayAdaptContract: RelayAdaptContract.EthereumGoerli,\n deploymentBlock: RailgunProxyDeploymentBlock.EthereumGoerli,\n isDevOnlyNetwork: true,\n isTestnet: true,\n evmGasType: EVMGasType.Type2,\n shouldQuickSync: true,\n },\n [NetworkName.BNBChain]: {\n chain: {\n type: ChainType.EVM,\n id: 56,\n },\n name: NetworkName.BNBChain,\n publicName: 'BNB Chain',\n shortPublicName: 'BSC',\n coingeckoId: 'binance-smart-chain',\n baseToken: {\n symbol: 'BNB',\n wrappedSymbol: 'WBNB',\n wrappedAddress: BaseTokenWrappedAddress.BinanceWBNB,\n decimals: 18,\n },\n proxyContract: RailgunProxyContract.BNBChain,\n relayAdaptContract: RelayAdaptContract.BNBChain,\n deploymentBlock: RailgunProxyDeploymentBlock.BNBChain,\n evmGasType: EVMGasType.Type0,\n shouldQuickSync: true,\n },\n [NetworkName.Polygon]: {\n chain: {\n type: ChainType.EVM,\n id: 137,\n },\n name: NetworkName.Polygon,\n publicName: 'Polygon PoS',\n shortPublicName: 'Polygon',\n coingeckoId: 'polygon-pos',\n baseToken: {\n symbol: 'MATIC',\n wrappedSymbol: 'WMATIC',\n wrappedAddress: BaseTokenWrappedAddress.PolygonWMATIC,\n decimals: 18,\n },\n proxyContract: RailgunProxyContract.PolygonPOS,\n relayAdaptContract: RelayAdaptContract.PolygonPOS,\n deploymentBlock: RailgunProxyDeploymentBlock.PolygonPOS,\n evmGasType: EVMGasType.Type2,\n shouldQuickSync: true,\n },\n [NetworkName.PolygonMumbai]: {\n chain: {\n type: ChainType.EVM,\n id: 80001,\n },\n name: NetworkName.PolygonMumbai,\n publicName: 'Mumbai Testnet',\n shortPublicName: 'Mumbai',\n coingeckoId: 'polygon-pos',\n baseToken: {\n symbol: 'MATIC',\n wrappedSymbol: 'WMATIC',\n wrappedAddress: BaseTokenWrappedAddress.PolygonMumbaiWMATIC,\n decimals: 18,\n },\n proxyContract: RailgunProxyContract.PolygonMumbai,\n relayAdaptContract: RelayAdaptContract.PolygonMumbai,\n deploymentBlock: RailgunProxyDeploymentBlock.PolygonMumbai,\n isDevOnlyNetwork: true,\n isTestnet: true,\n evmGasType: EVMGasType.Type2,\n shouldQuickSync: true,\n },\n [NetworkName.Hardhat]: {\n chain: {\n type: ChainType.EVM,\n id: 31337,\n },\n name: NetworkName.Hardhat,\n publicName: 'Hardhat Testnet',\n shortPublicName: 'Hardhat',\n coingeckoId: '',\n baseToken: {\n symbol: 'ETH',\n wrappedSymbol: 'WETH',\n wrappedAddress: BaseTokenWrappedAddress.HardhatWETH,\n decimals: 18,\n },\n proxyContract: RailgunProxyContract.Hardhat,\n relayAdaptContract: RelayAdaptContract.Hardhat,\n deploymentBlock: RailgunProxyDeploymentBlock.Hardhat,\n isDevOnlyNetwork: true,\n isTestnet: true,\n evmGasType: EVMGasType.Type2,\n shouldQuickSync: false,\n },\n};\n\nexport const networkForChain = (chain: Chain): Optional<Network> => {\n return Object.values(NETWORK_CONFIG).find(\n network =>\n network.chain.type === chain.type && network.chain.id === chain.id,\n );\n};\n"]}
|
|
@@ -5,24 +5,34 @@ export declare type RailgunAPICiphertext = {
|
|
|
5
5
|
iv: string;
|
|
6
6
|
data: string[];
|
|
7
7
|
};
|
|
8
|
-
export declare type TransactionGasDetails = TransactionGasDetailsType0 | TransactionGasDetailsType2;
|
|
8
|
+
export declare type TransactionGasDetails = TransactionGasDetailsType0 | TransactionGasDetailsType1 | TransactionGasDetailsType2;
|
|
9
9
|
export declare type TransactionGasDetailsType0 = {
|
|
10
10
|
evmGasType: EVMGasType.Type0;
|
|
11
11
|
gasEstimate: BigNumber;
|
|
12
12
|
gasPrice: BigNumber;
|
|
13
13
|
};
|
|
14
|
+
export declare type TransactionGasDetailsType1 = {
|
|
15
|
+
evmGasType: EVMGasType.Type1;
|
|
16
|
+
gasEstimate: BigNumber;
|
|
17
|
+
gasPrice: BigNumber;
|
|
18
|
+
};
|
|
14
19
|
export declare type TransactionGasDetailsType2 = {
|
|
15
20
|
evmGasType: EVMGasType.Type2;
|
|
16
21
|
gasEstimate: BigNumber;
|
|
17
22
|
maxFeePerGas: BigNumber;
|
|
18
23
|
maxPriorityFeePerGas: BigNumber;
|
|
19
24
|
};
|
|
20
|
-
export declare type TransactionGasDetailsSerialized = TransactionGasDetailsSerializedType0 | TransactionGasDetailsSerializedType2;
|
|
25
|
+
export declare type TransactionGasDetailsSerialized = TransactionGasDetailsSerializedType0 | TransactionGasDetailsSerializedType1 | TransactionGasDetailsSerializedType2;
|
|
21
26
|
export declare type TransactionGasDetailsSerializedType0 = {
|
|
22
27
|
evmGasType: EVMGasType.Type0;
|
|
23
28
|
gasEstimateString: string;
|
|
24
29
|
gasPriceString: string;
|
|
25
30
|
};
|
|
31
|
+
export declare type TransactionGasDetailsSerializedType1 = {
|
|
32
|
+
evmGasType: EVMGasType.Type1;
|
|
33
|
+
gasEstimateString: string;
|
|
34
|
+
gasPriceString: string;
|
|
35
|
+
};
|
|
26
36
|
export declare type TransactionGasDetailsSerializedType2 = {
|
|
27
37
|
evmGasType: EVMGasType.Type2;
|
|
28
38
|
gasEstimateString: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-types.js","sourceRoot":"","sources":["../../src/models/response-types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"response-types.js","sourceRoot":"","sources":["../../src/models/response-types.ts"],"names":[],"mappings":";;;AAiEA,IAAY,SAEX;AAFD,WAAY,SAAS;IACnB,uCAAO,CAAA;AACT,CAAC,EAFW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAEpB","sourcesContent":["import { BigNumber } from '@ethersproject/bignumber';\nimport { MerkletreeScanStatus } from './merkletree-scan';\nimport { EVMGasType, FeesSerialized } from './network-config';\n\nexport type RailgunAPICiphertext = {\n iv: string;\n data: string[];\n};\n\nexport type TransactionGasDetails =\n | TransactionGasDetailsType0\n | TransactionGasDetailsType1\n | TransactionGasDetailsType2;\n\nexport type TransactionGasDetailsType0 = {\n evmGasType: EVMGasType.Type0;\n gasEstimate: BigNumber;\n gasPrice: BigNumber;\n};\n\nexport type TransactionGasDetailsType1 = {\n evmGasType: EVMGasType.Type1;\n gasEstimate: BigNumber;\n gasPrice: BigNumber;\n};\n\nexport type TransactionGasDetailsType2 = {\n evmGasType: EVMGasType.Type2;\n gasEstimate: BigNumber;\n maxFeePerGas: BigNumber;\n maxPriorityFeePerGas: BigNumber;\n};\n\nexport type TransactionGasDetailsSerialized =\n | TransactionGasDetailsSerializedType0\n | TransactionGasDetailsSerializedType1\n | TransactionGasDetailsSerializedType2;\n\nexport type TransactionGasDetailsSerializedType0 = {\n evmGasType: EVMGasType.Type0;\n gasEstimateString: string;\n gasPriceString: string;\n};\n\nexport type TransactionGasDetailsSerializedType1 = {\n evmGasType: EVMGasType.Type1;\n gasEstimateString: string;\n gasPriceString: string;\n};\n\nexport type TransactionGasDetailsSerializedType2 = {\n evmGasType: EVMGasType.Type2;\n gasEstimateString: string;\n maxFeePerGasString: string;\n maxPriorityFeePerGasString: string;\n};\n\nexport type StartRailgunEngineResponse = {\n error?: string;\n};\n\nexport type DownloadInitialArtifactsResponse = {\n error?: string;\n};\n\nexport enum ChainType {\n EVM = 0,\n}\n\nexport type Chain = {\n type: ChainType;\n id: number;\n};\n\nexport type RailgunBalancesEvent = {\n chain: Chain;\n tokenBalancesSerialized: RailgunShieldedTokenBalanceSerialized[];\n railgunWalletID: string;\n};\n\nexport type MerkletreeScanUpdateEvent = {\n chain: Chain;\n scanStatus: MerkletreeScanStatus;\n progress: number;\n};\n\nexport type LoadProviderResponse = {\n feesSerialized?: FeesSerialized;\n error?: string;\n};\n\nexport type RailgunWalletInfo = {\n id: string;\n railgunAddress: string;\n};\n\nexport type LoadRailgunWalletResponse = {\n railgunWalletInfo?: RailgunWalletInfo;\n error?: string;\n};\n\nexport type UnloadRailgunWalletResponse = {\n error?: string;\n};\n\nexport type RailgunWalletAddressDataSerialized = {\n masterPublicKey: string;\n viewingPublicKey: string;\n};\n\nexport type RailgunBalanceResponse = {\n error?: string;\n};\n\nexport type RailgunShieldedTokenBalanceSerialized = {\n tokenAddress: string;\n balanceString: string;\n};\n\nexport type RailgunProveTransactionResponse = {\n error?: string;\n};\n\nexport type RailgunPopulateTransactionResponse = {\n serializedTransaction?: string;\n error?: string;\n};\n\nexport type RailgunTransactionGasEstimateResponse = {\n gasEstimateString?: string;\n error?: string;\n};\n\nexport type RailgunWalletTokenAmount = {\n tokenAddress: string;\n amountString: string;\n};\n\nexport type RailgunWalletTokenAmountRecipient = RailgunWalletTokenAmount & {\n recipientAddress: string;\n};\n\nexport type EncryptDataWithSharedKeyResponse = {\n encryptedData: [string, string];\n randomPubKey: string;\n sharedKey: Uint8Array;\n};\n\nexport type EncryptDataWithSharedKeySerialized = {\n encryptedData: [string, string];\n randomPubKey: string;\n sharedKey: string;\n};\n\nexport type ValidateCachedProvedTransactionResponse = {\n isValid: boolean;\n error?: string;\n};\n\nexport type Pbkdf2Response = string;\n\nexport type RailgunWalletSendTokenAmount = RailgunWalletTokenAmount & {\n recipientAddress?: string;\n walletSource?: string;\n memoText?: string;\n};\n\nexport type RailgunWalletReceiveTokenAmount = RailgunWalletTokenAmount & {\n senderAddress?: string;\n memoText?: string;\n};\n\nexport type TransactionHistoryItem = {\n txid: string;\n receiveTokenAmounts: RailgunWalletReceiveTokenAmount[];\n transferTokenAmounts: RailgunWalletSendTokenAmount[];\n changeTokenAmounts: RailgunWalletTokenAmount[];\n relayerFeeTokenAmount?: RailgunWalletTokenAmount;\n unshieldTokenAmounts: RailgunWalletSendTokenAmount[];\n version: number;\n};\n\nexport type TransactionHistorySerializedResponse = {\n items?: TransactionHistoryItem[];\n error?: string;\n};\n"]}
|
package/dist/utils/gas.js
CHANGED
|
@@ -9,7 +9,8 @@ var calculateGasLimit = function (gasEstimate) {
|
|
|
9
9
|
exports.calculateGasLimit = calculateGasLimit;
|
|
10
10
|
var calculateGasPrice = function (gasDetails) {
|
|
11
11
|
switch (gasDetails.evmGasType) {
|
|
12
|
-
case network_config_1.EVMGasType.Type0:
|
|
12
|
+
case network_config_1.EVMGasType.Type0:
|
|
13
|
+
case network_config_1.EVMGasType.Type1: {
|
|
13
14
|
return gasDetails.gasPrice;
|
|
14
15
|
}
|
|
15
16
|
case network_config_1.EVMGasType.Type2: {
|
package/dist/utils/gas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gas.js","sourceRoot":"","sources":["../../src/utils/gas.ts"],"names":[],"mappings":";;;AACA,2DAAsD;AAG/C,IAAM,iBAAiB,GAAG,UAAC,WAAsB;IACtD,sCAAsC;IACtC,OAAO,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC3C,CAAC,CAAC;AAHW,QAAA,iBAAiB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yBAAiB,EAAC,qBAAqB,CAAC,CAAC;IAClD,IAAA,WAAW,GAAK,qBAAqB,YAA1B,CAA2B;IAC9C,OAAO,IAAA,yBAAiB,EAAC,WAAW,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACtD,CAAC,CAAC;AANW,QAAA,mBAAmB,uBAM9B","sourcesContent":["import { BigNumber } from '@ethersproject/bignumber';\nimport { EVMGasType } from '../models/network-config';\nimport { TransactionGasDetails } from '../models/response-types';\n\nexport const calculateGasLimit = (gasEstimate: BigNumber): BigNumber => {\n // Gas Limit: Add 20% to gas estimate.\n return gasEstimate.mul(12000).div(10000);\n};\n\nexport const calculateGasPrice = (gasDetails: TransactionGasDetails) => {\n switch (gasDetails.evmGasType) {\n case EVMGasType.Type0:\n case EVMGasType.Type1: {\n return gasDetails.gasPrice;\n }\n case EVMGasType.Type2: {\n return gasDetails.maxFeePerGas;\n }\n }\n};\n\nexport const calculateTotalGas = (\n transactionGasDetails: TransactionGasDetails,\n) => {\n const gasPrice = calculateGasPrice(transactionGasDetails);\n const { gasEstimate } = transactionGasDetails;\n return gasEstimate.mul(gasPrice);\n};\n\nexport const calculateMaximumGas = (\n transactionGasDetails: TransactionGasDetails,\n): BigNumber => {\n const gasPrice = calculateGasPrice(transactionGasDetails);\n const { gasEstimate } = transactionGasDetails;\n return calculateGasLimit(gasEstimate).mul(gasPrice);\n};\n"]}
|