@railgun-community/shared-models 4.1.2 → 4.1.4

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.
@@ -168,8 +168,15 @@ declare type ReceiveAdditionalData = {
168
168
  };
169
169
  export declare type RailgunReceiveERC20Amount = RailgunERC20Amount & ReceiveAdditionalData;
170
170
  export declare type RailgunReceiveNFTAmount = RailgunNFTAmount & ReceiveAdditionalData;
171
+ export declare enum TransactionHistoryItemCategory {
172
+ Shield = "Shield",
173
+ Unshield = "Unshield",
174
+ Transfer = "Transfer",
175
+ Unknown = "Unknown"
176
+ }
171
177
  export declare type TransactionHistoryItem = {
172
178
  txid: string;
179
+ version: number;
173
180
  receiveERC20Amounts: RailgunReceiveERC20Amount[];
174
181
  transferERC20Amounts: RailgunSendERC20Amount[];
175
182
  changeERC20Amounts: RailgunERC20Amount[];
@@ -178,7 +185,7 @@ export declare type TransactionHistoryItem = {
178
185
  receiveNFTAmounts: RailgunReceiveNFTAmount[];
179
186
  transferNFTAmounts: RailgunSendNFTAmount[];
180
187
  unshieldNFTAmounts: RailgunUnshieldNFTAmount[];
181
- version: number;
188
+ category: TransactionHistoryItemCategory;
182
189
  };
183
190
  export declare type TransactionHistorySerializedResponse = {
184
191
  items?: TransactionHistoryItem[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  exports.__esModule = true;
3
- exports.NFTTokenType = exports.ChainType = exports.EVMGasType = void 0;
3
+ exports.TransactionHistoryItemCategory = exports.NFTTokenType = exports.ChainType = exports.EVMGasType = void 0;
4
4
  /**
5
5
  * Type0 / Type1 = non-EIP-1559 (gasPrice).
6
6
  * Type2 = EIP-1559 (maxFeePerGas and maxPriorityFeePerGas).
@@ -23,4 +23,11 @@ var NFTTokenType;
23
23
  NFTTokenType[NFTTokenType["ERC721"] = 1] = "ERC721";
24
24
  NFTTokenType[NFTTokenType["ERC1155"] = 2] = "ERC1155";
25
25
  })(NFTTokenType = exports.NFTTokenType || (exports.NFTTokenType = {}));
26
+ var TransactionHistoryItemCategory;
27
+ (function (TransactionHistoryItemCategory) {
28
+ TransactionHistoryItemCategory["Shield"] = "Shield";
29
+ TransactionHistoryItemCategory["Unshield"] = "Unshield";
30
+ TransactionHistoryItemCategory["Transfer"] = "Transfer";
31
+ TransactionHistoryItemCategory["Unknown"] = "Unknown";
32
+ })(TransactionHistoryItemCategory = exports.TransactionHistoryItemCategory || (exports.TransactionHistoryItemCategory = {}));
26
33
  //# sourceMappingURL=response-types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"response-types.js","sourceRoot":"","sources":["../../src/models/response-types.ts"],"names":[],"mappings":";;;AASA;;;GAGG;AACH,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,6CAAS,CAAA;IACT,6CAAS,CAAA;IACT,6CAAS,CAAA;AACX,CAAC,EAJW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAIrB;AA0DD,IAAY,SAEX;AAFD,WAAY,SAAS;IACnB,uCAAO,CAAA;AACT,CAAC,EAFW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAEpB;AA6ED;;GAEG;AACH,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,mDAAU,CAAA;IACV,qDAAW,CAAA;AACb,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB","sourcesContent":["import { BigNumber } from '@ethersproject/bignumber';\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: 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 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 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 RailgunProveTransactionResponse = {\n error?: string;\n};\n\nexport declare type RailgunTxidFromNullifiersResponse = {\n txid?: string;\n error?: string;\n};\n\nexport type RailgunPopulateTransactionResponse = {\n serializedTransaction?: string;\n nullifiers?: string[];\n error?: string;\n};\n\nexport type RailgunTransactionGasEstimateResponse = {\n gasEstimateString?: string;\n error?: string;\n};\n\nexport type RailgunERC20Amount = {\n tokenAddress: string;\n amountString: string;\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 RailgunNFTAmount = {\n nftAddress: string;\n nftTokenType: NFTTokenType;\n tokenSubID: string;\n amountString: string;\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 ValidateCachedProvedTransactionResponse = {\n isValid: boolean;\n error?: 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 type TransactionHistoryItem = {\n txid: string;\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 version: number;\n};\n\nexport type TransactionHistorySerializedResponse = {\n items?: TransactionHistoryItem[];\n error?: string;\n};\n"]}
1
+ {"version":3,"file":"response-types.js","sourceRoot":"","sources":["../../src/models/response-types.ts"],"names":[],"mappings":";;;AASA;;;GAGG;AACH,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,6CAAS,CAAA;IACT,6CAAS,CAAA;IACT,6CAAS,CAAA;AACX,CAAC,EAJW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAIrB;AA0DD,IAAY,SAEX;AAFD,WAAY,SAAS;IACnB,uCAAO,CAAA;AACT,CAAC,EAFW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAEpB;AA6ED;;GAEG;AACH,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,mDAAU,CAAA;IACV,qDAAW,CAAA;AACb,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB;AA+DD,IAAY,8BAKX;AALD,WAAY,8BAA8B;IACxC,mDAAiB,CAAA;IACjB,uDAAqB,CAAA;IACrB,uDAAqB,CAAA;IACrB,qDAAmB,CAAA;AACrB,CAAC,EALW,8BAA8B,GAA9B,sCAA8B,KAA9B,sCAA8B,QAKzC","sourcesContent":["import { BigNumber } from '@ethersproject/bignumber';\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: 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 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 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 RailgunProveTransactionResponse = {\n error?: string;\n};\n\nexport declare type RailgunTxidFromNullifiersResponse = {\n txid?: string;\n error?: string;\n};\n\nexport type RailgunPopulateTransactionResponse = {\n serializedTransaction?: string;\n nullifiers?: string[];\n error?: string;\n};\n\nexport type RailgunTransactionGasEstimateResponse = {\n gasEstimateString?: string;\n error?: string;\n};\n\nexport type RailgunERC20Amount = {\n tokenAddress: string;\n amountString: string;\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 RailgunNFTAmount = {\n nftAddress: string;\n nftTokenType: NFTTokenType;\n tokenSubID: string;\n amountString: string;\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 ValidateCachedProvedTransactionResponse = {\n isValid: boolean;\n error?: 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 Shield = 'Shield',\n Unshield = 'Unshield',\n Transfer = 'Transfer',\n Unknown = 'Unknown',\n}\n\nexport type TransactionHistoryItem = {\n txid: string;\n version: 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\nexport type TransactionHistorySerializedResponse = {\n items?: TransactionHistoryItem[];\n error?: string;\n};\n"]}
@@ -1,4 +1,5 @@
1
1
  export * from './artifact-v2';
2
+ export * from './available-rpc';
2
3
  export * from './compare';
3
4
  export * from './fallback-provider';
4
5
  export * from './error';
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  exports.__esModule = true;
17
17
  __exportStar(require("./artifact-v2"), exports);
18
+ __exportStar(require("./available-rpc"), exports);
18
19
  __exportStar(require("./compare"), exports);
19
20
  __exportStar(require("./fallback-provider"), exports);
20
21
  __exportStar(require("./error"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,4CAA0B;AAC1B,sDAAoC;AACpC,0CAAwB;AACxB,2CAAyB;AACzB,wCAAsB;AACtB,4CAA0B;AAC1B,6CAA2B;AAC3B,+CAA6B;AAC7B,6CAA2B","sourcesContent":["export * from './artifact-v2';\nexport * from './compare';\nexport * from './fallback-provider';\nexport * from './error';\nexport * from './format';\nexport * from './gas';\nexport * from './network';\nexport * from './promises';\nexport * from './serializer';\nexport * from './versions';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,kDAAgC;AAChC,4CAA0B;AAC1B,sDAAoC;AACpC,0CAAwB;AACxB,2CAAyB;AACzB,wCAAsB;AACtB,4CAA0B;AAC1B,6CAA2B;AAC3B,+CAA6B;AAC7B,6CAA2B","sourcesContent":["export * from './artifact-v2';\nexport * from './available-rpc';\nexport * from './compare';\nexport * from './fallback-provider';\nexport * from './error';\nexport * from './format';\nexport * from './gas';\nexport * from './network';\nexport * from './promises';\nexport * from './serializer';\nexport * from './versions';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@railgun-community/shared-models",
3
- "version": "4.1.2",
3
+ "version": "4.1.4",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "files": [