@avalabs/vm-module-types 0.0.22 → 0.1.0

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.
Files changed (48) hide show
  1. package/LICENSE +9 -0
  2. package/dist/account.cjs +12 -0
  3. package/dist/account.cjs.map +1 -0
  4. package/dist/account.d.cts +34 -0
  5. package/dist/account.d.ts +34 -0
  6. package/dist/account.js +3 -0
  7. package/dist/account.js.map +1 -0
  8. package/dist/balance.d.cts +4 -5
  9. package/dist/balance.d.ts +4 -5
  10. package/dist/{chunk-H6ZZE5M7.js → chunk-7JLXTNPE.js} +1 -1
  11. package/dist/chunk-7JLXTNPE.js.map +1 -0
  12. package/dist/{chunk-BFBDZPL3.cjs → chunk-B6DAZDIA.cjs} +1 -1
  13. package/dist/chunk-B6DAZDIA.cjs.map +1 -0
  14. package/dist/chunk-RIBT5FN6.js +5 -0
  15. package/dist/chunk-RIBT5FN6.js.map +1 -0
  16. package/dist/chunk-TCBFAMPS.cjs +7 -0
  17. package/dist/chunk-TCBFAMPS.cjs.map +1 -0
  18. package/dist/coingecko.d.cts +4 -4
  19. package/dist/coingecko.d.ts +4 -4
  20. package/dist/index.cjs +18 -13
  21. package/dist/index.d.cts +1 -1
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.js +3 -2
  24. package/dist/module.d.cts +2 -2
  25. package/dist/module.d.ts +2 -2
  26. package/dist/transaction-history.cjs +4 -4
  27. package/dist/transaction-history.d.cts +1 -1
  28. package/dist/transaction-history.d.ts +1 -1
  29. package/dist/transaction-history.js +1 -1
  30. package/package.json +6 -1
  31. package/.turbo/turbo-build.log +0 -130
  32. package/.turbo/turbo-lint.log +0 -4
  33. package/CHANGELOG.md +0 -102
  34. package/dist/chunk-BFBDZPL3.cjs.map +0 -1
  35. package/dist/chunk-H6ZZE5M7.js.map +0 -1
  36. package/src/balance.ts +0 -146
  37. package/src/coingecko.ts +0 -15
  38. package/src/common.ts +0 -43
  39. package/src/index.ts +0 -10
  40. package/src/manifest.ts +0 -40
  41. package/src/module.ts +0 -17
  42. package/src/network-fee.ts +0 -7
  43. package/src/rpc.ts +0 -157
  44. package/src/token.ts +0 -52
  45. package/src/transaction-history.ts +0 -113
  46. package/src/transaction-simulation.ts +0 -29
  47. package/tsconfig.json +0 -8
  48. package/tsup.config.ts +0 -4
package/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ Copyright (C) 2021, Ava Labs, Inc. All rights reserved.
2
+
3
+ Subject to the limited license below (**”License””), you may not, and you may not permit anyone else to, copy, reproduce, aggregate, republish, download, post, distribute, license, sublicense, reverse engineer, modify, or create derivative works based on this software (collectively, **“Software”**).
4
+
5
+ You are hereby granted a limited, non-exclusive, non-sublicensable and non-transferable license to download and use the Software as-is solely (i) for use in connection with the Avalanche Public Blockchain platform, having a NetworkID of 1 (Mainnet) or 5 (Fuji), and associated blockchains, comprised exclusively of the Avalanche X-Chain, C-Chain, P-Chain and any subnets linked to the P-Chain (**“Avalanche Authorized Platform”**) or (ii) for non-production, testing or research purposes without any commercial application within the Avalanche ecosystem (**“Non-Commercial Use”**); provided that, in each case, you may not use or allow use of the Software (a) in connection with any forks of the Avalanche Authorized Platform, (b) in any manner not operationally connected to the Avalanche Authorized Platform other than for Non-Commercial Use, or (c) to the extent the number of monthly active users or the number of total installs of any software that uses the Software across all versions thereof exceeds 10,000 at any time. You may not modify or alter the Software in any way.
6
+
7
+ You hereby acknowledge and agree to the terms set forth at www.avalabs.org/important-notice.
8
+
9
+ **TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED ON AN “AS IS” BASIS, AND AVA LABS EXPRESSLY DISCLAIMS AND EXCLUDES ALL REPRESENTATIONS, WARRANTIES AND OTHER TERMS AND CONDITIONS, WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION BY OPERATION OF LAW OR BY CUSTOM, STATUTE OR OTHERWISE, AND INCLUDING, BUT NOT LIMITED TO, ANY IMPLIED WARRANTY, TERM, OR CONDITION OF NON-INFRINGEMENT, MERCHANTABILITY, TITLE, OR FITNESS FOR PARTICULAR PURPOSE. YOU USE THE SOFTWARE AT YOUR OWN RISK. AVA LABS EXPRESSLY DISCLAIMS ALL LIABILITY (INCLUDING FOR ALL DIRECT, CONSEQUENTIAL OR OTHER DAMAGES OR LOSSES) RELATED TO ANY USE OF THE SOFTWARE.**
@@ -0,0 +1,12 @@
1
+ 'use strict';
2
+
3
+ var chunkTCBFAMPS_cjs = require('./chunk-TCBFAMPS.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, 'WalletType', {
8
+ enumerable: true,
9
+ get: function () { return chunkTCBFAMPS_cjs.a; }
10
+ });
11
+ //# sourceMappingURL=out.js.map
12
+ //# sourceMappingURL=account.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,34 @@
1
+ declare enum WalletType {
2
+ Mnemonic = "mnemonic",
3
+ Ledger = "ledger",
4
+ LedgerLive = "ledger-live",
5
+ Keystone = "keystone",
6
+ Seedless = "seedless"
7
+ }
8
+ type GetAddressParams = {
9
+ walletType: WalletType;
10
+ accountIndex: number;
11
+ xpub: string;
12
+ xpubXP?: string;
13
+ isTestnet?: boolean;
14
+ };
15
+ type GetAddressResponse = Record<string, string>;
16
+ type PubKeyType = {
17
+ evm: string;
18
+ /**
19
+ * Public keys used for X/P chain are from a different derivation path.
20
+ */
21
+ xp?: string;
22
+ btcWalletPolicyDetails?: BtcWalletPolicyDetails;
23
+ };
24
+ type BtcWalletPolicyDetails = {
25
+ hmacHex: string;
26
+ /**
27
+ * Extended public key of m/44'/60'/n
28
+ */
29
+ xpub: string;
30
+ masterFingerprint: string;
31
+ name: string;
32
+ };
33
+
34
+ export { BtcWalletPolicyDetails, GetAddressParams, GetAddressResponse, PubKeyType, WalletType };
@@ -0,0 +1,34 @@
1
+ declare enum WalletType {
2
+ Mnemonic = "mnemonic",
3
+ Ledger = "ledger",
4
+ LedgerLive = "ledger-live",
5
+ Keystone = "keystone",
6
+ Seedless = "seedless"
7
+ }
8
+ type GetAddressParams = {
9
+ walletType: WalletType;
10
+ accountIndex: number;
11
+ xpub: string;
12
+ xpubXP?: string;
13
+ isTestnet?: boolean;
14
+ };
15
+ type GetAddressResponse = Record<string, string>;
16
+ type PubKeyType = {
17
+ evm: string;
18
+ /**
19
+ * Public keys used for X/P chain are from a different derivation path.
20
+ */
21
+ xp?: string;
22
+ btcWalletPolicyDetails?: BtcWalletPolicyDetails;
23
+ };
24
+ type BtcWalletPolicyDetails = {
25
+ hmacHex: string;
26
+ /**
27
+ * Extended public key of m/44'/60'/n
28
+ */
29
+ xpub: string;
30
+ masterFingerprint: string;
31
+ name: string;
32
+ };
33
+
34
+ export { BtcWalletPolicyDetails, GetAddressParams, GetAddressResponse, PubKeyType, WalletType };
@@ -0,0 +1,3 @@
1
+ export { a as WalletType } from './chunk-RIBT5FN6.js';
2
+ //# sourceMappingURL=out.js.map
3
+ //# sourceMappingURL=account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -1,6 +1,5 @@
1
1
  import { Network, Storage } from './common.cjs';
2
2
  import { NetworkContractToken, TokenType, NetworkToken } from './token.cjs';
3
- import BN from 'bn.js';
4
3
  import { PChainBalance, XChainBalances } from '@avalabs/glacier-sdk';
5
4
 
6
5
  type GetBalancesParams = {
@@ -14,7 +13,7 @@ type TokenBalanceData = {
14
13
  type: TokenType;
15
14
  name: string;
16
15
  symbol: string;
17
- balance: BN;
16
+ balance: bigint;
18
17
  balanceDisplayValue: string;
19
18
  balanceInCurrency?: number;
20
19
  balanceCurrencyDisplayValue?: string;
@@ -63,7 +62,7 @@ interface TokenWithBalanceBTC extends NetworkTokenWithBalance {
63
62
  logoUri: string;
64
63
  utxos: BitcoinInputUTXOWithOptionalScript[];
65
64
  utxosUnconfirmed?: BitcoinInputUTXOWithOptionalScript[];
66
- unconfirmedBalance?: BN;
65
+ unconfirmedBalance?: bigint;
67
66
  unconfirmedBalanceDisplayValue?: string;
68
67
  unconfirmedBalanceCurrencyDisplayValue?: string;
69
68
  unconfirmedBalanceInCurrency?: number;
@@ -72,7 +71,7 @@ interface TokenWithBalanceBTC extends NetworkTokenWithBalance {
72
71
  * Avalanche TokenWithBalance interface.
73
72
  */
74
73
  interface TokenWithBalancePVM extends NetworkTokenWithBalance {
75
- available?: BN;
74
+ available?: bigint;
76
75
  availableInCurrency?: number;
77
76
  availableDisplayValue?: string;
78
77
  availableCurrencyDisplayValue?: string;
@@ -89,7 +88,7 @@ interface TokenWithBalancePVM extends NetworkTokenWithBalance {
89
88
  };
90
89
  }
91
90
  interface TokenWithBalanceAVM extends NetworkTokenWithBalance {
92
- available?: BN;
91
+ available?: bigint;
93
92
  availableInCurrency?: number;
94
93
  availableDisplayValue?: string;
95
94
  availableCurrencyDisplayValue?: string;
package/dist/balance.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { Network, Storage } from './common.js';
2
2
  import { NetworkContractToken, TokenType, NetworkToken } from './token.js';
3
- import BN from 'bn.js';
4
3
  import { PChainBalance, XChainBalances } from '@avalabs/glacier-sdk';
5
4
 
6
5
  type GetBalancesParams = {
@@ -14,7 +13,7 @@ type TokenBalanceData = {
14
13
  type: TokenType;
15
14
  name: string;
16
15
  symbol: string;
17
- balance: BN;
16
+ balance: bigint;
18
17
  balanceDisplayValue: string;
19
18
  balanceInCurrency?: number;
20
19
  balanceCurrencyDisplayValue?: string;
@@ -63,7 +62,7 @@ interface TokenWithBalanceBTC extends NetworkTokenWithBalance {
63
62
  logoUri: string;
64
63
  utxos: BitcoinInputUTXOWithOptionalScript[];
65
64
  utxosUnconfirmed?: BitcoinInputUTXOWithOptionalScript[];
66
- unconfirmedBalance?: BN;
65
+ unconfirmedBalance?: bigint;
67
66
  unconfirmedBalanceDisplayValue?: string;
68
67
  unconfirmedBalanceCurrencyDisplayValue?: string;
69
68
  unconfirmedBalanceInCurrency?: number;
@@ -72,7 +71,7 @@ interface TokenWithBalanceBTC extends NetworkTokenWithBalance {
72
71
  * Avalanche TokenWithBalance interface.
73
72
  */
74
73
  interface TokenWithBalancePVM extends NetworkTokenWithBalance {
75
- available?: BN;
74
+ available?: bigint;
76
75
  availableInCurrency?: number;
77
76
  availableDisplayValue?: string;
78
77
  availableCurrencyDisplayValue?: string;
@@ -89,7 +88,7 @@ interface TokenWithBalancePVM extends NetworkTokenWithBalance {
89
88
  };
90
89
  }
91
90
  interface TokenWithBalanceAVM extends NetworkTokenWithBalance {
92
- available?: BN;
91
+ available?: bigint;
93
92
  availableInCurrency?: number;
94
93
  availableDisplayValue?: string;
95
94
  availableCurrencyDisplayValue?: string;
@@ -2,4 +2,4 @@ var A=(r=>(r.BRIDGE="Bridge",r.SWAP="Swap",r.SEND="Send",r.RECEIVE="Receive",r.N
2
2
 
3
3
  export { A as a, o as b, E as c };
4
4
  //# sourceMappingURL=out.js.map
5
- //# sourceMappingURL=chunk-H6ZZE5M7.js.map
5
+ //# sourceMappingURL=chunk-7JLXTNPE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/transaction-history.ts"],"names":["TransactionType","PChainTransactionType","XChainTransactionType"],"mappings":"AAsEO,IAAKA,OACVA,EAAA,OAAS,SACTA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,QAAU,SACVA,EAAA,QAAU,UACVA,EAAA,SAAW,WACXA,EAAA,SAAW,UACXA,EAAA,YAAc,aACdA,EAAA,QAAU,UACVA,EAAA,WAAa,YACbA,EAAA,OAAS,SACTA,EAAA,QAAU,UAbAA,OAAA,IAgBAC,OACVA,EAAA,iBAAmB,iBACnBA,EAAA,wBAA0B,uBAC1BA,EAAA,iBAAmB,iBACnBA,EAAA,gBAAkB,gBAClBA,EAAA,iBAAmB,iBACnBA,EAAA,UAAY,WACZA,EAAA,UAAY,WACZA,EAAA,gBAAkB,gBAClBA,EAAA,oBAAsB,oBACtBA,EAAA,2BAA6B,0BAC7BA,EAAA,oBAAsB,oBACtBA,EAAA,gCAAkC,+BAClCA,EAAA,gCAAkC,+BAClCA,EAAA,QAAU,SACVA,EAAA,6BAA+B,4BAC/BA,EAAA,QAAU,UAhBAA,OAAA,IAmBAC,OACVA,EAAA,QAAU,SACVA,EAAA,gBAAkB,gBAClBA,EAAA,aAAe,cACfA,EAAA,UAAY,WACZA,EAAA,UAAY,WACZA,EAAA,QAAU,UANAA,OAAA","sourcesContent":["import type { Network } from './common';\nimport type { TokenType } from './token';\n\nexport type GetTransactionHistory = {\n network: Network;\n address: string;\n nextPageToken?: string;\n offset?: number;\n};\n\nexport type TransactionHistoryResponse = {\n transactions: Transaction[];\n nextPageToken?: string;\n};\n\nexport type Transaction = {\n isContractCall: boolean;\n isIncoming: boolean;\n isOutgoing: boolean;\n isSender: boolean;\n timestamp: number;\n hash: string;\n from: string;\n to: string;\n tokens: TxToken[];\n gasPrice?: string;\n gasUsed: string;\n txType?: TransactionType | PChainTransactionType | XChainTransactionType | 'CreateAssetTx' | 'OperationTx';\n chainId: string; // chainId from ActiveNetwork used to fetch tx\n method?: string;\n explorerLink: string;\n};\n\nexport interface TxToken {\n decimal?: string;\n name: string;\n symbol: string;\n amount: string;\n imageUri?: string;\n from?: TokenWithAddress;\n to?: TokenWithAddress;\n collectableTokenId?: string;\n type: TokenType;\n}\n\n// this is RichAddress from @avalabs/glacier-sdk,\n// rename it to TokenWithAddress for better understanding\ntype TokenWithAddress = {\n /**\n * The contract name.\n */\n name?: string;\n /**\n * The contract symbol.\n */\n symbol?: string;\n /**\n * The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation.\n */\n decimals?: number;\n /**\n * The logo uri for the address.\n */\n logoUri?: string;\n /**\n * A wallet or contract address in mixed-case checksum encoding.\n */\n address: string;\n};\n\nexport enum TransactionType {\n BRIDGE = 'Bridge',\n SWAP = 'Swap',\n SEND = 'Send',\n RECEIVE = 'Receive',\n NFT_BUY = 'NFTBuy',\n APPROVE = 'Approve',\n TRANSFER = 'Transfer',\n NFT_SEND = 'NFTSend',\n NFT_RECEIVE = 'NFTReceive',\n AIRDROP = 'Airdrop',\n FILL_ORDER = 'FillOrder',\n UNWRAP = 'Unwrap',\n UNKNOWN = 'UNKNOWN',\n}\n\nexport enum PChainTransactionType {\n ADD_VALIDATOR_TX = 'AddValidatorTx',\n ADD_SUBNET_VALIDATOR_TX = 'AddSubnetValidatorTx',\n ADD_DELEGATOR_TX = 'AddDelegatorTx',\n CREATE_CHAIN_TX = 'CreateChainTx',\n CREATE_SUBNET_TX = 'CreateSubnetTx',\n IMPORT_TX = 'ImportTx',\n EXPORT_TX = 'ExportTx',\n ADVANCE_TIME_TX = 'AdvanceTimeTx',\n REWARD_VALIDATOR_TX = 'RewardValidatorTx',\n REMOVE_SUBNET_VALIDATOR_TX = 'RemoveSubnetValidatorTx',\n TRANSFORM_SUBNET_TX = 'TransformSubnetTx',\n ADD_PERMISSIONLESS_VALIDATOR_TX = 'AddPermissionlessValidatorTx',\n ADD_PERMISSIONLESS_DELEGATOR_TX = 'AddPermissionlessDelegatorTx',\n BASE_TX = 'BaseTx',\n TRANSFER_SUBNET_OWNERSHIP_TX = 'TransferSubnetOwnershipTx',\n UNKNOWN = 'UNKNOWN',\n}\n\nexport enum XChainTransactionType {\n BASE_TX = 'BaseTx',\n CREATE_ASSET_TX = 'CreateAssetTx',\n OPERATION_TX = 'OperationTx',\n IMPORT_TX = 'ImportTx',\n EXPORT_TX = 'ExportTx',\n UNKNOWN = 'UNKNOWN',\n}\n"]}
@@ -6,4 +6,4 @@ exports.a = A;
6
6
  exports.b = o;
7
7
  exports.c = E;
8
8
  //# sourceMappingURL=out.js.map
9
- //# sourceMappingURL=chunk-BFBDZPL3.cjs.map
9
+ //# sourceMappingURL=chunk-B6DAZDIA.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/transaction-history.ts"],"names":["TransactionType","PChainTransactionType","XChainTransactionType"],"mappings":"AAsEO,IAAKA,OACVA,EAAA,OAAS,SACTA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,QAAU,SACVA,EAAA,QAAU,UACVA,EAAA,SAAW,WACXA,EAAA,SAAW,UACXA,EAAA,YAAc,aACdA,EAAA,QAAU,UACVA,EAAA,WAAa,YACbA,EAAA,OAAS,SACTA,EAAA,QAAU,UAbAA,OAAA,IAgBAC,OACVA,EAAA,iBAAmB,iBACnBA,EAAA,wBAA0B,uBAC1BA,EAAA,iBAAmB,iBACnBA,EAAA,gBAAkB,gBAClBA,EAAA,iBAAmB,iBACnBA,EAAA,UAAY,WACZA,EAAA,UAAY,WACZA,EAAA,gBAAkB,gBAClBA,EAAA,oBAAsB,oBACtBA,EAAA,2BAA6B,0BAC7BA,EAAA,oBAAsB,oBACtBA,EAAA,gCAAkC,+BAClCA,EAAA,gCAAkC,+BAClCA,EAAA,QAAU,SACVA,EAAA,6BAA+B,4BAC/BA,EAAA,QAAU,UAhBAA,OAAA,IAmBAC,OACVA,EAAA,QAAU,SACVA,EAAA,gBAAkB,gBAClBA,EAAA,aAAe,cACfA,EAAA,UAAY,WACZA,EAAA,UAAY,WACZA,EAAA,QAAU,UANAA,OAAA","sourcesContent":["import type { Network } from './common';\nimport type { TokenType } from './token';\n\nexport type GetTransactionHistory = {\n network: Network;\n address: string;\n nextPageToken?: string;\n offset?: number;\n};\n\nexport type TransactionHistoryResponse = {\n transactions: Transaction[];\n nextPageToken?: string;\n};\n\nexport type Transaction = {\n isContractCall: boolean;\n isIncoming: boolean;\n isOutgoing: boolean;\n isSender: boolean;\n timestamp: number;\n hash: string;\n from: string;\n to: string;\n tokens: TxToken[];\n gasPrice?: string;\n gasUsed: string;\n txType?: TransactionType | PChainTransactionType | XChainTransactionType | 'CreateAssetTx' | 'OperationTx';\n chainId: string; // chainId from ActiveNetwork used to fetch tx\n method?: string;\n explorerLink: string;\n};\n\nexport interface TxToken {\n decimal?: string;\n name: string;\n symbol: string;\n amount: string;\n imageUri?: string;\n from?: TokenWithAddress;\n to?: TokenWithAddress;\n collectableTokenId?: string;\n type: TokenType;\n}\n\n// this is RichAddress from @avalabs/glacier-sdk,\n// rename it to TokenWithAddress for better understanding\ntype TokenWithAddress = {\n /**\n * The contract name.\n */\n name?: string;\n /**\n * The contract symbol.\n */\n symbol?: string;\n /**\n * The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation.\n */\n decimals?: number;\n /**\n * The logo uri for the address.\n */\n logoUri?: string;\n /**\n * A wallet or contract address in mixed-case checksum encoding.\n */\n address: string;\n};\n\nexport enum TransactionType {\n BRIDGE = 'Bridge',\n SWAP = 'Swap',\n SEND = 'Send',\n RECEIVE = 'Receive',\n NFT_BUY = 'NFTBuy',\n APPROVE = 'Approve',\n TRANSFER = 'Transfer',\n NFT_SEND = 'NFTSend',\n NFT_RECEIVE = 'NFTReceive',\n AIRDROP = 'Airdrop',\n FILL_ORDER = 'FillOrder',\n UNWRAP = 'Unwrap',\n UNKNOWN = 'UNKNOWN',\n}\n\nexport enum PChainTransactionType {\n ADD_VALIDATOR_TX = 'AddValidatorTx',\n ADD_SUBNET_VALIDATOR_TX = 'AddSubnetValidatorTx',\n ADD_DELEGATOR_TX = 'AddDelegatorTx',\n CREATE_CHAIN_TX = 'CreateChainTx',\n CREATE_SUBNET_TX = 'CreateSubnetTx',\n IMPORT_TX = 'ImportTx',\n EXPORT_TX = 'ExportTx',\n ADVANCE_TIME_TX = 'AdvanceTimeTx',\n REWARD_VALIDATOR_TX = 'RewardValidatorTx',\n REMOVE_SUBNET_VALIDATOR_TX = 'RemoveSubnetValidatorTx',\n TRANSFORM_SUBNET_TX = 'TransformSubnetTx',\n ADD_PERMISSIONLESS_VALIDATOR_TX = 'AddPermissionlessValidatorTx',\n ADD_PERMISSIONLESS_DELEGATOR_TX = 'AddPermissionlessDelegatorTx',\n BASE_TX = 'BaseTx',\n TRANSFER_SUBNET_OWNERSHIP_TX = 'TransferSubnetOwnershipTx',\n UNKNOWN = 'UNKNOWN',\n}\n\nexport enum XChainTransactionType {\n BASE_TX = 'BaseTx',\n CREATE_ASSET_TX = 'CreateAssetTx',\n OPERATION_TX = 'OperationTx',\n IMPORT_TX = 'ImportTx',\n EXPORT_TX = 'ExportTx',\n UNKNOWN = 'UNKNOWN',\n}\n"]}
@@ -0,0 +1,5 @@
1
+ var t=(e=>(e.Mnemonic="mnemonic",e.Ledger="ledger",e.LedgerLive="ledger-live",e.Keystone="keystone",e.Seedless="seedless",e))(t||{});
2
+
3
+ export { t as a };
4
+ //# sourceMappingURL=out.js.map
5
+ //# sourceMappingURL=chunk-RIBT5FN6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/account.ts"],"names":["WalletType"],"mappings":"AAAO,IAAKA,OAEVA,EAAA,SAAW,WACXA,EAAA,OAAS,SACTA,EAAA,WAAa,cACbA,EAAA,SAAW,WACXA,EAAA,SAAW,WANDA,OAAA","sourcesContent":["export enum WalletType {\n // Primary wallet types\n Mnemonic = 'mnemonic',\n Ledger = 'ledger',\n LedgerLive = 'ledger-live',\n Keystone = 'keystone',\n Seedless = 'seedless',\n}\n\nexport type GetAddressParams = {\n walletType: WalletType;\n accountIndex: number;\n xpub: string;\n xpubXP?: string;\n isTestnet?: boolean;\n};\n\nexport type GetAddressResponse = Record<string, string>;\n\nexport type PubKeyType = {\n evm: string;\n /**\n * Public keys used for X/P chain are from a different derivation path.\n */\n xp?: string;\n btcWalletPolicyDetails?: BtcWalletPolicyDetails;\n};\n\nexport type BtcWalletPolicyDetails = {\n hmacHex: string;\n /**\n * Extended public key of m/44'/60'/n\n */\n xpub: string;\n masterFingerprint: string;\n name: string;\n};\n"]}
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ var t=(e=>(e.Mnemonic="mnemonic",e.Ledger="ledger",e.LedgerLive="ledger-live",e.Keystone="keystone",e.Seedless="seedless",e))(t||{});
4
+
5
+ exports.a = t;
6
+ //# sourceMappingURL=out.js.map
7
+ //# sourceMappingURL=chunk-TCBFAMPS.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/account.ts"],"names":["WalletType"],"mappings":"AAAO,IAAKA,OAEVA,EAAA,SAAW,WACXA,EAAA,OAAS,SACTA,EAAA,WAAa,cACbA,EAAA,SAAW,WACXA,EAAA,SAAW,WANDA,OAAA","sourcesContent":["export enum WalletType {\n // Primary wallet types\n Mnemonic = 'mnemonic',\n Ledger = 'ledger',\n LedgerLive = 'ledger-live',\n Keystone = 'keystone',\n Seedless = 'seedless',\n}\n\nexport type GetAddressParams = {\n walletType: WalletType;\n accountIndex: number;\n xpub: string;\n xpubXP?: string;\n isTestnet?: boolean;\n};\n\nexport type GetAddressResponse = Record<string, string>;\n\nexport type PubKeyType = {\n evm: string;\n /**\n * Public keys used for X/P chain are from a different derivation path.\n */\n xp?: string;\n btcWalletPolicyDetails?: BtcWalletPolicyDetails;\n};\n\nexport type BtcWalletPolicyDetails = {\n hmacHex: string;\n /**\n * Extended public key of m/44'/60'/n\n */\n xpub: string;\n masterFingerprint: string;\n name: string;\n};\n"]}
@@ -6,15 +6,15 @@ declare const SimplePriceResponseSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.
6
6
  marketCap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
7
7
  vol24: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
8
8
  }, "strip", z.ZodTypeAny, {
9
- price?: number | null | undefined;
10
- change24?: number | null | undefined;
11
9
  marketCap?: number | null | undefined;
10
+ change24?: number | null | undefined;
12
11
  vol24?: number | null | undefined;
13
- }, {
14
12
  price?: number | null | undefined;
15
- change24?: number | null | undefined;
13
+ }, {
16
14
  marketCap?: number | null | undefined;
15
+ change24?: number | null | undefined;
17
16
  vol24?: number | null | undefined;
17
+ price?: number | null | undefined;
18
18
  }>>>;
19
19
  type SimplePriceResponse = z.infer<typeof SimplePriceResponseSchema>;
20
20
  declare const RawSimplePriceResponseSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodNullable<z.ZodNumber>>>>;
@@ -6,15 +6,15 @@ declare const SimplePriceResponseSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.
6
6
  marketCap: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
7
7
  vol24: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
8
8
  }, "strip", z.ZodTypeAny, {
9
- price?: number | null | undefined;
10
- change24?: number | null | undefined;
11
9
  marketCap?: number | null | undefined;
10
+ change24?: number | null | undefined;
12
11
  vol24?: number | null | undefined;
13
- }, {
14
12
  price?: number | null | undefined;
15
- change24?: number | null | undefined;
13
+ }, {
16
14
  marketCap?: number | null | undefined;
15
+ change24?: number | null | undefined;
17
16
  vol24?: number | null | undefined;
17
+ price?: number | null | undefined;
18
18
  }>>>;
19
19
  type SimplePriceResponse = z.infer<typeof SimplePriceResponseSchema>;
20
20
  declare const RawSimplePriceResponseSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodNullable<z.ZodNumber>>>>;
package/dist/index.cjs CHANGED
@@ -1,33 +1,46 @@
1
1
  'use strict';
2
2
 
3
+ var chunkYVYCETG2_cjs = require('./chunk-YVYCETG2.cjs');
3
4
  var chunk2KGTZTXY_cjs = require('./chunk-2KGTZTXY.cjs');
4
- var chunkBFBDZPL3_cjs = require('./chunk-BFBDZPL3.cjs');
5
+ var chunkB6DAZDIA_cjs = require('./chunk-B6DAZDIA.cjs');
5
6
  require('./chunk-47KTBBRA.cjs');
7
+ var chunkTCBFAMPS_cjs = require('./chunk-TCBFAMPS.cjs');
6
8
  require('./chunk-JUV577XH.cjs');
7
9
  var chunk4PGCXP4C_cjs = require('./chunk-4PGCXP4C.cjs');
8
10
  var chunkVRQJHO4F_cjs = require('./chunk-VRQJHO4F.cjs');
9
11
  var chunk74SNNWSF_cjs = require('./chunk-74SNNWSF.cjs');
10
12
  require('./chunk-OGQBQHLH.cjs');
11
13
  require('./chunk-AILYKQEY.cjs');
12
- var chunkYVYCETG2_cjs = require('./chunk-YVYCETG2.cjs');
13
14
 
14
15
 
15
16
 
17
+ Object.defineProperty(exports, 'AlertType', {
18
+ enumerable: true,
19
+ get: function () { return chunkYVYCETG2_cjs.b; }
20
+ });
21
+ Object.defineProperty(exports, 'RpcMethod', {
22
+ enumerable: true,
23
+ get: function () { return chunkYVYCETG2_cjs.a; }
24
+ });
16
25
  Object.defineProperty(exports, 'TokenType', {
17
26
  enumerable: true,
18
27
  get: function () { return chunk2KGTZTXY_cjs.a; }
19
28
  });
20
29
  Object.defineProperty(exports, 'PChainTransactionType', {
21
30
  enumerable: true,
22
- get: function () { return chunkBFBDZPL3_cjs.b; }
31
+ get: function () { return chunkB6DAZDIA_cjs.b; }
23
32
  });
24
33
  Object.defineProperty(exports, 'TransactionType', {
25
34
  enumerable: true,
26
- get: function () { return chunkBFBDZPL3_cjs.a; }
35
+ get: function () { return chunkB6DAZDIA_cjs.a; }
27
36
  });
28
37
  Object.defineProperty(exports, 'XChainTransactionType', {
29
38
  enumerable: true,
30
- get: function () { return chunkBFBDZPL3_cjs.c; }
39
+ get: function () { return chunkB6DAZDIA_cjs.c; }
40
+ });
41
+ Object.defineProperty(exports, 'WalletType', {
42
+ enumerable: true,
43
+ get: function () { return chunkTCBFAMPS_cjs.a; }
31
44
  });
32
45
  Object.defineProperty(exports, 'RawSimplePriceResponseSchema', {
33
46
  enumerable: true,
@@ -49,13 +62,5 @@ Object.defineProperty(exports, 'parseManifest', {
49
62
  enumerable: true,
50
63
  get: function () { return chunk74SNNWSF_cjs.a; }
51
64
  });
52
- Object.defineProperty(exports, 'AlertType', {
53
- enumerable: true,
54
- get: function () { return chunkYVYCETG2_cjs.b; }
55
- });
56
- Object.defineProperty(exports, 'RpcMethod', {
57
- enumerable: true,
58
- get: function () { return chunkYVYCETG2_cjs.a; }
59
- });
60
65
  //# sourceMappingURL=out.js.map
61
66
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.cts CHANGED
@@ -8,8 +8,8 @@ export { Alert, AlertDetails, AlertType, ApprovalController, ApprovalParams, App
8
8
  export { ERC1155Token, ERC20Token, ERC721Token, NONERCToken, NetworkContractToken, NetworkToken, TokenType } from './token.cjs';
9
9
  export { GetTransactionHistory, PChainTransactionType, Transaction, TransactionHistoryResponse, TransactionType, TxToken, XChainTransactionType } from './transaction-history.cjs';
10
10
  export { BalanceChange, TokenApproval, TokenApprovals, TokenDiff, TokenDiffItem } from './transaction-simulation.cjs';
11
+ export { BtcWalletPolicyDetails, GetAddressParams, GetAddressResponse, PubKeyType, WalletType } from './account.cjs';
11
12
  import 'zod';
12
- import 'bn.js';
13
13
  import '@avalabs/glacier-sdk';
14
14
  import 'ethers';
15
15
  import '@metamask/rpc-errors';
package/dist/index.d.ts CHANGED
@@ -8,8 +8,8 @@ export { Alert, AlertDetails, AlertType, ApprovalController, ApprovalParams, App
8
8
  export { ERC1155Token, ERC20Token, ERC721Token, NONERCToken, NetworkContractToken, NetworkToken, TokenType } from './token.js';
9
9
  export { GetTransactionHistory, PChainTransactionType, Transaction, TransactionHistoryResponse, TransactionType, TxToken, XChainTransactionType } from './transaction-history.js';
10
10
  export { BalanceChange, TokenApproval, TokenApprovals, TokenDiff, TokenDiffItem } from './transaction-simulation.js';
11
+ export { BtcWalletPolicyDetails, GetAddressParams, GetAddressResponse, PubKeyType, WalletType } from './account.js';
11
12
  import 'zod';
12
- import 'bn.js';
13
13
  import '@avalabs/glacier-sdk';
14
14
  import 'ethers';
15
15
  import '@metamask/rpc-errors';
package/dist/index.js CHANGED
@@ -1,12 +1,13 @@
1
+ export { b as AlertType, a as RpcMethod } from './chunk-RKFOXZ35.js';
1
2
  export { a as TokenType } from './chunk-7Y6UGMPZ.js';
2
- export { b as PChainTransactionType, a as TransactionType, c as XChainTransactionType } from './chunk-H6ZZE5M7.js';
3
+ export { b as PChainTransactionType, a as TransactionType, c as XChainTransactionType } from './chunk-7JLXTNPE.js';
3
4
  import './chunk-P6AM7I3B.js';
5
+ export { a as WalletType } from './chunk-RIBT5FN6.js';
4
6
  import './chunk-BHB5UV3J.js';
5
7
  export { b as RawSimplePriceResponseSchema, a as SimplePriceResponseSchema } from './chunk-WOO6UGSQ.js';
6
8
  export { b as Environment, a as NetworkVMType } from './chunk-4BNYMHOY.js';
7
9
  export { a as parseManifest } from './chunk-A4YEBDMG.js';
8
10
  import './chunk-CUVJNZP5.js';
9
11
  import './chunk-7U2R34EQ.js';
10
- export { b as AlertType, a as RpcMethod } from './chunk-RKFOXZ35.js';
11
12
  //# sourceMappingURL=out.js.map
12
13
  //# sourceMappingURL=index.js.map
package/dist/module.d.cts CHANGED
@@ -1,3 +1,4 @@
1
+ import { GetAddressParams, GetAddressResponse } from './account.cjs';
1
2
  import { GetBalancesParams, GetBalancesResponse } from './balance.cjs';
2
3
  import { Network } from './common.cjs';
3
4
  import { Manifest } from './manifest.cjs';
@@ -5,7 +6,6 @@ import { NetworkFees } from './network-fee.cjs';
5
6
  import { RpcRequest, RpcResponse } from './rpc.cjs';
6
7
  import { NetworkContractToken } from './token.cjs';
7
8
  import { GetTransactionHistory, TransactionHistoryResponse } from './transaction-history.cjs';
8
- import 'bn.js';
9
9
  import '@avalabs/glacier-sdk';
10
10
  import 'zod';
11
11
  import 'ethers';
@@ -17,7 +17,7 @@ interface Module {
17
17
  getBalances: (params: GetBalancesParams) => Promise<GetBalancesResponse>;
18
18
  getTransactionHistory: (params: GetTransactionHistory) => Promise<TransactionHistoryResponse>;
19
19
  getNetworkFee: (network: Network) => Promise<NetworkFees>;
20
- getAddress: () => Promise<string>;
20
+ getAddress: (params: GetAddressParams) => Promise<GetAddressResponse>;
21
21
  getTokens: (network: Network) => Promise<NetworkContractToken[]>;
22
22
  onRpcRequest: (request: RpcRequest, chain: Network) => Promise<RpcResponse>;
23
23
  }
package/dist/module.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { GetAddressParams, GetAddressResponse } from './account.js';
1
2
  import { GetBalancesParams, GetBalancesResponse } from './balance.js';
2
3
  import { Network } from './common.js';
3
4
  import { Manifest } from './manifest.js';
@@ -5,7 +6,6 @@ import { NetworkFees } from './network-fee.js';
5
6
  import { RpcRequest, RpcResponse } from './rpc.js';
6
7
  import { NetworkContractToken } from './token.js';
7
8
  import { GetTransactionHistory, TransactionHistoryResponse } from './transaction-history.js';
8
- import 'bn.js';
9
9
  import '@avalabs/glacier-sdk';
10
10
  import 'zod';
11
11
  import 'ethers';
@@ -17,7 +17,7 @@ interface Module {
17
17
  getBalances: (params: GetBalancesParams) => Promise<GetBalancesResponse>;
18
18
  getTransactionHistory: (params: GetTransactionHistory) => Promise<TransactionHistoryResponse>;
19
19
  getNetworkFee: (network: Network) => Promise<NetworkFees>;
20
- getAddress: () => Promise<string>;
20
+ getAddress: (params: GetAddressParams) => Promise<GetAddressResponse>;
21
21
  getTokens: (network: Network) => Promise<NetworkContractToken[]>;
22
22
  onRpcRequest: (request: RpcRequest, chain: Network) => Promise<RpcResponse>;
23
23
  }
@@ -1,20 +1,20 @@
1
1
  'use strict';
2
2
 
3
- var chunkBFBDZPL3_cjs = require('./chunk-BFBDZPL3.cjs');
3
+ var chunkB6DAZDIA_cjs = require('./chunk-B6DAZDIA.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, 'PChainTransactionType', {
8
8
  enumerable: true,
9
- get: function () { return chunkBFBDZPL3_cjs.b; }
9
+ get: function () { return chunkB6DAZDIA_cjs.b; }
10
10
  });
11
11
  Object.defineProperty(exports, 'TransactionType', {
12
12
  enumerable: true,
13
- get: function () { return chunkBFBDZPL3_cjs.a; }
13
+ get: function () { return chunkB6DAZDIA_cjs.a; }
14
14
  });
15
15
  Object.defineProperty(exports, 'XChainTransactionType', {
16
16
  enumerable: true,
17
- get: function () { return chunkBFBDZPL3_cjs.c; }
17
+ get: function () { return chunkB6DAZDIA_cjs.c; }
18
18
  });
19
19
  //# sourceMappingURL=out.js.map
20
20
  //# sourceMappingURL=transaction-history.cjs.map
@@ -23,7 +23,7 @@ type Transaction = {
23
23
  tokens: TxToken[];
24
24
  gasPrice?: string;
25
25
  gasUsed: string;
26
- txType?: TransactionType | PChainTransactionType | XChainTransactionType;
26
+ txType?: TransactionType | PChainTransactionType | XChainTransactionType | 'CreateAssetTx' | 'OperationTx';
27
27
  chainId: string;
28
28
  method?: string;
29
29
  explorerLink: string;
@@ -23,7 +23,7 @@ type Transaction = {
23
23
  tokens: TxToken[];
24
24
  gasPrice?: string;
25
25
  gasUsed: string;
26
- txType?: TransactionType | PChainTransactionType | XChainTransactionType;
26
+ txType?: TransactionType | PChainTransactionType | XChainTransactionType | 'CreateAssetTx' | 'OperationTx';
27
27
  chainId: string;
28
28
  method?: string;
29
29
  explorerLink: string;
@@ -1,3 +1,3 @@
1
- export { b as PChainTransactionType, a as TransactionType, c as XChainTransactionType } from './chunk-H6ZZE5M7.js';
1
+ export { b as PChainTransactionType, a as TransactionType, c as XChainTransactionType } from './chunk-7JLXTNPE.js';
2
2
  //# sourceMappingURL=out.js.map
3
3
  //# sourceMappingURL=transaction-history.js.map
package/package.json CHANGED
@@ -1,10 +1,15 @@
1
1
  {
2
2
  "name": "@avalabs/vm-module-types",
3
- "version": "0.0.22",
3
+ "version": "0.1.0",
4
4
  "main": "dist/index.cjs",
5
5
  "module": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "type": "module",
8
+ "files": [
9
+ "dist",
10
+ "manifest.json"
11
+ ],
12
+ "license": "Limited Ecosystem License",
8
13
  "dependencies": {
9
14
  "zod": "3.23.8",
10
15
  "@metamask/rpc-errors": "6.3.0",