@railgun-community/shared-models 5.2.0 → 5.2.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/artifact.d.ts +3 -3
- package/dist/models/artifact.js +1 -1
- package/dist/models/artifact.js.map +1 -1
- package/dist/models/function-types.d.ts +1 -1
- package/dist/models/merkletree-scan.js +1 -1
- package/dist/models/merkletree-scan.js.map +1 -1
- package/dist/models/network-config.d.ts +3 -3
- package/dist/models/network-config.js +5 -5
- package/dist/models/network-config.js.map +1 -1
- package/dist/models/proof.js +1 -1
- package/dist/models/proof.js.map +1 -1
- package/dist/models/relayer.d.ts +11 -11
- package/dist/models/relayer.js +1 -1
- package/dist/models/relayer.js.map +1 -1
- package/dist/models/response-types.d.ts +37 -37
- package/dist/models/response-types.js +4 -4
- package/dist/models/response-types.js.map +1 -1
- package/dist/models/transaction.d.ts +1 -1
- package/dist/models/wallet.js +1 -1
- package/dist/models/wallet.js.map +1 -1
- package/dist/utils/available-rpc.d.ts +1 -1
- package/dist/utils/configured-json-rpc-provider.d.ts +1 -1
- package/dist/utils/configured-json-rpc-provider.js +2 -4
- package/dist/utils/configured-json-rpc-provider.js.map +1 -1
- package/dist/utils/error.js +2 -1
- package/dist/utils/error.js.map +1 -1
- package/dist/utils/fallback-provider.d.ts +3 -3
- package/dist/utils/fallback-provider.js +2 -2
- package/dist/utils/fallback-provider.js.map +1 -1
- package/dist/utils/versions.js +2 -1
- package/dist/utils/versions.js.map +1 -1
- package/package.json +8 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="../types/global" />
|
|
2
|
-
export
|
|
2
|
+
export type Artifact = {
|
|
3
3
|
zkey: ArrayLike<number>;
|
|
4
4
|
wasm: Optional<ArrayLike<number>>;
|
|
5
5
|
dat: Optional<ArrayLike<number>>;
|
|
@@ -11,9 +11,9 @@ export declare enum ArtifactName {
|
|
|
11
11
|
VKEY = "vkey",
|
|
12
12
|
DAT = "dat"
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export type ArtifactMapping = {
|
|
15
15
|
[name in ArtifactName]: string;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type ArtifactDownloadedGroup = {
|
|
18
18
|
[name in ArtifactName]: boolean;
|
|
19
19
|
};
|
package/dist/models/artifact.js
CHANGED
|
@@ -7,5 +7,5 @@ var ArtifactName;
|
|
|
7
7
|
ArtifactName["WASM"] = "wasm";
|
|
8
8
|
ArtifactName["VKEY"] = "vkey";
|
|
9
9
|
ArtifactName["DAT"] = "dat";
|
|
10
|
-
})(ArtifactName
|
|
10
|
+
})(ArtifactName || (exports.ArtifactName = ArtifactName = {}));
|
|
11
11
|
//# sourceMappingURL=artifact.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact.js","sourceRoot":"","sources":["../../src/models/artifact.ts"],"names":[],"mappings":";;;AAOA,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,6BAAa,CAAA;IACb,6BAAa,CAAA;IACb,2BAAW,CAAA;AACb,CAAC,EALW,YAAY,
|
|
1
|
+
{"version":3,"file":"artifact.js","sourceRoot":"","sources":["../../src/models/artifact.ts"],"names":[],"mappings":";;;AAOA,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,6BAAa,CAAA;IACb,6BAAa,CAAA;IACb,2BAAW,CAAA;AACb,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB","sourcesContent":["export type Artifact = {\n zkey: ArrayLike<number>;\n wasm: Optional<ArrayLike<number>>;\n dat: Optional<ArrayLike<number>>;\n vkey: object;\n};\n\nexport enum ArtifactName {\n ZKEY = 'zkey',\n WASM = 'wasm',\n VKEY = 'vkey',\n DAT = 'dat',\n}\n\nexport type ArtifactMapping = {\n [name in ArtifactName]: string;\n};\n\nexport type ArtifactDownloadedGroup = {\n [name in ArtifactName]: boolean;\n};\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Chain } from './response-types';
|
|
2
|
-
export
|
|
2
|
+
export type RailgunBalanceRefreshTrigger = (chain: Chain, railgunWalletID: string, fullRescan: boolean) => Promise<void>;
|
|
@@ -7,5 +7,5 @@ var MerkletreeScanStatus;
|
|
|
7
7
|
MerkletreeScanStatus["Updated"] = "Updated";
|
|
8
8
|
MerkletreeScanStatus["Complete"] = "Complete";
|
|
9
9
|
MerkletreeScanStatus["Incomplete"] = "Incomplete";
|
|
10
|
-
})(MerkletreeScanStatus
|
|
10
|
+
})(MerkletreeScanStatus || (exports.MerkletreeScanStatus = MerkletreeScanStatus = {}));
|
|
11
11
|
//# sourceMappingURL=merkletree-scan.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merkletree-scan.js","sourceRoot":"","sources":["../../src/models/merkletree-scan.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,2CAAmB,CAAA;IACnB,2CAAmB,CAAA;IACnB,6CAAqB,CAAA;IACrB,iDAAyB,CAAA;AAC3B,CAAC,EALW,oBAAoB,
|
|
1
|
+
{"version":3,"file":"merkletree-scan.js","sourceRoot":"","sources":["../../src/models/merkletree-scan.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,2CAAmB,CAAA;IACnB,2CAAmB,CAAA;IACnB,6CAAqB,CAAA;IACrB,iDAAyB,CAAA;AAC3B,CAAC,EALW,oBAAoB,oCAApB,oBAAoB,QAK/B","sourcesContent":["export enum MerkletreeScanStatus {\n Started = 'Started',\n Updated = 'Updated',\n Complete = 'Complete',\n Incomplete = 'Incomplete',\n}\n"]}
|
|
@@ -14,18 +14,18 @@ export declare enum NetworkName {
|
|
|
14
14
|
ArbitrumGoerli = "Arbitrum_Goerli",
|
|
15
15
|
Hardhat = "Hardhat"
|
|
16
16
|
}
|
|
17
|
-
export
|
|
17
|
+
export type FeesSerialized = {
|
|
18
18
|
shield: string;
|
|
19
19
|
unshield: string;
|
|
20
20
|
nft: string;
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
type BaseToken = {
|
|
23
23
|
symbol: string;
|
|
24
24
|
wrappedSymbol: string;
|
|
25
25
|
wrappedAddress: BaseTokenWrappedAddress;
|
|
26
26
|
decimals: number;
|
|
27
27
|
};
|
|
28
|
-
export
|
|
28
|
+
export type Network = {
|
|
29
29
|
chain: Chain;
|
|
30
30
|
name: NetworkName;
|
|
31
31
|
publicName: string;
|
|
@@ -20,7 +20,7 @@ var NetworkName;
|
|
|
20
20
|
NetworkName["ArbitrumGoerli"] = "Arbitrum_Goerli";
|
|
21
21
|
// Dev only
|
|
22
22
|
NetworkName["Hardhat"] = "Hardhat";
|
|
23
|
-
})(NetworkName
|
|
23
|
+
})(NetworkName || (exports.NetworkName = NetworkName = {}));
|
|
24
24
|
var RailgunProxyContract;
|
|
25
25
|
(function (RailgunProxyContract) {
|
|
26
26
|
RailgunProxyContract["Ethereum"] = "0xfa7093cdd9ee6932b4eb2c9e1cde7ce00b1fa4b9";
|
|
@@ -33,7 +33,7 @@ var RailgunProxyContract;
|
|
|
33
33
|
RailgunProxyContract["PolygonMumbai"] = "0x3ee8306321d992483BDC9c69B8F622Ba3FFF05B6";
|
|
34
34
|
RailgunProxyContract["ArbitrumGoerli"] = "0xA0603e598F9Ac2fc7475a3fA08D0794066615D9a";
|
|
35
35
|
RailgunProxyContract["Hardhat"] = "0x610178dA211FEF7D417bC0e6FeD39F05609AD788";
|
|
36
|
-
})(RailgunProxyContract
|
|
36
|
+
})(RailgunProxyContract || (exports.RailgunProxyContract = RailgunProxyContract = {}));
|
|
37
37
|
var RelayAdaptContract;
|
|
38
38
|
(function (RelayAdaptContract) {
|
|
39
39
|
RelayAdaptContract["Ethereum"] = "0x4025ee6512DBbda97049Bcf5AA5D38C54aF6bE8a";
|
|
@@ -46,7 +46,7 @@ var RelayAdaptContract;
|
|
|
46
46
|
RelayAdaptContract["PolygonMumbai"] = "0x17D36875D723Cf0dA250d404Ef4cA0aABE105837";
|
|
47
47
|
RelayAdaptContract["ArbitrumGoerli"] = "0x3eAf99B5EDc79D833AA8B6d18F0a8dd041e13eF6";
|
|
48
48
|
RelayAdaptContract["Hardhat"] = "0x0355B7B8cb128fA5692729Ab3AAa199C1753f726";
|
|
49
|
-
})(RelayAdaptContract
|
|
49
|
+
})(RelayAdaptContract || (exports.RelayAdaptContract = RelayAdaptContract = {}));
|
|
50
50
|
var RailgunProxyDeploymentBlock;
|
|
51
51
|
(function (RailgunProxyDeploymentBlock) {
|
|
52
52
|
RailgunProxyDeploymentBlock[RailgunProxyDeploymentBlock["Ethereum"] = 14737691] = "Ethereum";
|
|
@@ -59,7 +59,7 @@ var RailgunProxyDeploymentBlock;
|
|
|
59
59
|
RailgunProxyDeploymentBlock[RailgunProxyDeploymentBlock["PolygonMumbai"] = 28697343] = "PolygonMumbai";
|
|
60
60
|
RailgunProxyDeploymentBlock[RailgunProxyDeploymentBlock["ArbitrumGoerli"] = 2611949] = "ArbitrumGoerli";
|
|
61
61
|
RailgunProxyDeploymentBlock[RailgunProxyDeploymentBlock["Hardhat"] = 0] = "Hardhat";
|
|
62
|
-
})(RailgunProxyDeploymentBlock
|
|
62
|
+
})(RailgunProxyDeploymentBlock || (exports.RailgunProxyDeploymentBlock = RailgunProxyDeploymentBlock = {}));
|
|
63
63
|
var BaseTokenWrappedAddress;
|
|
64
64
|
(function (BaseTokenWrappedAddress) {
|
|
65
65
|
BaseTokenWrappedAddress["EthereumWETH"] = "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2";
|
|
@@ -72,7 +72,7 @@ var BaseTokenWrappedAddress;
|
|
|
72
72
|
BaseTokenWrappedAddress["PolygonMumbaiWMATIC"] = "0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889";
|
|
73
73
|
BaseTokenWrappedAddress["ArbitrumGoerliWETH"] = "0xe39Ab88f8A4777030A534146A9Ca3B52bd5D43A3";
|
|
74
74
|
BaseTokenWrappedAddress["HardhatWETH"] = "0x09635F643e140090A9A8Dcd712eD6285858ceBef";
|
|
75
|
-
})(BaseTokenWrappedAddress
|
|
75
|
+
})(BaseTokenWrappedAddress || (exports.BaseTokenWrappedAddress = BaseTokenWrappedAddress = {}));
|
|
76
76
|
exports.NETWORK_CONFIG = {
|
|
77
77
|
[NetworkName.Railgun]: {
|
|
78
78
|
chain: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"network-config.js","sourceRoot":"","sources":["../../src/models/network-config.ts"],"names":[],"mappings":";;;AAAA,qDAAgE;AAEhE;;GAEG;AACH,IAAY,WAgBX;AAhBD,WAAY,WAAW;IACrB,WAAW;IACX,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IACrB,qCAAsB,CAAA;IACtB,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IAErB,WAAW;IACX,8DAA+C,CAAA;IAC/C,iDAAkC,CAAA;IAClC,+CAAgC,CAAA;IAChC,iDAAkC,CAAA;IAElC,WAAW;IACX,kCAAmB,CAAA;AACrB,CAAC,EAhBW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAgBtB;AAgCD,IAAY,oBAYX;AAZD,WAAY,oBAAoB;IAC9B,+EAAuD,CAAA;IACvD,+EAAuD,CAAA;IACvD,iFAAyD,CAAA;IACzD,+EAAuD,CAAA;IAEvD,YAAY;IACZ,4CAAoB,CAAA;IACpB,qFAA6D,CAAA;IAC7D,oFAA4D,CAAA;IAC5D,qFAA6D,CAAA;IAC7D,8EAAsD,CAAA;AACxD,CAAC,EAZW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAY/B;AAED,IAAY,kBAYX;AAZD,WAAY,kBAAkB;IAC5B,6EAAuD,CAAA;IACvD,6EAAuD,CAAA;IACvD,+EAAyD,CAAA;IACzD,6EAAuD,CAAA;IAEvD,YAAY;IACZ,0CAAoB,CAAA;IACpB,mFAA6D,CAAA;IAC7D,kFAA4D,CAAA;IAC5D,mFAA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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,iBAAiB,EAAE,2BAAU,CAAC,KAAK;QACnC,eAAe,EAAE,KAAK;KACvB;CACF,CAAC","sourcesContent":["import { Chain, ChainType, EVMGasType } from './response-types';\n\n/**\n * DO NOT CHANGE THESE ENUM STRINGS.\n */\nexport enum NetworkName {\n // Mainnets\n Railgun = 'Railgun',\n Ethereum = 'Ethereum',\n BNBChain = 'BNB_Chain',\n Polygon = 'Polygon',\n Arbitrum = 'Arbitrum',\n\n // Testnets\n EthereumRopsten_DEPRECATED = 'Ethereum_Ropsten',\n EthereumGoerli = 'Ethereum_Goerli',\n PolygonMumbai = 'Polygon_Mumbai',\n ArbitrumGoerli = 'Arbitrum_Goerli',\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 defaultEVMGasType: EVMGasType;\n shouldQuickSync: boolean;\n deprecated?: boolean;\n};\n\nexport enum RailgunProxyContract {\n Ethereum = '0xfa7093cdd9ee6932b4eb2c9e1cde7ce00b1fa4b9',\n BNBChain = '0x590162bf4b50f6576a459b75309ee21d92178a10',\n PolygonPOS = '0x19b620929f97b7b990801496c3b361ca5def8c71',\n Arbitrum = '0xFA7093CDD9EE6932B4eb2c9e1cde7CE00B1FA4b9',\n\n // Test nets\n EthereumRopsten = '',\n EthereumGoerli = '0xe8bEa99BB438C2f3D533604D33258d74d5eE4824',\n PolygonMumbai = '0x3ee8306321d992483BDC9c69B8F622Ba3FFF05B6',\n ArbitrumGoerli = '0xA0603e598F9Ac2fc7475a3fA08D0794066615D9a',\n Hardhat = '0x610178dA211FEF7D417bC0e6FeD39F05609AD788',\n}\n\nexport enum RelayAdaptContract {\n Ethereum = '0x4025ee6512DBbda97049Bcf5AA5D38C54aF6bE8a',\n BNBChain = '0x741936fb83DDf324636D3048b3E6bC800B8D9e12',\n PolygonPOS = '0xc7FfA542736321A3dd69246d73987566a5486968',\n Arbitrum = '0x5aD95C537b002770a39dea342c4bb2b68B1497aA',\n\n // Test nets\n EthereumRopsten = '',\n EthereumGoerli = '0x14a57CA7C5c1AD54fB6c642f428d973fcD696ED4',\n PolygonMumbai = '0x17D36875D723Cf0dA250d404Ef4cA0aABE105837',\n ArbitrumGoerli = '0x3eAf99B5EDc79D833AA8B6d18F0a8dd041e13eF6',\n Hardhat = '0x0355B7B8cb128fA5692729Ab3AAa199C1753f726',\n}\n\nexport enum RailgunProxyDeploymentBlock {\n Ethereum = 14737691,\n BNBChain = 17633701,\n PolygonPOS = 28083766,\n Arbitrum = 56109834,\n\n // Test nets\n EthereumRopsten = 12226000,\n EthereumGoerli = 7795991,\n PolygonMumbai = 28697343,\n ArbitrumGoerli = 2611949,\n Hardhat = 0,\n}\n\nexport enum BaseTokenWrappedAddress {\n EthereumWETH = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', // WETH\n BinanceWBNB = '0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c', // WBNB\n PolygonWMATIC = '0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270', // WMATIC\n ArbitrumWETH = '0x82af49447d8a07e3bd95bd0d56f35241523fbab1', // (Arbitrum) WETH\n\n // Test nets\n EthereumRopstenWETH = '0xc778417e063141139fce010982780140aa0cd5ab', // (Ropsten) WETH\n EthereumGoerliWETH = '0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6', // (Goerli) WETH\n PolygonMumbaiWMATIC = '0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889', // (Mumbai) WMATIC\n ArbitrumGoerliWETH = '0xe39Ab88f8A4777030A534146A9Ca3B52bd5D43A3', // (Arbitrum Goerli) WETH\n HardhatWETH = '0x09635F643e140090A9A8Dcd712eD6285858ceBef', // (Hardhat) WETH\n}\n\nexport const NETWORK_CONFIG: { [name in NetworkName]: Network } = {\n [NetworkName.Railgun]: {\n chain: {\n type: ChainType.EVM,\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 defaultEVMGasType: 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 defaultEVMGasType: 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 Smart 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 defaultEVMGasType: 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',\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 defaultEVMGasType: EVMGasType.Type2,\n shouldQuickSync: true,\n },\n [NetworkName.Arbitrum]: {\n chain: {\n type: ChainType.EVM,\n id: 42161,\n },\n name: NetworkName.Arbitrum,\n publicName: 'Arbitrum',\n shortPublicName: 'Arbitrum',\n coingeckoId: 'arbitrum-one',\n baseToken: {\n symbol: 'ETH',\n wrappedSymbol: 'WETH',\n wrappedAddress: BaseTokenWrappedAddress.ArbitrumWETH,\n decimals: 18,\n },\n proxyContract: RailgunProxyContract.Arbitrum,\n relayAdaptContract: RelayAdaptContract.Arbitrum,\n deploymentBlock: RailgunProxyDeploymentBlock.Arbitrum,\n defaultEVMGasType: EVMGasType.Type2,\n shouldQuickSync: true,\n },\n\n // TEST NETS\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 defaultEVMGasType: 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 defaultEVMGasType: 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 defaultEVMGasType: EVMGasType.Type2,\n shouldQuickSync: true,\n },\n [NetworkName.ArbitrumGoerli]: {\n chain: {\n type: ChainType.EVM,\n id: 421613,\n },\n name: NetworkName.ArbitrumGoerli,\n publicName: 'Arbitrum Görli Testnet',\n shortPublicName: 'Arbitrum Görli',\n coingeckoId: 'arbitrum-one',\n baseToken: {\n symbol: 'ETH',\n wrappedSymbol: 'WETH',\n wrappedAddress: BaseTokenWrappedAddress.ArbitrumGoerliWETH,\n decimals: 18,\n },\n proxyContract: RailgunProxyContract.ArbitrumGoerli,\n relayAdaptContract: RelayAdaptContract.ArbitrumGoerli,\n deploymentBlock: RailgunProxyDeploymentBlock.ArbitrumGoerli,\n isDevOnlyNetwork: true,\n isTestnet: true,\n defaultEVMGasType: 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 defaultEVMGasType: EVMGasType.Type2,\n shouldQuickSync: false,\n },\n};\n"]}
|
|
1
|
+
{"version":3,"file":"network-config.js","sourceRoot":"","sources":["../../src/models/network-config.ts"],"names":[],"mappings":";;;AAAA,qDAAgE;AAEhE;;GAEG;AACH,IAAY,WAgBX;AAhBD,WAAY,WAAW;IACrB,WAAW;IACX,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IACrB,qCAAsB,CAAA;IACtB,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IAErB,WAAW;IACX,8DAA+C,CAAA;IAC/C,iDAAkC,CAAA;IAClC,+CAAgC,CAAA;IAChC,iDAAkC,CAAA;IAElC,WAAW;IACX,kCAAmB,CAAA;AACrB,CAAC,EAhBW,WAAW,2BAAX,WAAW,QAgBtB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,cAAc;QAClD,kBAAkB,EAAE,kBAAkB,CAAC,cAAc;QACrD,eAAe,EAAE,2BAA2B,CAAC,cAAc;QAC3D,gBAAgB,EAAE,IAAI;QACtB,SAAS,EAAE,IAAI;QACf,iBAAiB,EAAE,2BAAU,CAAC,KAAK;QACnC,eAAe,EAAE,IAAI;KACtB;IACD,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE;QACrB,KAAK,EAAE;YACL,IAAI,EAAE,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,iBAAiB,EAAE,2BAAU,CAAC,KAAK;QACnC,eAAe,EAAE,KAAK;KACvB;CACF,CAAC","sourcesContent":["import { Chain, ChainType, EVMGasType } from './response-types';\n\n/**\n * DO NOT CHANGE THESE ENUM STRINGS.\n */\nexport enum NetworkName {\n // Mainnets\n Railgun = 'Railgun',\n Ethereum = 'Ethereum',\n BNBChain = 'BNB_Chain',\n Polygon = 'Polygon',\n Arbitrum = 'Arbitrum',\n\n // Testnets\n EthereumRopsten_DEPRECATED = 'Ethereum_Ropsten',\n EthereumGoerli = 'Ethereum_Goerli',\n PolygonMumbai = 'Polygon_Mumbai',\n ArbitrumGoerli = 'Arbitrum_Goerli',\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 defaultEVMGasType: EVMGasType;\n shouldQuickSync: boolean;\n deprecated?: boolean;\n};\n\nexport enum RailgunProxyContract {\n Ethereum = '0xfa7093cdd9ee6932b4eb2c9e1cde7ce00b1fa4b9',\n BNBChain = '0x590162bf4b50f6576a459b75309ee21d92178a10',\n PolygonPOS = '0x19b620929f97b7b990801496c3b361ca5def8c71',\n Arbitrum = '0xFA7093CDD9EE6932B4eb2c9e1cde7CE00B1FA4b9',\n\n // Test nets\n EthereumRopsten = '',\n EthereumGoerli = '0xe8bEa99BB438C2f3D533604D33258d74d5eE4824',\n PolygonMumbai = '0x3ee8306321d992483BDC9c69B8F622Ba3FFF05B6',\n ArbitrumGoerli = '0xA0603e598F9Ac2fc7475a3fA08D0794066615D9a',\n Hardhat = '0x610178dA211FEF7D417bC0e6FeD39F05609AD788',\n}\n\nexport enum RelayAdaptContract {\n Ethereum = '0x4025ee6512DBbda97049Bcf5AA5D38C54aF6bE8a',\n BNBChain = '0x741936fb83DDf324636D3048b3E6bC800B8D9e12',\n PolygonPOS = '0xc7FfA542736321A3dd69246d73987566a5486968',\n Arbitrum = '0x5aD95C537b002770a39dea342c4bb2b68B1497aA',\n\n // Test nets\n EthereumRopsten = '',\n EthereumGoerli = '0x14a57CA7C5c1AD54fB6c642f428d973fcD696ED4',\n PolygonMumbai = '0x17D36875D723Cf0dA250d404Ef4cA0aABE105837',\n ArbitrumGoerli = '0x3eAf99B5EDc79D833AA8B6d18F0a8dd041e13eF6',\n Hardhat = '0x0355B7B8cb128fA5692729Ab3AAa199C1753f726',\n}\n\nexport enum RailgunProxyDeploymentBlock {\n Ethereum = 14737691,\n BNBChain = 17633701,\n PolygonPOS = 28083766,\n Arbitrum = 56109834,\n\n // Test nets\n EthereumRopsten = 12226000,\n EthereumGoerli = 7795991,\n PolygonMumbai = 28697343,\n ArbitrumGoerli = 2611949,\n Hardhat = 0,\n}\n\nexport enum BaseTokenWrappedAddress {\n EthereumWETH = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', // WETH\n BinanceWBNB = '0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c', // WBNB\n PolygonWMATIC = '0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270', // WMATIC\n ArbitrumWETH = '0x82af49447d8a07e3bd95bd0d56f35241523fbab1', // (Arbitrum) WETH\n\n // Test nets\n EthereumRopstenWETH = '0xc778417e063141139fce010982780140aa0cd5ab', // (Ropsten) WETH\n EthereumGoerliWETH = '0xb4fbf271143f4fbf7b91a5ded31805e42b2208d6', // (Goerli) WETH\n PolygonMumbaiWMATIC = '0x9c3C9283D3e44854697Cd22D3Faa240Cfb032889', // (Mumbai) WMATIC\n ArbitrumGoerliWETH = '0xe39Ab88f8A4777030A534146A9Ca3B52bd5D43A3', // (Arbitrum Goerli) WETH\n HardhatWETH = '0x09635F643e140090A9A8Dcd712eD6285858ceBef', // (Hardhat) WETH\n}\n\nexport const NETWORK_CONFIG: { [name in NetworkName]: Network } = {\n [NetworkName.Railgun]: {\n chain: {\n type: ChainType.EVM,\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 defaultEVMGasType: 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 defaultEVMGasType: 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 Smart 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 defaultEVMGasType: 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',\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 defaultEVMGasType: EVMGasType.Type2,\n shouldQuickSync: true,\n },\n [NetworkName.Arbitrum]: {\n chain: {\n type: ChainType.EVM,\n id: 42161,\n },\n name: NetworkName.Arbitrum,\n publicName: 'Arbitrum',\n shortPublicName: 'Arbitrum',\n coingeckoId: 'arbitrum-one',\n baseToken: {\n symbol: 'ETH',\n wrappedSymbol: 'WETH',\n wrappedAddress: BaseTokenWrappedAddress.ArbitrumWETH,\n decimals: 18,\n },\n proxyContract: RailgunProxyContract.Arbitrum,\n relayAdaptContract: RelayAdaptContract.Arbitrum,\n deploymentBlock: RailgunProxyDeploymentBlock.Arbitrum,\n defaultEVMGasType: EVMGasType.Type2,\n shouldQuickSync: true,\n },\n\n // TEST NETS\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 defaultEVMGasType: 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 defaultEVMGasType: 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 defaultEVMGasType: EVMGasType.Type2,\n shouldQuickSync: true,\n },\n [NetworkName.ArbitrumGoerli]: {\n chain: {\n type: ChainType.EVM,\n id: 421613,\n },\n name: NetworkName.ArbitrumGoerli,\n publicName: 'Arbitrum Görli Testnet',\n shortPublicName: 'Arbitrum Görli',\n coingeckoId: 'arbitrum-one',\n baseToken: {\n symbol: 'ETH',\n wrappedSymbol: 'WETH',\n wrappedAddress: BaseTokenWrappedAddress.ArbitrumGoerliWETH,\n decimals: 18,\n },\n proxyContract: RailgunProxyContract.ArbitrumGoerli,\n relayAdaptContract: RelayAdaptContract.ArbitrumGoerli,\n deploymentBlock: RailgunProxyDeploymentBlock.ArbitrumGoerli,\n isDevOnlyNetwork: true,\n isTestnet: true,\n defaultEVMGasType: 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 defaultEVMGasType: EVMGasType.Type2,\n shouldQuickSync: false,\n },\n};\n"]}
|
package/dist/models/proof.js
CHANGED
|
@@ -7,5 +7,5 @@ var ProofType;
|
|
|
7
7
|
ProofType["Unshield"] = "Unshield";
|
|
8
8
|
ProofType["UnshieldBaseToken"] = "UnshieldBaseToken";
|
|
9
9
|
ProofType["CrossContractCalls"] = "CrossContractCalls";
|
|
10
|
-
})(ProofType
|
|
10
|
+
})(ProofType || (exports.ProofType = ProofType = {}));
|
|
11
11
|
//# sourceMappingURL=proof.js.map
|
package/dist/models/proof.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proof.js","sourceRoot":"","sources":["../../src/models/proof.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,kCAAqB,CAAA;IACrB,kCAAqB,CAAA;IACrB,oDAAuC,CAAA;IACvC,sDAAyC,CAAA;AAC3C,CAAC,EALW,SAAS,
|
|
1
|
+
{"version":3,"file":"proof.js","sourceRoot":"","sources":["../../src/models/proof.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAKX;AALD,WAAY,SAAS;IACnB,kCAAqB,CAAA;IACrB,kCAAqB,CAAA;IACrB,oDAAuC,CAAA;IACvC,sDAAyC,CAAA;AAC3C,CAAC,EALW,SAAS,yBAAT,SAAS,QAKpB","sourcesContent":["export enum ProofType {\n Transfer = 'Transfer',\n Unshield = 'Unshield',\n UnshieldBaseToken = 'UnshieldBaseToken',\n CrossContractCalls = 'CrossContractCalls',\n}\n"]}
|
package/dist/models/relayer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="../types/global" />
|
|
2
2
|
import { ChainType, CommitmentCiphertext } from './response-types';
|
|
3
|
-
export
|
|
3
|
+
export type RelayerFeeMessageData = {
|
|
4
4
|
fees: MapType<string>;
|
|
5
5
|
feeExpiration: number;
|
|
6
6
|
feesID: string;
|
|
@@ -10,16 +10,16 @@ export declare type RelayerFeeMessageData = {
|
|
|
10
10
|
version: string;
|
|
11
11
|
relayAdapt: string;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type RelayerFeeMessage = {
|
|
14
14
|
data: string;
|
|
15
15
|
signature: string;
|
|
16
16
|
};
|
|
17
|
-
|
|
18
|
-
export
|
|
17
|
+
type EncryptedData = [string, string];
|
|
18
|
+
export type RelayerEncryptedMethodParams = {
|
|
19
19
|
pubkey: string;
|
|
20
20
|
encryptedData: EncryptedData;
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
type RelayerRawParamsShared = {
|
|
23
23
|
chainID: number;
|
|
24
24
|
chainType: ChainType;
|
|
25
25
|
feesID: string;
|
|
@@ -28,33 +28,33 @@ declare type RelayerRawParamsShared = {
|
|
|
28
28
|
minVersion: string;
|
|
29
29
|
maxVersion: string;
|
|
30
30
|
};
|
|
31
|
-
export
|
|
31
|
+
export type RelayerRawParamsTransact = RelayerRawParamsShared & {
|
|
32
32
|
to: string;
|
|
33
33
|
data: string;
|
|
34
34
|
minGasPrice: string;
|
|
35
35
|
useRelayAdapt: boolean;
|
|
36
36
|
};
|
|
37
|
-
export
|
|
37
|
+
export type RelayerRawParamsPreAuthorize = RelayerRawParamsShared & {
|
|
38
38
|
gasLimit: string;
|
|
39
39
|
commitmentCiphertext: CommitmentCiphertext;
|
|
40
40
|
commitmentHash: string;
|
|
41
41
|
};
|
|
42
|
-
export
|
|
42
|
+
export type RelayerPreAuthorization = {
|
|
43
43
|
gasLimit: string;
|
|
44
44
|
commitmentHash: string;
|
|
45
45
|
expiration: number;
|
|
46
46
|
};
|
|
47
|
-
export
|
|
47
|
+
export type RelayerSignedPreAuthorization = RelayerPreAuthorization & {
|
|
48
48
|
signature: string;
|
|
49
49
|
};
|
|
50
|
-
export
|
|
50
|
+
export type CachedTokenFee = {
|
|
51
51
|
feePerUnitGas: string;
|
|
52
52
|
expiration: number;
|
|
53
53
|
feesID: string;
|
|
54
54
|
availableWallets: number;
|
|
55
55
|
relayAdapt: string;
|
|
56
56
|
};
|
|
57
|
-
export
|
|
57
|
+
export type SelectedRelayer = {
|
|
58
58
|
railgunAddress: string;
|
|
59
59
|
tokenAddress: string;
|
|
60
60
|
tokenFee: CachedTokenFee;
|
package/dist/models/relayer.js
CHANGED
|
@@ -8,5 +8,5 @@ var RelayerConnectionStatus;
|
|
|
8
8
|
RelayerConnectionStatus["Connected"] = "Connected";
|
|
9
9
|
RelayerConnectionStatus["Disconnected"] = "Disconnected";
|
|
10
10
|
RelayerConnectionStatus["AllUnavailable"] = "AllUnavailable";
|
|
11
|
-
})(RelayerConnectionStatus
|
|
11
|
+
})(RelayerConnectionStatus || (exports.RelayerConnectionStatus = RelayerConnectionStatus = {}));
|
|
12
12
|
//# sourceMappingURL=relayer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relayer.js","sourceRoot":"","sources":["../../src/models/relayer.ts"],"names":[],"mappings":";;;AAwEA,IAAY,uBAMX;AAND,WAAY,uBAAuB;IACjC,0CAAe,CAAA;IACf,kDAAuB,CAAA;IACvB,kDAAuB,CAAA;IACvB,wDAA6B,CAAA;IAC7B,4DAAiC,CAAA;AACnC,CAAC,EANW,uBAAuB,
|
|
1
|
+
{"version":3,"file":"relayer.js","sourceRoot":"","sources":["../../src/models/relayer.ts"],"names":[],"mappings":";;;AAwEA,IAAY,uBAMX;AAND,WAAY,uBAAuB;IACjC,0CAAe,CAAA;IACf,kDAAuB,CAAA;IACvB,kDAAuB,CAAA;IACvB,wDAA6B,CAAA;IAC7B,4DAAiC,CAAA;AACnC,CAAC,EANW,uBAAuB,uCAAvB,uBAAuB,QAMlC","sourcesContent":["import { ChainType, CommitmentCiphertext } from './response-types';\n\nexport type RelayerFeeMessageData = {\n fees: MapType<string>;\n feeExpiration: number;\n feesID: string;\n railgunAddress: string;\n identifier: Optional<string>;\n availableWallets: number;\n version: string;\n relayAdapt: string;\n};\n\nexport type RelayerFeeMessage = {\n data: string; // hex-encoded FeeMessageData\n signature: string; // hex-encoded signature\n};\n\ntype EncryptedData = [string, string];\n\nexport type RelayerEncryptedMethodParams = {\n pubkey: string;\n encryptedData: EncryptedData;\n};\n\ntype RelayerRawParamsShared = {\n chainID: number;\n chainType: ChainType;\n feesID: string;\n relayerViewingKey: string;\n devLog: boolean;\n minVersion: string;\n maxVersion: string;\n};\n\nexport type RelayerRawParamsTransact = RelayerRawParamsShared & {\n to: string;\n data: string;\n minGasPrice: string;\n useRelayAdapt: boolean;\n};\n\nexport type RelayerRawParamsPreAuthorize = RelayerRawParamsShared & {\n gasLimit: string;\n commitmentCiphertext: CommitmentCiphertext;\n commitmentHash: string;\n};\n\nexport type RelayerPreAuthorization = {\n gasLimit: string;\n commitmentHash: string;\n expiration: number;\n};\n\nexport type RelayerSignedPreAuthorization = RelayerPreAuthorization & {\n signature: string;\n};\n\nexport type CachedTokenFee = {\n feePerUnitGas: string;\n expiration: number;\n feesID: string;\n availableWallets: number;\n relayAdapt: string;\n};\n\nexport type SelectedRelayer = {\n railgunAddress: string;\n tokenAddress: string;\n tokenFee: CachedTokenFee;\n};\n\nexport enum RelayerConnectionStatus {\n Error = 'Error',\n Searching = 'Searching',\n Connected = 'Connected',\n Disconnected = 'Disconnected',\n AllUnavailable = 'AllUnavailable',\n}\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { ContractTransaction } from 'ethers';
|
|
3
3
|
import { MerkletreeScanStatus } from './merkletree-scan';
|
|
4
4
|
import { FeesSerialized } from './network-config';
|
|
5
|
-
export
|
|
5
|
+
export type RailgunAPICiphertext = {
|
|
6
6
|
iv: string;
|
|
7
7
|
data: string[];
|
|
8
8
|
};
|
|
@@ -15,72 +15,72 @@ export declare enum EVMGasType {
|
|
|
15
15
|
Type1 = 1,
|
|
16
16
|
Type2 = 2
|
|
17
17
|
}
|
|
18
|
-
export
|
|
19
|
-
export
|
|
18
|
+
export type TransactionGasDetails = TransactionGasDetailsType0 | TransactionGasDetailsType1 | TransactionGasDetailsType2;
|
|
19
|
+
export type TransactionGasDetailsType0 = {
|
|
20
20
|
evmGasType: EVMGasType.Type0;
|
|
21
21
|
gasEstimate: bigint;
|
|
22
22
|
gasPrice: bigint;
|
|
23
23
|
};
|
|
24
|
-
export
|
|
24
|
+
export type TransactionGasDetailsType1 = {
|
|
25
25
|
evmGasType: EVMGasType.Type1;
|
|
26
26
|
gasEstimate: bigint;
|
|
27
27
|
gasPrice: bigint;
|
|
28
28
|
};
|
|
29
|
-
export
|
|
29
|
+
export type TransactionGasDetailsType2 = {
|
|
30
30
|
evmGasType: EVMGasType.Type2;
|
|
31
31
|
gasEstimate: bigint;
|
|
32
32
|
maxFeePerGas: bigint;
|
|
33
33
|
maxPriorityFeePerGas: bigint;
|
|
34
34
|
};
|
|
35
|
-
export
|
|
35
|
+
export type FeeTokenDetails = {
|
|
36
36
|
tokenAddress: string;
|
|
37
37
|
feePerUnitGas: bigint;
|
|
38
38
|
};
|
|
39
39
|
export declare enum ChainType {
|
|
40
40
|
EVM = 0
|
|
41
41
|
}
|
|
42
|
-
export
|
|
42
|
+
export type Chain = {
|
|
43
43
|
type: ChainType;
|
|
44
44
|
id: number;
|
|
45
45
|
};
|
|
46
|
-
export
|
|
46
|
+
export type RailgunBalancesEvent = {
|
|
47
47
|
chain: Chain;
|
|
48
48
|
erc20Amounts: RailgunERC20Amount[];
|
|
49
49
|
nftAmounts: RailgunNFTAmount[];
|
|
50
50
|
railgunWalletID: string;
|
|
51
51
|
};
|
|
52
|
-
export
|
|
52
|
+
export type MerkletreeScanUpdateEvent = {
|
|
53
53
|
chain: Chain;
|
|
54
54
|
scanStatus: MerkletreeScanStatus;
|
|
55
55
|
progress: number;
|
|
56
56
|
};
|
|
57
|
-
export
|
|
57
|
+
export type LoadProviderResponse = {
|
|
58
58
|
feesSerialized: FeesSerialized;
|
|
59
59
|
};
|
|
60
|
-
export
|
|
60
|
+
export type RailgunWalletInfo = {
|
|
61
61
|
id: string;
|
|
62
62
|
railgunAddress: string;
|
|
63
63
|
};
|
|
64
|
-
export
|
|
64
|
+
export type RailgunWalletAddressData = {
|
|
65
65
|
masterPublicKey: bigint;
|
|
66
66
|
viewingPublicKey: bigint;
|
|
67
67
|
};
|
|
68
|
-
export
|
|
68
|
+
export type RailgunTxidFromNullifiersResponse = {
|
|
69
69
|
txid?: string;
|
|
70
70
|
};
|
|
71
|
-
export
|
|
71
|
+
export type RailgunPopulateTransactionResponse = {
|
|
72
72
|
transaction: ContractTransaction;
|
|
73
73
|
nullifiers?: string[];
|
|
74
74
|
};
|
|
75
|
-
export
|
|
75
|
+
export type RailgunTransactionGasEstimateResponse = {
|
|
76
76
|
gasEstimate: bigint;
|
|
77
77
|
relayerFeeCommitment?: CommitmentSummary;
|
|
78
78
|
};
|
|
79
|
-
export
|
|
79
|
+
export type RailgunERC20Amount = {
|
|
80
80
|
tokenAddress: string;
|
|
81
81
|
amount: bigint;
|
|
82
82
|
};
|
|
83
|
-
export
|
|
83
|
+
export type RailgunERC20AmountRecipient = RailgunERC20Amount & {
|
|
84
84
|
recipientAddress: string;
|
|
85
85
|
};
|
|
86
86
|
/**
|
|
@@ -90,54 +90,54 @@ export declare enum NFTTokenType {
|
|
|
90
90
|
ERC721 = 1,
|
|
91
91
|
ERC1155 = 2
|
|
92
92
|
}
|
|
93
|
-
export
|
|
93
|
+
export type NFTAmount = {
|
|
94
94
|
nftAddress: string;
|
|
95
95
|
nftTokenType: NFTTokenType;
|
|
96
96
|
tokenSubID: string;
|
|
97
97
|
amountString: string;
|
|
98
98
|
};
|
|
99
|
-
export
|
|
99
|
+
export type NFTAmountRecipient = NFTAmount & {
|
|
100
100
|
recipientAddress: string;
|
|
101
101
|
};
|
|
102
|
-
export
|
|
102
|
+
export type RailgunNFTAmount = {
|
|
103
103
|
nftAddress: string;
|
|
104
104
|
nftTokenType: NFTTokenType;
|
|
105
105
|
tokenSubID: string;
|
|
106
106
|
amount: bigint;
|
|
107
107
|
};
|
|
108
|
-
export
|
|
108
|
+
export type RailgunNFTAmountRecipient = RailgunNFTAmount & {
|
|
109
109
|
recipientAddress: string;
|
|
110
110
|
};
|
|
111
|
-
export
|
|
111
|
+
export type EncryptDataWithSharedKeyResponse = {
|
|
112
112
|
encryptedData: [string, string];
|
|
113
113
|
randomPubKey: string;
|
|
114
114
|
sharedKey: Uint8Array;
|
|
115
115
|
};
|
|
116
|
-
export
|
|
116
|
+
export type EncryptDataWithSharedKeySerialized = {
|
|
117
117
|
encryptedData: [string, string];
|
|
118
118
|
randomPubKey: string;
|
|
119
119
|
sharedKey: string;
|
|
120
120
|
};
|
|
121
|
-
export
|
|
122
|
-
|
|
121
|
+
export type Pbkdf2Response = string;
|
|
122
|
+
type SendAdditionalData = {
|
|
123
123
|
recipientAddress: Optional<string>;
|
|
124
124
|
walletSource: Optional<string>;
|
|
125
125
|
memoText: Optional<string>;
|
|
126
126
|
};
|
|
127
|
-
export
|
|
128
|
-
export
|
|
129
|
-
|
|
127
|
+
export type RailgunSendERC20Amount = RailgunERC20Amount & SendAdditionalData;
|
|
128
|
+
export type RailgunSendNFTAmount = RailgunNFTAmount & SendAdditionalData;
|
|
129
|
+
type UnshieldAdditonalData = {
|
|
130
130
|
unshieldFee: Optional<string>;
|
|
131
131
|
};
|
|
132
|
-
export
|
|
133
|
-
export
|
|
134
|
-
|
|
132
|
+
export type RailgunUnshieldERC20Amount = RailgunSendERC20Amount & UnshieldAdditonalData;
|
|
133
|
+
export type RailgunUnshieldNFTAmount = RailgunSendNFTAmount & UnshieldAdditonalData;
|
|
134
|
+
type ReceiveAdditionalData = {
|
|
135
135
|
senderAddress: Optional<string>;
|
|
136
136
|
memoText: Optional<string>;
|
|
137
137
|
shieldFee: Optional<string>;
|
|
138
138
|
};
|
|
139
|
-
export
|
|
140
|
-
export
|
|
139
|
+
export type RailgunReceiveERC20Amount = RailgunERC20Amount & ReceiveAdditionalData;
|
|
140
|
+
export type RailgunReceiveNFTAmount = RailgunNFTAmount & ReceiveAdditionalData;
|
|
141
141
|
export declare enum TransactionHistoryItemCategory {
|
|
142
142
|
ShieldERC20s = "ShieldERC20s",
|
|
143
143
|
UnshieldERC20s = "UnshieldERC20s",
|
|
@@ -145,7 +145,7 @@ export declare enum TransactionHistoryItemCategory {
|
|
|
145
145
|
TransferReceiveERC20s = "TransferReceiveERC20s",
|
|
146
146
|
Unknown = "Unknown"
|
|
147
147
|
}
|
|
148
|
-
export
|
|
148
|
+
export type TransactionHistoryItem = {
|
|
149
149
|
txid: string;
|
|
150
150
|
version: number;
|
|
151
151
|
timestamp: Optional<number>;
|
|
@@ -160,19 +160,19 @@ export declare type TransactionHistoryItem = {
|
|
|
160
160
|
unshieldNFTAmounts: RailgunUnshieldNFTAmount[];
|
|
161
161
|
category: TransactionHistoryItemCategory;
|
|
162
162
|
};
|
|
163
|
-
|
|
163
|
+
type Ciphertext = {
|
|
164
164
|
iv: string;
|
|
165
165
|
tag: string;
|
|
166
166
|
data: string[];
|
|
167
167
|
};
|
|
168
|
-
export
|
|
168
|
+
export type CommitmentCiphertext = {
|
|
169
169
|
ciphertext: Ciphertext;
|
|
170
170
|
blindedSenderViewingKey: string;
|
|
171
171
|
blindedReceiverViewingKey: string;
|
|
172
172
|
annotationData: string;
|
|
173
173
|
memo: string;
|
|
174
174
|
};
|
|
175
|
-
export
|
|
175
|
+
export type CommitmentSummary = {
|
|
176
176
|
commitmentCiphertext: CommitmentCiphertext;
|
|
177
177
|
commitmentHash: string;
|
|
178
178
|
};
|
|
@@ -10,11 +10,11 @@ var EVMGasType;
|
|
|
10
10
|
EVMGasType[EVMGasType["Type0"] = 0] = "Type0";
|
|
11
11
|
EVMGasType[EVMGasType["Type1"] = 1] = "Type1";
|
|
12
12
|
EVMGasType[EVMGasType["Type2"] = 2] = "Type2";
|
|
13
|
-
})(EVMGasType
|
|
13
|
+
})(EVMGasType || (exports.EVMGasType = EVMGasType = {}));
|
|
14
14
|
var ChainType;
|
|
15
15
|
(function (ChainType) {
|
|
16
16
|
ChainType[ChainType["EVM"] = 0] = "EVM";
|
|
17
|
-
})(ChainType
|
|
17
|
+
})(ChainType || (exports.ChainType = ChainType = {}));
|
|
18
18
|
/**
|
|
19
19
|
* Synced NFT types from TokenType (@railgun-community/engine).
|
|
20
20
|
*/
|
|
@@ -22,7 +22,7 @@ var NFTTokenType;
|
|
|
22
22
|
(function (NFTTokenType) {
|
|
23
23
|
NFTTokenType[NFTTokenType["ERC721"] = 1] = "ERC721";
|
|
24
24
|
NFTTokenType[NFTTokenType["ERC1155"] = 2] = "ERC1155";
|
|
25
|
-
})(NFTTokenType
|
|
25
|
+
})(NFTTokenType || (exports.NFTTokenType = NFTTokenType = {}));
|
|
26
26
|
var TransactionHistoryItemCategory;
|
|
27
27
|
(function (TransactionHistoryItemCategory) {
|
|
28
28
|
TransactionHistoryItemCategory["ShieldERC20s"] = "ShieldERC20s";
|
|
@@ -30,5 +30,5 @@ var TransactionHistoryItemCategory;
|
|
|
30
30
|
TransactionHistoryItemCategory["TransferSendERC20s"] = "TransferSendERC20s";
|
|
31
31
|
TransactionHistoryItemCategory["TransferReceiveERC20s"] = "TransferReceiveERC20s";
|
|
32
32
|
TransactionHistoryItemCategory["Unknown"] = "Unknown";
|
|
33
|
-
})(TransactionHistoryItemCategory
|
|
33
|
+
})(TransactionHistoryItemCategory || (exports.TransactionHistoryItemCategory = TransactionHistoryItemCategory = {}));
|
|
34
34
|
//# sourceMappingURL=response-types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-types.js","sourceRoot":"","sources":["../../src/models/response-types.ts"],"names":[],"mappings":";;;AAUA;;;GAGG;AACH,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,6CAAS,CAAA;IACT,6CAAS,CAAA;IACT,6CAAS,CAAA;AACX,CAAC,EAJW,UAAU,
|
|
1
|
+
{"version":3,"file":"response-types.js","sourceRoot":"","sources":["../../src/models/response-types.ts"],"names":[],"mappings":";;;AAUA;;;GAGG;AACH,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,6CAAS,CAAA;IACT,6CAAS,CAAA;IACT,6CAAS,CAAA;AACX,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB;AA+BD,IAAY,SAEX;AAFD,WAAY,SAAS;IACnB,uCAAO,CAAA;AACT,CAAC,EAFW,SAAS,yBAAT,SAAS,QAEpB;AAyDD;;GAEG;AACH,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,mDAAU,CAAA;IACV,qDAAW,CAAA;AACb,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAqED,IAAY,8BAMX;AAND,WAAY,8BAA8B;IACxC,+DAA6B,CAAA;IAC7B,mEAAiC,CAAA;IACjC,2EAAyC,CAAA;IACzC,iFAA+C,CAAA;IAC/C,qDAAmB,CAAA;AACrB,CAAC,EANW,8BAA8B,8CAA9B,8BAA8B,QAMzC","sourcesContent":["/// <reference types=\"../types/global\" />\nimport { ContractTransaction } from 'ethers';\nimport { MerkletreeScanStatus } from './merkletree-scan';\nimport { FeesSerialized } from './network-config';\n\nexport type RailgunAPICiphertext = {\n iv: string;\n data: string[];\n};\n\n/**\n * Type0 / Type1 = non-EIP-1559 (gasPrice).\n * Type2 = EIP-1559 (maxFeePerGas and maxPriorityFeePerGas).\n */\nexport enum EVMGasType {\n Type0 = 0,\n Type1 = 1,\n Type2 = 2,\n}\n\nexport type TransactionGasDetails =\n | TransactionGasDetailsType0\n | TransactionGasDetailsType1\n | TransactionGasDetailsType2;\n\nexport type TransactionGasDetailsType0 = {\n evmGasType: EVMGasType.Type0;\n gasEstimate: bigint;\n gasPrice: bigint;\n};\n\nexport type TransactionGasDetailsType1 = {\n evmGasType: EVMGasType.Type1;\n gasEstimate: bigint;\n gasPrice: bigint;\n};\n\nexport type TransactionGasDetailsType2 = {\n evmGasType: EVMGasType.Type2;\n gasEstimate: bigint;\n maxFeePerGas: bigint;\n maxPriorityFeePerGas: bigint;\n};\n\nexport type FeeTokenDetails = {\n tokenAddress: string;\n feePerUnitGas: bigint;\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 erc20Amounts: RailgunERC20Amount[];\n nftAmounts: RailgunNFTAmount[];\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};\n\nexport type RailgunWalletInfo = {\n id: string;\n railgunAddress: string;\n};\n\nexport type RailgunWalletAddressData = {\n masterPublicKey: bigint;\n viewingPublicKey: bigint;\n};\n\nexport type RailgunTxidFromNullifiersResponse = {\n txid?: string;\n};\n\nexport type RailgunPopulateTransactionResponse = {\n transaction: ContractTransaction;\n nullifiers?: string[];\n};\n\nexport type RailgunTransactionGasEstimateResponse = {\n gasEstimate: bigint;\n relayerFeeCommitment?: CommitmentSummary;\n};\n\nexport type RailgunERC20Amount = {\n tokenAddress: string;\n amount: bigint;\n};\n\nexport type RailgunERC20AmountRecipient = RailgunERC20Amount & {\n recipientAddress: string;\n};\n\n/**\n * Synced NFT types from TokenType (@railgun-community/engine).\n */\nexport enum NFTTokenType {\n ERC721 = 1,\n ERC1155 = 2,\n}\n\nexport type NFTAmount = {\n nftAddress: string;\n nftTokenType: NFTTokenType;\n tokenSubID: string;\n amountString: string;\n};\n\nexport type NFTAmountRecipient = NFTAmount & {\n recipientAddress: string;\n};\n\nexport type RailgunNFTAmount = {\n nftAddress: string;\n nftTokenType: NFTTokenType;\n tokenSubID: string;\n amount: bigint;\n};\n\nexport type RailgunNFTAmountRecipient = RailgunNFTAmount & {\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 Pbkdf2Response = string;\n\ntype SendAdditionalData = {\n recipientAddress: Optional<string>;\n walletSource: Optional<string>;\n memoText: Optional<string>;\n};\n\nexport type RailgunSendERC20Amount = RailgunERC20Amount & SendAdditionalData;\n\nexport type RailgunSendNFTAmount = RailgunNFTAmount & SendAdditionalData;\n\ntype UnshieldAdditonalData = {\n unshieldFee: Optional<string>;\n};\n\nexport type RailgunUnshieldERC20Amount = RailgunSendERC20Amount &\n UnshieldAdditonalData;\n\nexport type RailgunUnshieldNFTAmount = RailgunSendNFTAmount &\n UnshieldAdditonalData;\n\ntype ReceiveAdditionalData = {\n senderAddress: Optional<string>;\n memoText: Optional<string>;\n shieldFee: Optional<string>;\n};\n\nexport type RailgunReceiveERC20Amount = RailgunERC20Amount &\n ReceiveAdditionalData;\n\nexport type RailgunReceiveNFTAmount = RailgunNFTAmount & ReceiveAdditionalData;\n\nexport enum TransactionHistoryItemCategory {\n ShieldERC20s = 'ShieldERC20s',\n UnshieldERC20s = 'UnshieldERC20s',\n TransferSendERC20s = 'TransferSendERC20s',\n TransferReceiveERC20s = 'TransferReceiveERC20s',\n Unknown = 'Unknown',\n}\n\nexport type TransactionHistoryItem = {\n txid: string;\n version: number;\n timestamp: Optional<number>;\n blockNumber: Optional<number>;\n receiveERC20Amounts: RailgunReceiveERC20Amount[];\n transferERC20Amounts: RailgunSendERC20Amount[];\n changeERC20Amounts: RailgunERC20Amount[];\n relayerFeeERC20Amount?: RailgunERC20Amount;\n unshieldERC20Amounts: RailgunUnshieldERC20Amount[];\n receiveNFTAmounts: RailgunReceiveNFTAmount[];\n transferNFTAmounts: RailgunSendNFTAmount[];\n unshieldNFTAmounts: RailgunUnshieldNFTAmount[];\n category: TransactionHistoryItemCategory;\n};\n\ntype Ciphertext = {\n iv: string;\n tag: string;\n data: string[];\n};\n\nexport type CommitmentCiphertext = {\n ciphertext: Ciphertext;\n blindedSenderViewingKey: string;\n blindedReceiverViewingKey: string;\n annotationData: string;\n memo: string;\n};\n\nexport type CommitmentSummary = {\n commitmentCiphertext: CommitmentCiphertext;\n commitmentHash: string;\n};\n"]}
|
package/dist/models/wallet.js
CHANGED
|
@@ -7,5 +7,5 @@ var WalletCreationType;
|
|
|
7
7
|
WalletCreationType["Create"] = "Create";
|
|
8
8
|
WalletCreationType["AddViewOnly"] = "AddViewOnly";
|
|
9
9
|
WalletCreationType["ImportFromBackup"] = "ImportFromBackup";
|
|
10
|
-
})(WalletCreationType
|
|
10
|
+
})(WalletCreationType || (exports.WalletCreationType = WalletCreationType = {}));
|
|
11
11
|
//# sourceMappingURL=wallet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../src/models/wallet.ts"],"names":[],"mappings":";;;AAAA,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,uCAAiB,CAAA;IACjB,uCAAiB,CAAA;IACjB,iDAA2B,CAAA;IAC3B,2DAAqC,CAAA;AACvC,CAAC,EALW,kBAAkB,
|
|
1
|
+
{"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../src/models/wallet.ts"],"names":[],"mappings":";;;AAAA,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,uCAAiB,CAAA;IACjB,uCAAiB,CAAA;IACjB,iDAA2B,CAAA;IAC3B,2DAAqC,CAAA;AACvC,CAAC,EALW,kBAAkB,kCAAlB,kBAAkB,QAK7B","sourcesContent":["export enum WalletCreationType {\n Import = 'Import',\n Create = 'Create',\n AddViewOnly = 'AddViewOnly',\n ImportFromBackup = 'ImportFromBackup',\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ProviderJson } from './fallback-provider';
|
|
2
|
-
|
|
2
|
+
type LogError = (err: string) => void;
|
|
3
3
|
/**
|
|
4
4
|
* Health checks ProviderJson inputs, and returns an array of available RPC providers.
|
|
5
5
|
* Available means that they respond to getBlockNumber(), and they are +/- 100 blocks from the median.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { JsonRpcProvider, Network } from 'ethers';
|
|
2
2
|
export declare class ConfiguredJsonRpcProvider extends JsonRpcProvider {
|
|
3
|
-
constructor(url: string, network: Network,
|
|
3
|
+
constructor(url: string, network: Network, maxLogsPerBatch?: number);
|
|
4
4
|
}
|
|
@@ -3,13 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ConfiguredJsonRpcProvider = void 0;
|
|
4
4
|
const ethers_1 = require("ethers");
|
|
5
5
|
class ConfiguredJsonRpcProvider extends ethers_1.JsonRpcProvider {
|
|
6
|
-
constructor(url, network,
|
|
6
|
+
constructor(url, network, maxLogsPerBatch = 100) {
|
|
7
7
|
const options = {
|
|
8
8
|
staticNetwork: network,
|
|
9
|
+
batchMaxCount: maxLogsPerBatch,
|
|
9
10
|
};
|
|
10
|
-
if (disableBatching) {
|
|
11
|
-
options.batchMaxCount = 1;
|
|
12
|
-
}
|
|
13
11
|
super(url, network, options);
|
|
14
12
|
}
|
|
15
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configured-json-rpc-provider.js","sourceRoot":"","sources":["../../src/utils/configured-json-rpc-provider.ts"],"names":[],"mappings":";;;AAAA,mCAA6E;AAE7E,MAAa,yBAA0B,SAAQ,wBAAe;IAC5D,YAAY,GAAW,EAAE,OAAgB,EAAE,eAAe,GAAG,
|
|
1
|
+
{"version":3,"file":"configured-json-rpc-provider.js","sourceRoot":"","sources":["../../src/utils/configured-json-rpc-provider.ts"],"names":[],"mappings":";;;AAAA,mCAA6E;AAE7E,MAAa,yBAA0B,SAAQ,wBAAe;IAC5D,YAAY,GAAW,EAAE,OAAgB,EAAE,eAAe,GAAG,GAAG;QAC9D,MAAM,OAAO,GAA8B;YACzC,aAAa,EAAE,OAAO;YACtB,aAAa,EAAE,eAAe;SAC/B,CAAC;QACF,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC;CACF;AARD,8DAQC","sourcesContent":["import { JsonRpcProvider, JsonRpcApiProviderOptions, Network } from 'ethers';\n\nexport class ConfiguredJsonRpcProvider extends JsonRpcProvider {\n constructor(url: string, network: Network, maxLogsPerBatch = 100) {\n const options: JsonRpcApiProviderOptions = {\n staticNetwork: network,\n batchMaxCount: maxLogsPerBatch,\n };\n super(url, network, options);\n }\n}\n"]}
|
package/dist/utils/error.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sanitizeError = void 0;
|
|
4
|
+
const util_1 = require("./util");
|
|
4
5
|
const STRING_PREFIX_AFTER_UNICODE_REPLACEMENT = 'y %';
|
|
5
6
|
const validAscii = (str) => {
|
|
6
7
|
return str.replace(
|
|
@@ -8,7 +9,7 @@ const validAscii = (str) => {
|
|
|
8
9
|
/[^A-Za-z 0-9 \.,\?""!@#\$%\^&\*\(\)-_=\+;:<>\/\\\|\}\{\[\]`~]*/g, '');
|
|
9
10
|
};
|
|
10
11
|
const sanitizeError = (err) => {
|
|
11
|
-
if (err && err.message) {
|
|
12
|
+
if ((0, util_1.isDefined)(err) && err.message) {
|
|
12
13
|
const lowercaseMsg = err.message.toLowerCase();
|
|
13
14
|
if (lowercaseMsg.includes('quorum') ||
|
|
14
15
|
lowercaseMsg.includes('could not connect to')) {
|
package/dist/utils/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/utils/error.ts"],"names":[],"mappings":";;;AAAA,MAAM,uCAAuC,GAAG,KAAK,CAAC;AAEtD,MAAM,UAAU,GAAG,CAAC,GAAW,EAAE,EAAE;IACjC,OAAO,GAAG,CAAC,OAAO;IAChB,6CAA6C;IAC7C,iEAAiE,EACjE,EAAE,CACH,CAAC;AACJ,CAAC,CAAC;AAEK,MAAM,aAAa,GAAG,CAAC,GAAU,EAAS,EAAE;IACjD,IAAI,GAAG,IAAI,GAAG,CAAC,OAAO,EAAE;
|
|
1
|
+
{"version":3,"file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AAK,CACd,+GAA+G,CAChH,CAAC;aACH;YACD,IAAI,YAAY,CAAC,QAAQ,CAAC,uBAAuB,CAAC,EAAE;gBAClD,OAAO,IAAI,KAAK,CACd,gGAAgG,CACjG,CAAC;aACH;YACD,IAAI,YAAY,CAAC,QAAQ,CAAC,qBAAqB,CAAC,EAAE;gBAChD,OAAO,IAAI,KAAK,CACd,4EAA4E,CAC7E,CAAC;aACH;SACF;QAED,OAAO,IAAI,KAAK,CACd,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,OAAO,CAC7B,IAAI,uCAAuC,EAAE,EAC7C,IAAI,CACL,CACF,CAAC;KACH;IAED,OAAO,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;AACvD,CAAC,CAAC;AA5GW,QAAA,aAAa,iBA4GxB","sourcesContent":["import { isDefined } from './util';\n\nconst STRING_PREFIX_AFTER_UNICODE_REPLACEMENT = 'y %';\n\nconst validAscii = (str: string) => {\n return str.replace(\n // eslint-disable-next-line no-useless-escape\n /[^A-Za-z 0-9 \\.,\\?\"\"!@#\\$%\\^&\\*\\(\\)-_=\\+;:<>\\/\\\\\\|\\}\\{\\[\\]`~]*/g,\n '',\n );\n};\n\nexport const sanitizeError = (err: Error): Error => {\n if (isDefined(err) && err.message) {\n const lowercaseMsg = err.message.toLowerCase();\n if (\n lowercaseMsg.includes('quorum') ||\n lowercaseMsg.includes('could not connect to')\n ) {\n return new Error('Could not connect.');\n }\n if (lowercaseMsg.includes('call revert exception')) {\n return new Error('Failed to connect to RPC.');\n }\n if (lowercaseMsg.includes('missing revert data')) {\n return new Error('RPC connection error.');\n }\n if (\n lowercaseMsg.includes(\n 'transaction may fail or may require manual gas limit',\n )\n ) {\n return new Error('Unknown error. Transaction failed.');\n }\n if (lowercaseMsg.includes('replacement fee too low')) {\n return new Error(\n 'Nonce is used in a pending transaction, and replacement fee is too low. Please increase your network fee to replace the pending transaction.',\n );\n }\n if (lowercaseMsg.includes('intrinsic gas too low')) {\n return new Error(\n 'Gas price rejected. Please select a higher gas price or resubmit.',\n );\n }\n if (lowercaseMsg.includes('transaction underpriced')) {\n return new Error(\n 'Gas fee too low. Please select a higher gas price and resubmit.',\n );\n }\n if (lowercaseMsg.includes('insufficient funds for intrinsic')) {\n return new Error('Insufficient gas to process transaction.');\n }\n if (lowercaseMsg.includes('nonce has already been used')) {\n return new Error(\n // Do not change 'Nonce already used' string of Error message.\n 'Nonce already used: the transaction was already completed.',\n );\n }\n if (lowercaseMsg.includes('error while dialing dial tcp')) {\n return new Error(\n 'Error while connecting to RPC provider. Please try again.',\n );\n }\n\n // Custom RAILGUN contract error messages\n if (lowercaseMsg.includes('railgunsmartwallet')) {\n if (lowercaseMsg.includes('invalid nft note value')) {\n return new Error('RailgunSmartWallet: Invalid NFT Note Value.');\n }\n if (lowercaseMsg.includes('unsupported token')) {\n return new Error(\n 'RailgunSmartWallet: Unsupported Token. This token cannot interact with the RAILGUN contract.',\n );\n }\n if (lowercaseMsg.includes('invalid note value')) {\n return new Error(\n 'RailgunSmartWallet: Invalid Note Value. Please submit transaction with a corrected amount.',\n );\n }\n if (lowercaseMsg.includes('invalid adapt contract as sender')) {\n return new Error(\n 'RailgunSmartWallet: Invalid Adapt Contract as Sender. Please update your frontend to current Adapt module versions.',\n );\n }\n if (lowercaseMsg.includes('invalid merkle root')) {\n return new Error(\n 'RailgunSmartWallet: Invalid Merkle Root. Please sync your balances and try again.',\n );\n }\n if (lowercaseMsg.includes('note already spent')) {\n return new Error(\n 'RailgunSmartWallet: Note Already Spent. Please sync your balances and try again.',\n );\n }\n if (lowercaseMsg.includes('invalid note ciphertext array length')) {\n return new Error(\n 'RailgunSmartWallet: Invalid Note Ciphertext Array Length. Please sync balances and re-prove your transaction.',\n );\n }\n if (lowercaseMsg.includes('invalid withdraw note')) {\n return new Error(\n 'RailgunSmartWallet: Invalid Unshield Note. Please sync balances and re-prove your transaction.',\n );\n }\n if (lowercaseMsg.includes('invalid snark proof')) {\n return new Error(\n 'RailgunSmartWallet: Invalid Snark Proof. Please re-prove your transaction.',\n );\n }\n }\n\n return new Error(\n validAscii(err.message).replace(\n `:${STRING_PREFIX_AFTER_UNICODE_REPLACEMENT}`,\n ': ',\n ),\n );\n }\n\n return new Error('Unknown error. Please try again.');\n};\n"]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { FallbackProvider } from 'ethers';
|
|
2
|
-
export
|
|
2
|
+
export type FallbackProviderJsonConfig = {
|
|
3
3
|
chainId: number;
|
|
4
4
|
providers: ProviderJson[];
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type ProviderJson = {
|
|
7
7
|
priority: number;
|
|
8
8
|
weight: number;
|
|
9
9
|
provider: string;
|
|
10
10
|
stallTimeout?: number;
|
|
11
|
-
|
|
11
|
+
maxLogsPerBatch?: number;
|
|
12
12
|
};
|
|
13
13
|
export declare const createFallbackProviderFromJsonConfig: (config: FallbackProviderJsonConfig) => FallbackProvider;
|
|
@@ -10,11 +10,11 @@ const createFallbackProviderFromJsonConfig = (config) => {
|
|
|
10
10
|
throw new Error('Total weight across providers must be >= 2 for fallback quorum.');
|
|
11
11
|
}
|
|
12
12
|
const network = ethers_1.Network.from(Number(config.chainId));
|
|
13
|
-
const providers = config.providers.map(({ provider: providerURL, priority, weight, stallTimeout,
|
|
13
|
+
const providers = config.providers.map(({ provider: providerURL, priority, weight, stallTimeout, maxLogsPerBatch, }) => {
|
|
14
14
|
const isWebsocket = providerURL.startsWith('wss');
|
|
15
15
|
const provider = isWebsocket
|
|
16
16
|
? new ethers_1.WebSocketProvider(providerURL, network)
|
|
17
|
-
: new configured_json_rpc_provider_1.ConfiguredJsonRpcProvider(providerURL, network,
|
|
17
|
+
: new configured_json_rpc_provider_1.ConfiguredJsonRpcProvider(providerURL, network, maxLogsPerBatch);
|
|
18
18
|
const fallbackProviderConfig = {
|
|
19
19
|
provider,
|
|
20
20
|
priority,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fallback-provider.js","sourceRoot":"","sources":["../../src/utils/fallback-provider.ts"],"names":[],"mappings":";;;AAAA,mCAAsE;AACtE,iFAA2E;
|
|
1
|
+
{"version":3,"file":"fallback-provider.js","sourceRoot":"","sources":["../../src/utils/fallback-provider.ts"],"names":[],"mappings":";;;AAAA,mCAAsE;AACtE,iFAA2E;AAgBpE,MAAM,oCAAoC,GAAG,CAClD,MAAkC,EAChB,EAAE;IACpB,IAAI;QACF,MAAM,WAAW,GAAG,MAAM,CAAC,SAAS,CAAC,MAAM,CACzC,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,GAAG,MAAM,EACjC,CAAC,CACF,CAAC;QACF,IAAI,WAAW,GAAG,CAAC,EAAE;YACnB,MAAM,IAAI,KAAK,CACb,iEAAiE,CAClE,CAAC;SACH;QAED,MAAM,OAAO,GAAG,gBAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QAErD,MAAM,SAAS,GAA6B,MAAM,CAAC,SAAS,CAAC,GAAG,CAC9D,CAAC,EACC,QAAQ,EAAE,WAAW,EACrB,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,eAAe,GAChB,EAAE,EAAE;YACH,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAClD,MAAM,QAAQ,GAAG,WAAW;gBAC1B,CAAC,CAAC,IAAI,0BAAiB,CAAC,WAAW,EAAE,OAAO,CAAC;gBAC7C,CAAC,CAAC,IAAI,wDAAyB,CAC3B,WAAW,EACX,OAAO,EACP,eAAe,CAChB,CAAC;YAEN,MAAM,sBAAsB,GAA2B;gBACrD,QAAQ;gBACR,QAAQ;gBACR,MAAM;gBACN,YAAY;aACb,CAAC;YACF,OAAO,sBAAsB,CAAC;QAChC,CAAC,CACF,CAAC;QAEF,OAAO,IAAI,yBAAgB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;KACjD;IAAC,OAAO,GAAG,EAAE;QACZ,IAAI,CAAC,CAAC,GAAG,YAAY,KAAK,CAAC,EAAE;YAC3B,MAAM,GAAG,CAAC;SACX;QACD,MAAM,IAAI,KAAK,CACb,8CAA8C,MAAM,CAAC,OAAO,KAAK,GAAG,CAAC,OAAO,EAAE,CAC/E,CAAC;KACH;AACH,CAAC,CAAC;AApDW,QAAA,oCAAoC,wCAoD/C","sourcesContent":["import { FallbackProvider, Network, WebSocketProvider } from 'ethers';\nimport { ConfiguredJsonRpcProvider } from './configured-json-rpc-provider';\nimport { FallbackProviderConfig } from 'ethers/lib.commonjs/providers/provider-fallback';\n\nexport type FallbackProviderJsonConfig = {\n chainId: number;\n providers: ProviderJson[];\n};\n\nexport type ProviderJson = {\n priority: number;\n weight: number;\n provider: string;\n stallTimeout?: number;\n maxLogsPerBatch?: number;\n};\n\nexport const createFallbackProviderFromJsonConfig = (\n config: FallbackProviderJsonConfig,\n): FallbackProvider => {\n try {\n const totalWeight = config.providers.reduce(\n (acc, { weight }) => acc + weight,\n 0,\n );\n if (totalWeight < 2) {\n throw new Error(\n 'Total weight across providers must be >= 2 for fallback quorum.',\n );\n }\n\n const network = Network.from(Number(config.chainId));\n\n const providers: FallbackProviderConfig[] = config.providers.map(\n ({\n provider: providerURL,\n priority,\n weight,\n stallTimeout,\n maxLogsPerBatch,\n }) => {\n const isWebsocket = providerURL.startsWith('wss');\n const provider = isWebsocket\n ? new WebSocketProvider(providerURL, network)\n : new ConfiguredJsonRpcProvider(\n providerURL,\n network,\n maxLogsPerBatch,\n );\n\n const fallbackProviderConfig: FallbackProviderConfig = {\n provider,\n priority,\n weight,\n stallTimeout,\n };\n return fallbackProviderConfig;\n },\n );\n\n return new FallbackProvider(providers, network);\n } catch (err) {\n if (!(err instanceof Error)) {\n throw err;\n }\n throw new Error(\n `Invalid fallback provider config for chain ${config.chainId}: ${err.message}`,\n );\n }\n};\n"]}
|
package/dist/utils/versions.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.versionCompare = void 0;
|
|
4
|
+
const util_1 = require("./util");
|
|
4
5
|
const versionCompare = (appVersion, minVersion) => {
|
|
5
|
-
if (!appVersion || !minVersion) {
|
|
6
|
+
if (!(0, util_1.isDefined)(appVersion) || !(0, util_1.isDefined)(minVersion)) {
|
|
6
7
|
throw new Error('Requires two version numbers to compare.');
|
|
7
8
|
}
|
|
8
9
|
// Adapted from https://stackoverflow.com/a/6832721
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../src/utils/versions.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../src/utils/versions.ts"],"names":[],"mappings":";;;AAAA,iCAAmC;AAE5B,MAAM,cAAc,GAAG,CAC5B,UAAmB,EACnB,UAAmB,EACX,EAAE;IACV,IAAI,CAAC,IAAA,gBAAS,EAAC,UAAU,CAAC,IAAI,CAAC,IAAA,gBAAS,EAAC,UAAU,CAAC,EAAE;QACpD,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;KAC7D;IAED,mDAAmD;IACnD,MAAM,UAAU,GAAG,IAAI,EACrB,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,EAC/B,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAElC,SAAS,WAAW,CAAC,CAAS;QAC5B,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE;QAC9D,OAAO,GAAG,CAAC;KACZ;IACD,IAAI,UAAU,EAAE;QACd,OAAO,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE;YACtC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACnB;QACD,OAAO,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE;YACtC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACnB;KACF;IAED,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAE3C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;QAC9C,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;YAC/B,OAAO,CAAC,CAAC;SACV;QACD,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,cAAc,CAAC,CAAC,CAAC,EAAE;YAC3C,SAAS;SACV;aAAM,IAAI,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE;YAChD,OAAO,CAAC,CAAC;SACV;aAAM;YACL,OAAO,CAAC,CAAC,CAAC;SACX;KACF;IACD,IAAI,cAAc,CAAC,MAAM,KAAK,cAAc,CAAC,MAAM,EAAE;QACnD,OAAO,CAAC,CAAC,CAAC;KACX;IACD,OAAO,CAAC,CAAC;AACX,CAAC,CAAC;AAhDW,QAAA,cAAc,kBAgDzB","sourcesContent":["import { isDefined } from './util';\n\nexport const versionCompare = (\n appVersion?: string,\n minVersion?: string,\n): number => {\n if (!isDefined(appVersion) || !isDefined(minVersion)) {\n throw new Error('Requires two version numbers to compare.');\n }\n\n // Adapted from https://stackoverflow.com/a/6832721\n const zeroExtend = true,\n v1parts = appVersion.split('.'),\n v2parts = minVersion.split('.');\n\n function isValidPart(x: string) {\n return /^\\d+$/.test(x);\n }\n\n if (!v1parts.every(isValidPart) || !v2parts.every(isValidPart)) {\n return NaN;\n }\n if (zeroExtend) {\n while (v1parts.length < v2parts.length) {\n v1parts.push('0');\n }\n while (v2parts.length < v1parts.length) {\n v2parts.push('0');\n }\n }\n\n const v1parts_number = v1parts.map(Number);\n const v2parts_number = v2parts.map(Number);\n\n for (let i = 0; i < v1parts_number.length; ++i) {\n if (v2parts_number.length === i) {\n return 1;\n }\n if (v1parts_number[i] === v2parts_number[i]) {\n continue;\n } else if (v1parts_number[i] > v2parts_number[i]) {\n return 1;\n } else {\n return -1;\n }\n }\n if (v1parts_number.length !== v2parts_number.length) {\n return -1;\n }\n return 0;\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@railgun-community/shared-models",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -26,22 +26,22 @@
|
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"ethers": "^6.5.1",
|
|
29
|
-
"@types/chai": "
|
|
29
|
+
"@types/chai": "4.3.5",
|
|
30
30
|
"@types/chai-as-promised": "^7.1.5",
|
|
31
31
|
"@types/mocha": "^10.0.1",
|
|
32
|
-
"@types/node": "
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "
|
|
34
|
-
"@typescript-eslint/parser": "
|
|
32
|
+
"@types/node": "20.3.1",
|
|
33
|
+
"@typescript-eslint/eslint-plugin": "5.60.0",
|
|
34
|
+
"@typescript-eslint/parser": "5.60.0",
|
|
35
35
|
"chai": "^4.3.7",
|
|
36
36
|
"chai-as-promised": "^7.1.1",
|
|
37
|
-
"eslint": "
|
|
37
|
+
"eslint": "8.43.0",
|
|
38
38
|
"eslint-config-prettier": "^8.5.0",
|
|
39
39
|
"eslint-plugin-flowtype": "^8.0.3",
|
|
40
40
|
"eslint-plugin-import": "^2.26.0",
|
|
41
|
-
"madge": "
|
|
41
|
+
"madge": "6.1.0",
|
|
42
42
|
"mocha": "^10.2.0",
|
|
43
43
|
"ts-node": "^10.9.1",
|
|
44
44
|
"tsc-alias": "^1.8.2",
|
|
45
|
-
"typescript": "
|
|
45
|
+
"typescript": "5.1.3"
|
|
46
46
|
}
|
|
47
47
|
}
|