@avalabs/vm-module-types 0.0.18 → 0.0.19

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @avalabs/vm-module-types@0.0.18 build /home/runner/work/vm-modules/vm-modules/packages/types
2
+ > @avalabs/vm-module-types@0.0.19 build /home/runner/work/vm-modules/vm-modules/packages/types
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/balance.ts, src/coingecko.ts, src/common.ts, src/index.ts, src/manifest.ts, src/module.ts, src/network-fee.ts, src/rpc.ts, src/token.ts, src/transaction-history.ts, src/transaction-simulation.ts
@@ -22,17 +22,17 @@ Generated an empty chunk: "chunk-7U2R34EQ".
22
22
  CJS dist/chunk-BFBDZPL3.cjs 1.21 KB
23
23
  CJS dist/chunk-47KTBBRA.cjs 90.00 B
24
24
  CJS dist/chunk-JUV577XH.cjs 90.00 B
25
- CJS dist/chunk-XQGU7MZ4.cjs 167.00 B
25
+ CJS dist/chunk-VRQJHO4F.cjs 276.00 B
26
26
  CJS dist/chunk-OGQBQHLH.cjs 90.00 B
27
27
  CJS dist/chunk-AILYKQEY.cjs 90.00 B
28
28
  CJS dist/chunk-YVYCETG2.cjs 483.00 B
29
- CJS dist/transaction-history.cjs 542.00 B
30
29
  CJS dist/token.cjs 260.00 B
31
- CJS dist/balance.cjs 117.00 B
30
+ CJS dist/transaction-history.cjs 542.00 B
32
31
  CJS dist/transaction-simulation.cjs 132.00 B
32
+ CJS dist/balance.cjs 117.00 B
33
33
  CJS dist/coingecko.cjs 418.00 B
34
- CJS dist/common.cjs 263.00 B
35
- CJS dist/index.cjs 1.78 KB
34
+ CJS dist/common.cjs 386.00 B
35
+ CJS dist/index.cjs 1.90 KB
36
36
  CJS dist/chunk-4PGCXP4C.cjs 433.00 B
37
37
  CJS dist/manifest.cjs 267.00 B
38
38
  CJS dist/chunk-74SNNWSF.cjs 667.00 B
@@ -43,14 +43,14 @@ Generated an empty chunk: "chunk-7U2R34EQ".
43
43
  CJS dist/chunk-BFBDZPL3.cjs.map 3.69 KB
44
44
  CJS dist/chunk-47KTBBRA.cjs.map 51.00 B
45
45
  CJS dist/chunk-JUV577XH.cjs.map 51.00 B
46
- CJS dist/chunk-XQGU7MZ4.cjs.map 838.00 B
46
+ CJS dist/chunk-VRQJHO4F.cjs.map 1.08 KB
47
47
  CJS dist/chunk-OGQBQHLH.cjs.map 51.00 B
48
48
  CJS dist/chunk-AILYKQEY.cjs.map 51.00 B
49
49
  CJS dist/chunk-YVYCETG2.cjs.map 4.03 KB
50
- CJS dist/transaction-history.cjs.map 51.00 B
51
50
  CJS dist/token.cjs.map 51.00 B
52
- CJS dist/balance.cjs.map 51.00 B
51
+ CJS dist/transaction-history.cjs.map 51.00 B
53
52
  CJS dist/transaction-simulation.cjs.map 51.00 B
53
+ CJS dist/balance.cjs.map 51.00 B
54
54
  CJS dist/coingecko.cjs.map 51.00 B
55
55
  CJS dist/common.cjs.map 51.00 B
56
56
  CJS dist/index.cjs.map 51.00 B
@@ -60,12 +60,12 @@ Generated an empty chunk: "chunk-7U2R34EQ".
60
60
  CJS dist/module.cjs.map 51.00 B
61
61
  CJS dist/network-fee.cjs.map 51.00 B
62
62
  CJS dist/rpc.cjs.map 51.00 B
63
- CJS ⚡️ Build success in 1341ms
63
+ CJS ⚡️ Build success in 1313ms
64
64
  ESM dist/chunk-7Y6UGMPZ.js 207.00 B
65
65
  ESM dist/chunk-H6ZZE5M7.js 1.18 KB
66
66
  ESM dist/chunk-P6AM7I3B.js 75.00 B
67
67
  ESM dist/chunk-BHB5UV3J.js 75.00 B
68
- ESM dist/chunk-YJHKZHST.js 155.00 B
68
+ ESM dist/chunk-4BNYMHOY.js 257.00 B
69
69
  ESM dist/chunk-CUVJNZP5.js 75.00 B
70
70
  ESM dist/chunk-7U2R34EQ.js 75.00 B
71
71
  ESM dist/chunk-RKFOXZ35.js 464.00 B
@@ -74,8 +74,8 @@ Generated an empty chunk: "chunk-7U2R34EQ".
74
74
  ESM dist/transaction-simulation.js 112.00 B
75
75
  ESM dist/balance.js 97.00 B
76
76
  ESM dist/coingecko.js 174.00 B
77
- ESM dist/common.js 122.00 B
78
- ESM dist/index.js 644.00 B
77
+ ESM dist/common.js 142.00 B
78
+ ESM dist/index.js 664.00 B
79
79
  ESM dist/chunk-WOO6UGSQ.js 394.00 B
80
80
  ESM dist/manifest.js 126.00 B
81
81
  ESM dist/chunk-A4YEBDMG.js 592.00 B
@@ -86,7 +86,7 @@ Generated an empty chunk: "chunk-7U2R34EQ".
86
86
  ESM dist/chunk-H6ZZE5M7.js.map 3.69 KB
87
87
  ESM dist/chunk-P6AM7I3B.js.map 51.00 B
88
88
  ESM dist/chunk-BHB5UV3J.js.map 51.00 B
89
- ESM dist/chunk-YJHKZHST.js.map 838.00 B
89
+ ESM dist/chunk-4BNYMHOY.js.map 1.08 KB
90
90
  ESM dist/chunk-CUVJNZP5.js.map 51.00 B
91
91
  ESM dist/chunk-7U2R34EQ.js.map 51.00 B
92
92
  ESM dist/chunk-RKFOXZ35.js.map 4.03 KB
@@ -103,28 +103,28 @@ Generated an empty chunk: "chunk-7U2R34EQ".
103
103
  ESM dist/module.js.map 51.00 B
104
104
  ESM dist/network-fee.js.map 51.00 B
105
105
  ESM dist/rpc.js.map 51.00 B
106
- ESM ⚡️ Build success in 1371ms
106
+ ESM ⚡️ Build success in 1344ms
107
107
  DTS Build start
108
- DTS ⚡️ Build success in 9634ms
109
- DTS dist/index.d.cts 1.36 KB
108
+ DTS ⚡️ Build success in 10347ms
109
+ DTS dist/index.d.cts 1.41 KB
110
110
  DTS dist/coingecko.d.cts 1.09 KB
111
111
  DTS dist/module.d.cts 1.04 KB
112
- DTS dist/balance.d.cts 3.20 KB
112
+ DTS dist/balance.d.cts 3.79 KB
113
113
  DTS dist/manifest.d.cts 6.95 KB
114
114
  DTS dist/network-fee.d.cts 361.00 B
115
115
  DTS dist/rpc.d.cts 3.65 KB
116
116
  DTS dist/transaction-history.d.cts 2.88 KB
117
- DTS dist/common.d.cts 729.00 B
117
+ DTS dist/common.d.cts 902.00 B
118
118
  DTS dist/transaction-simulation.d.cts 642.00 B
119
119
  DTS dist/token.d.cts 1.05 KB
120
- DTS dist/index.d.ts 1.35 KB
120
+ DTS dist/index.d.ts 1.40 KB
121
121
  DTS dist/coingecko.d.ts 1.09 KB
122
122
  DTS dist/module.d.ts 1.04 KB
123
- DTS dist/balance.d.ts 3.20 KB
123
+ DTS dist/balance.d.ts 3.79 KB
124
124
  DTS dist/manifest.d.ts 6.95 KB
125
125
  DTS dist/network-fee.d.ts 361.00 B
126
126
  DTS dist/rpc.d.ts 3.65 KB
127
127
  DTS dist/transaction-history.d.ts 2.88 KB
128
- DTS dist/common.d.ts 728.00 B
128
+ DTS dist/common.d.ts 901.00 B
129
129
  DTS dist/transaction-simulation.d.ts 641.00 B
130
130
  DTS dist/token.d.ts 1.05 KB
@@ -1,4 +1,4 @@
1
1
 
2
- > @avalabs/vm-module-types@0.0.18 lint /home/runner/work/vm-modules/vm-modules/packages/types
2
+ > @avalabs/vm-module-types@0.0.19 lint /home/runner/work/vm-modules/vm-modules/packages/types
3
3
  > eslint "src/**/*.ts"
4
4
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @avalabs/vm-module-types
2
2
 
3
+ ## 0.0.19
4
+
5
+ ### Patch Changes
6
+
7
+ - 5af458b: Add getBalances to avalanche-module
8
+
3
9
  ## 0.0.18
4
10
 
5
11
  ## 0.0.17
@@ -15,19 +15,19 @@ type TokenBalanceData = {
15
15
  name: string;
16
16
  symbol: string;
17
17
  balance: BN;
18
- balanceInCurrency: number;
18
+ balanceInCurrency?: number;
19
19
  balanceDisplayValue: string;
20
20
  balanceCurrencyDisplayValue: string;
21
- priceInCurrency: number;
21
+ };
22
+ type TokenMarketData = {
23
+ priceInCurrency?: number;
22
24
  priceChanges?: {
23
25
  percentage?: number;
24
26
  value?: number;
25
27
  };
26
- };
27
- type TokenMarketData = {
28
- marketCap: number;
29
- change24: number;
30
- vol24: number;
28
+ marketCap?: number;
29
+ change24?: number;
30
+ vol24?: number;
31
31
  };
32
32
  type NetworkTokenWithBalance = TokenBalanceDataWithDecimals & NetworkToken & TokenMarketData & {
33
33
  coingeckoId: string;
@@ -77,14 +77,16 @@ interface TokenWithBalancePVM extends NetworkTokenWithBalance {
77
77
  availableDisplayValue?: string;
78
78
  availableCurrencyDisplayValue?: string;
79
79
  utxos?: PChainBalance;
80
- lockedStaked: number;
81
- lockedStakeable: number;
82
- lockedPlatform: number;
83
- atomicMemoryLocked: number;
84
- atomicMemoryUnlocked: number;
85
- unlockedUnstaked: number;
86
- unlockedStaked: number;
87
- pendingStaked: number;
80
+ balancePerType: {
81
+ lockedStaked: number;
82
+ lockedStakeable: number;
83
+ lockedPlatform: number;
84
+ atomicMemoryLocked: number;
85
+ atomicMemoryUnlocked: number;
86
+ unlockedUnstaked: number;
87
+ unlockedStaked: number;
88
+ pendingStaked: number;
89
+ };
88
90
  }
89
91
  interface TokenWithBalanceAVM extends NetworkTokenWithBalance {
90
92
  available?: BN;
@@ -92,12 +94,31 @@ interface TokenWithBalanceAVM extends NetworkTokenWithBalance {
92
94
  availableDisplayValue?: string;
93
95
  availableCurrencyDisplayValue?: string;
94
96
  utxos?: XChainBalances;
95
- locked: number;
96
- unlocked: number;
97
- atomicMemoryUnlocked: number;
98
- atomicMemoryLocked: number;
97
+ balancePerType: {
98
+ locked: number;
99
+ unlocked: number;
100
+ atomicMemoryUnlocked: number;
101
+ atomicMemoryLocked: number;
102
+ };
103
+ }
104
+ interface NftTokenWithBalance extends Omit<NetworkTokenWithBalance, 'type'> {
105
+ type: TokenType.ERC721 | TokenType.ERC1155;
106
+ address: string;
107
+ description: string;
108
+ logoUri: string;
109
+ logoSmall: string;
110
+ name: string;
111
+ symbol: string;
112
+ tokenId: string;
113
+ attributes: TokenAttribute[];
114
+ collectionName: string;
115
+ updatedAt?: number;
116
+ }
117
+ interface TokenAttribute {
118
+ name: string;
119
+ value: string;
99
120
  }
100
- type TokenWithBalance = TokenWithBalanceEVM | TokenWithBalanceBTC | TokenWithBalancePVM | TokenWithBalanceAVM;
121
+ type TokenWithBalance = TokenWithBalanceEVM | TokenWithBalanceBTC | TokenWithBalancePVM | TokenWithBalanceAVM | NftTokenWithBalance;
101
122
  type GetBalancesResponse = Record<string, Record<string, TokenWithBalance>>;
102
123
 
103
- export { GetBalancesParams, GetBalancesResponse, NetworkTokenWithBalance, TokenBalanceData, TokenWithBalance, TokenWithBalanceAVM, TokenWithBalanceBTC, TokenWithBalanceERC20, TokenWithBalanceEVM, TokenWithBalancePVM };
124
+ export { GetBalancesParams, GetBalancesResponse, NetworkTokenWithBalance, NftTokenWithBalance, TokenAttribute, TokenBalanceData, TokenWithBalance, TokenWithBalanceAVM, TokenWithBalanceBTC, TokenWithBalanceERC20, TokenWithBalanceEVM, TokenWithBalancePVM };
package/dist/balance.d.ts CHANGED
@@ -15,19 +15,19 @@ type TokenBalanceData = {
15
15
  name: string;
16
16
  symbol: string;
17
17
  balance: BN;
18
- balanceInCurrency: number;
18
+ balanceInCurrency?: number;
19
19
  balanceDisplayValue: string;
20
20
  balanceCurrencyDisplayValue: string;
21
- priceInCurrency: number;
21
+ };
22
+ type TokenMarketData = {
23
+ priceInCurrency?: number;
22
24
  priceChanges?: {
23
25
  percentage?: number;
24
26
  value?: number;
25
27
  };
26
- };
27
- type TokenMarketData = {
28
- marketCap: number;
29
- change24: number;
30
- vol24: number;
28
+ marketCap?: number;
29
+ change24?: number;
30
+ vol24?: number;
31
31
  };
32
32
  type NetworkTokenWithBalance = TokenBalanceDataWithDecimals & NetworkToken & TokenMarketData & {
33
33
  coingeckoId: string;
@@ -77,14 +77,16 @@ interface TokenWithBalancePVM extends NetworkTokenWithBalance {
77
77
  availableDisplayValue?: string;
78
78
  availableCurrencyDisplayValue?: string;
79
79
  utxos?: PChainBalance;
80
- lockedStaked: number;
81
- lockedStakeable: number;
82
- lockedPlatform: number;
83
- atomicMemoryLocked: number;
84
- atomicMemoryUnlocked: number;
85
- unlockedUnstaked: number;
86
- unlockedStaked: number;
87
- pendingStaked: number;
80
+ balancePerType: {
81
+ lockedStaked: number;
82
+ lockedStakeable: number;
83
+ lockedPlatform: number;
84
+ atomicMemoryLocked: number;
85
+ atomicMemoryUnlocked: number;
86
+ unlockedUnstaked: number;
87
+ unlockedStaked: number;
88
+ pendingStaked: number;
89
+ };
88
90
  }
89
91
  interface TokenWithBalanceAVM extends NetworkTokenWithBalance {
90
92
  available?: BN;
@@ -92,12 +94,31 @@ interface TokenWithBalanceAVM extends NetworkTokenWithBalance {
92
94
  availableDisplayValue?: string;
93
95
  availableCurrencyDisplayValue?: string;
94
96
  utxos?: XChainBalances;
95
- locked: number;
96
- unlocked: number;
97
- atomicMemoryUnlocked: number;
98
- atomicMemoryLocked: number;
97
+ balancePerType: {
98
+ locked: number;
99
+ unlocked: number;
100
+ atomicMemoryUnlocked: number;
101
+ atomicMemoryLocked: number;
102
+ };
103
+ }
104
+ interface NftTokenWithBalance extends Omit<NetworkTokenWithBalance, 'type'> {
105
+ type: TokenType.ERC721 | TokenType.ERC1155;
106
+ address: string;
107
+ description: string;
108
+ logoUri: string;
109
+ logoSmall: string;
110
+ name: string;
111
+ symbol: string;
112
+ tokenId: string;
113
+ attributes: TokenAttribute[];
114
+ collectionName: string;
115
+ updatedAt?: number;
116
+ }
117
+ interface TokenAttribute {
118
+ name: string;
119
+ value: string;
99
120
  }
100
- type TokenWithBalance = TokenWithBalanceEVM | TokenWithBalanceBTC | TokenWithBalancePVM | TokenWithBalanceAVM;
121
+ type TokenWithBalance = TokenWithBalanceEVM | TokenWithBalanceBTC | TokenWithBalancePVM | TokenWithBalanceAVM | NftTokenWithBalance;
101
122
  type GetBalancesResponse = Record<string, Record<string, TokenWithBalance>>;
102
123
 
103
- export { GetBalancesParams, GetBalancesResponse, NetworkTokenWithBalance, TokenBalanceData, TokenWithBalance, TokenWithBalanceAVM, TokenWithBalanceBTC, TokenWithBalanceERC20, TokenWithBalanceEVM, TokenWithBalancePVM };
124
+ export { GetBalancesParams, GetBalancesResponse, NetworkTokenWithBalance, NftTokenWithBalance, TokenAttribute, TokenBalanceData, TokenWithBalance, TokenWithBalanceAVM, TokenWithBalanceBTC, TokenWithBalanceERC20, TokenWithBalanceEVM, TokenWithBalancePVM };
@@ -0,0 +1,5 @@
1
+ var r=(t=>(t.EVM="EVM",t.BITCOIN="BITCOIN",t.AVM="AVM",t.PVM="PVM",t.CoreEth="CoreEth",t))(r||{}),i=(e=>(e.PRODUCTION="production",e.DEV="dev",e))(i||{});
2
+
3
+ export { r as a, i as b };
4
+ //# sourceMappingURL=out.js.map
5
+ //# sourceMappingURL=chunk-4BNYMHOY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/common.ts"],"names":["NetworkVMType","Environment"],"mappings":"AAsBO,IAAKA,OACVA,EAAA,IAAM,MACNA,EAAA,QAAU,UACVA,EAAA,IAAM,MACNA,EAAA,IAAM,MACNA,EAAA,QAAU,UALAA,OAAA,IAiBAC,OACVA,EAAA,WAAa,aACbA,EAAA,IAAM,MAFIA,OAAA","sourcesContent":["import type { NetworkToken } from './token';\n\nexport type Network = {\n isTestnet?: boolean;\n chainId: number;\n chainName: string;\n rpcUrl: string;\n utilityAddresses?: {\n multicall: string;\n };\n networkToken: NetworkToken;\n pricingProviders?: {\n coingecko: {\n assetPlatformId?: string;\n nativeTokenId?: string;\n };\n };\n explorerUrl?: string;\n logoUri?: string;\n vmName: NetworkVMType;\n};\n\nexport enum NetworkVMType {\n EVM = 'EVM',\n BITCOIN = 'BITCOIN',\n AVM = 'AVM',\n PVM = 'PVM',\n CoreEth = 'CoreEth',\n}\n\nexport type Storage = {\n get: <T>(id: string) => T | undefined;\n set: <T>(id: string, data: T) => void;\n};\n\nexport type Caip2ChainId = string;\n\nexport type Hex = `0x${string}`;\n\nexport enum Environment {\n PRODUCTION = 'production',\n DEV = 'dev',\n}\n"]}
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+
3
+ var r=(t=>(t.EVM="EVM",t.BITCOIN="BITCOIN",t.AVM="AVM",t.PVM="PVM",t.CoreEth="CoreEth",t))(r||{}),i=(e=>(e.PRODUCTION="production",e.DEV="dev",e))(i||{});
4
+
5
+ exports.a = r;
6
+ exports.b = i;
7
+ //# sourceMappingURL=out.js.map
8
+ //# sourceMappingURL=chunk-VRQJHO4F.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/common.ts"],"names":["NetworkVMType","Environment"],"mappings":"AAsBO,IAAKA,OACVA,EAAA,IAAM,MACNA,EAAA,QAAU,UACVA,EAAA,IAAM,MACNA,EAAA,IAAM,MACNA,EAAA,QAAU,UALAA,OAAA,IAiBAC,OACVA,EAAA,WAAa,aACbA,EAAA,IAAM,MAFIA,OAAA","sourcesContent":["import type { NetworkToken } from './token';\n\nexport type Network = {\n isTestnet?: boolean;\n chainId: number;\n chainName: string;\n rpcUrl: string;\n utilityAddresses?: {\n multicall: string;\n };\n networkToken: NetworkToken;\n pricingProviders?: {\n coingecko: {\n assetPlatformId?: string;\n nativeTokenId?: string;\n };\n };\n explorerUrl?: string;\n logoUri?: string;\n vmName: NetworkVMType;\n};\n\nexport enum NetworkVMType {\n EVM = 'EVM',\n BITCOIN = 'BITCOIN',\n AVM = 'AVM',\n PVM = 'PVM',\n CoreEth = 'CoreEth',\n}\n\nexport type Storage = {\n get: <T>(id: string) => T | undefined;\n set: <T>(id: string, data: T) => void;\n};\n\nexport type Caip2ChainId = string;\n\nexport type Hex = `0x${string}`;\n\nexport enum Environment {\n PRODUCTION = 'production',\n DEV = 'dev',\n}\n"]}
package/dist/common.cjs CHANGED
@@ -1,12 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var chunkXQGU7MZ4_cjs = require('./chunk-XQGU7MZ4.cjs');
3
+ var chunkVRQJHO4F_cjs = require('./chunk-VRQJHO4F.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, 'Environment', {
8
8
  enumerable: true,
9
- get: function () { return chunkXQGU7MZ4_cjs.a; }
9
+ get: function () { return chunkVRQJHO4F_cjs.b; }
10
+ });
11
+ Object.defineProperty(exports, 'NetworkVMType', {
12
+ enumerable: true,
13
+ get: function () { return chunkVRQJHO4F_cjs.a; }
10
14
  });
11
15
  //# sourceMappingURL=out.js.map
12
16
  //# sourceMappingURL=common.cjs.map
package/dist/common.d.cts CHANGED
@@ -17,7 +17,15 @@ type Network = {
17
17
  };
18
18
  explorerUrl?: string;
19
19
  logoUri?: string;
20
+ vmName: NetworkVMType;
20
21
  };
22
+ declare enum NetworkVMType {
23
+ EVM = "EVM",
24
+ BITCOIN = "BITCOIN",
25
+ AVM = "AVM",
26
+ PVM = "PVM",
27
+ CoreEth = "CoreEth"
28
+ }
21
29
  type Storage = {
22
30
  get: <T>(id: string) => T | undefined;
23
31
  set: <T>(id: string, data: T) => void;
@@ -29,4 +37,4 @@ declare enum Environment {
29
37
  DEV = "dev"
30
38
  }
31
39
 
32
- export { Caip2ChainId, Environment, Hex, Network, Storage };
40
+ export { Caip2ChainId, Environment, Hex, Network, NetworkVMType, Storage };
package/dist/common.d.ts CHANGED
@@ -17,7 +17,15 @@ type Network = {
17
17
  };
18
18
  explorerUrl?: string;
19
19
  logoUri?: string;
20
+ vmName: NetworkVMType;
20
21
  };
22
+ declare enum NetworkVMType {
23
+ EVM = "EVM",
24
+ BITCOIN = "BITCOIN",
25
+ AVM = "AVM",
26
+ PVM = "PVM",
27
+ CoreEth = "CoreEth"
28
+ }
21
29
  type Storage = {
22
30
  get: <T>(id: string) => T | undefined;
23
31
  set: <T>(id: string, data: T) => void;
@@ -29,4 +37,4 @@ declare enum Environment {
29
37
  DEV = "dev"
30
38
  }
31
39
 
32
- export { Caip2ChainId, Environment, Hex, Network, Storage };
40
+ export { Caip2ChainId, Environment, Hex, Network, NetworkVMType, Storage };
package/dist/common.js CHANGED
@@ -1,3 +1,3 @@
1
- export { a as Environment } from './chunk-YJHKZHST.js';
1
+ export { b as Environment, a as NetworkVMType } from './chunk-4BNYMHOY.js';
2
2
  //# sourceMappingURL=out.js.map
3
3
  //# sourceMappingURL=common.js.map
package/dist/index.cjs CHANGED
@@ -5,7 +5,7 @@ var chunkBFBDZPL3_cjs = require('./chunk-BFBDZPL3.cjs');
5
5
  require('./chunk-47KTBBRA.cjs');
6
6
  require('./chunk-JUV577XH.cjs');
7
7
  var chunk4PGCXP4C_cjs = require('./chunk-4PGCXP4C.cjs');
8
- var chunkXQGU7MZ4_cjs = require('./chunk-XQGU7MZ4.cjs');
8
+ var chunkVRQJHO4F_cjs = require('./chunk-VRQJHO4F.cjs');
9
9
  var chunk74SNNWSF_cjs = require('./chunk-74SNNWSF.cjs');
10
10
  require('./chunk-OGQBQHLH.cjs');
11
11
  require('./chunk-AILYKQEY.cjs');
@@ -39,7 +39,11 @@ Object.defineProperty(exports, 'SimplePriceResponseSchema', {
39
39
  });
40
40
  Object.defineProperty(exports, 'Environment', {
41
41
  enumerable: true,
42
- get: function () { return chunkXQGU7MZ4_cjs.a; }
42
+ get: function () { return chunkVRQJHO4F_cjs.b; }
43
+ });
44
+ Object.defineProperty(exports, 'NetworkVMType', {
45
+ enumerable: true,
46
+ get: function () { return chunkVRQJHO4F_cjs.a; }
43
47
  });
44
48
  Object.defineProperty(exports, 'parseManifest', {
45
49
  enumerable: true,
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
- export { Caip2ChainId, Environment, Hex, Network, Storage } from './common.cjs';
1
+ export { Caip2ChainId, Environment, Hex, Network, NetworkVMType, Storage } from './common.cjs';
2
2
  export { RawSimplePriceResponse, RawSimplePriceResponseSchema, SimplePriceResponse, SimplePriceResponseSchema } from './coingecko.cjs';
3
- export { GetBalancesParams, GetBalancesResponse, NetworkTokenWithBalance, TokenBalanceData, TokenWithBalance, TokenWithBalanceAVM, TokenWithBalanceBTC, TokenWithBalanceERC20, TokenWithBalanceEVM, TokenWithBalancePVM } from './balance.cjs';
3
+ export { GetBalancesParams, GetBalancesResponse, NetworkTokenWithBalance, NftTokenWithBalance, TokenAttribute, TokenBalanceData, TokenWithBalance, TokenWithBalanceAVM, TokenWithBalanceBTC, TokenWithBalanceERC20, TokenWithBalanceEVM, TokenWithBalancePVM } from './balance.cjs';
4
4
  export { Manifest, parseManifest } from './manifest.cjs';
5
5
  export { Module } from './module.cjs';
6
6
  export { NetworkFees } from './network-fee.cjs';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { Caip2ChainId, Environment, Hex, Network, Storage } from './common.js';
1
+ export { Caip2ChainId, Environment, Hex, Network, NetworkVMType, Storage } from './common.js';
2
2
  export { RawSimplePriceResponse, RawSimplePriceResponseSchema, SimplePriceResponse, SimplePriceResponseSchema } from './coingecko.js';
3
- export { GetBalancesParams, GetBalancesResponse, NetworkTokenWithBalance, TokenBalanceData, TokenWithBalance, TokenWithBalanceAVM, TokenWithBalanceBTC, TokenWithBalanceERC20, TokenWithBalanceEVM, TokenWithBalancePVM } from './balance.js';
3
+ export { GetBalancesParams, GetBalancesResponse, NetworkTokenWithBalance, NftTokenWithBalance, TokenAttribute, TokenBalanceData, TokenWithBalance, TokenWithBalanceAVM, TokenWithBalanceBTC, TokenWithBalanceERC20, TokenWithBalanceEVM, TokenWithBalancePVM } from './balance.js';
4
4
  export { Manifest, parseManifest } from './manifest.js';
5
5
  export { Module } from './module.js';
6
6
  export { NetworkFees } from './network-fee.js';
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ export { b as PChainTransactionType, a as TransactionType, c as XChainTransactio
3
3
  import './chunk-P6AM7I3B.js';
4
4
  import './chunk-BHB5UV3J.js';
5
5
  export { b as RawSimplePriceResponseSchema, a as SimplePriceResponseSchema } from './chunk-WOO6UGSQ.js';
6
- export { a as Environment } from './chunk-YJHKZHST.js';
6
+ export { b as Environment, a as NetworkVMType } from './chunk-4BNYMHOY.js';
7
7
  export { a as parseManifest } from './chunk-A4YEBDMG.js';
8
8
  import './chunk-CUVJNZP5.js';
9
9
  import './chunk-7U2R34EQ.js';
@@ -180,8 +180,8 @@ declare const manifestSchema: z.ZodObject<{
180
180
  manifestVersion: z.ZodString;
181
181
  }, "strip", z.ZodTypeAny, {
182
182
  name: string;
183
- version: string;
184
183
  description: string;
184
+ version: string;
185
185
  sources: {
186
186
  module: {
187
187
  checksum: string;
@@ -218,8 +218,8 @@ declare const manifestSchema: z.ZodObject<{
218
218
  manifestVersion: string;
219
219
  }, {
220
220
  name: string;
221
- version: string;
222
221
  description: string;
222
+ version: string;
223
223
  sources: {
224
224
  module: {
225
225
  checksum: string;
@@ -180,8 +180,8 @@ declare const manifestSchema: z.ZodObject<{
180
180
  manifestVersion: z.ZodString;
181
181
  }, "strip", z.ZodTypeAny, {
182
182
  name: string;
183
- version: string;
184
183
  description: string;
184
+ version: string;
185
185
  sources: {
186
186
  module: {
187
187
  checksum: string;
@@ -218,8 +218,8 @@ declare const manifestSchema: z.ZodObject<{
218
218
  manifestVersion: string;
219
219
  }, {
220
220
  name: string;
221
- version: string;
222
221
  description: string;
222
+ version: string;
223
223
  sources: {
224
224
  module: {
225
225
  checksum: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avalabs/vm-module-types",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "main": "dist/index.cjs",
5
5
  "module": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
package/src/balance.ts CHANGED
@@ -16,20 +16,20 @@ export type TokenBalanceData = {
16
16
  name: string;
17
17
  symbol: string;
18
18
  balance: BN;
19
- balanceInCurrency: number;
19
+ balanceInCurrency?: number;
20
20
  balanceDisplayValue: string;
21
21
  balanceCurrencyDisplayValue: string;
22
- priceInCurrency: number;
22
+ };
23
+
24
+ type TokenMarketData = {
25
+ priceInCurrency?: number;
23
26
  priceChanges?: {
24
27
  percentage?: number;
25
28
  value?: number;
26
29
  };
27
- };
28
-
29
- type TokenMarketData = {
30
- marketCap: number;
31
- change24: number;
32
- vol24: number;
30
+ marketCap?: number;
31
+ change24?: number;
32
+ vol24?: number;
33
33
  };
34
34
 
35
35
  export type NetworkTokenWithBalance = TokenBalanceDataWithDecimals &
@@ -91,14 +91,16 @@ export interface TokenWithBalancePVM extends NetworkTokenWithBalance {
91
91
  availableDisplayValue?: string;
92
92
  availableCurrencyDisplayValue?: string;
93
93
  utxos?: PChainBalance;
94
- lockedStaked: number;
95
- lockedStakeable: number;
96
- lockedPlatform: number;
97
- atomicMemoryLocked: number;
98
- atomicMemoryUnlocked: number;
99
- unlockedUnstaked: number;
100
- unlockedStaked: number;
101
- pendingStaked: number;
94
+ balancePerType: {
95
+ lockedStaked: number;
96
+ lockedStakeable: number;
97
+ lockedPlatform: number;
98
+ atomicMemoryLocked: number;
99
+ atomicMemoryUnlocked: number;
100
+ unlockedUnstaked: number;
101
+ unlockedStaked: number;
102
+ pendingStaked: number;
103
+ };
102
104
  }
103
105
 
104
106
  export interface TokenWithBalanceAVM extends NetworkTokenWithBalance {
@@ -107,12 +109,38 @@ export interface TokenWithBalanceAVM extends NetworkTokenWithBalance {
107
109
  availableDisplayValue?: string;
108
110
  availableCurrencyDisplayValue?: string;
109
111
  utxos?: XChainBalances;
110
- locked: number;
111
- unlocked: number;
112
- atomicMemoryUnlocked: number;
113
- atomicMemoryLocked: number;
112
+ balancePerType: {
113
+ locked: number;
114
+ unlocked: number;
115
+ atomicMemoryUnlocked: number;
116
+ atomicMemoryLocked: number;
117
+ };
118
+ }
119
+
120
+ export interface NftTokenWithBalance extends Omit<NetworkTokenWithBalance, 'type'> {
121
+ type: TokenType.ERC721 | TokenType.ERC1155;
122
+ address: string;
123
+ description: string;
124
+ logoUri: string;
125
+ logoSmall: string;
126
+ name: string;
127
+ symbol: string;
128
+ tokenId: string;
129
+ attributes: TokenAttribute[];
130
+ collectionName: string;
131
+ updatedAt?: number;
132
+ }
133
+
134
+ export interface TokenAttribute {
135
+ name: string;
136
+ value: string;
114
137
  }
115
138
 
116
- export type TokenWithBalance = TokenWithBalanceEVM | TokenWithBalanceBTC | TokenWithBalancePVM | TokenWithBalanceAVM;
139
+ export type TokenWithBalance =
140
+ | TokenWithBalanceEVM
141
+ | TokenWithBalanceBTC
142
+ | TokenWithBalancePVM
143
+ | TokenWithBalanceAVM
144
+ | NftTokenWithBalance;
117
145
 
118
146
  export type GetBalancesResponse = Record<string, Record<string, TokenWithBalance>>;
package/src/common.ts CHANGED
@@ -17,8 +17,17 @@ export type Network = {
17
17
  };
18
18
  explorerUrl?: string;
19
19
  logoUri?: string;
20
+ vmName: NetworkVMType;
20
21
  };
21
22
 
23
+ export enum NetworkVMType {
24
+ EVM = 'EVM',
25
+ BITCOIN = 'BITCOIN',
26
+ AVM = 'AVM',
27
+ PVM = 'PVM',
28
+ CoreEth = 'CoreEth',
29
+ }
30
+
22
31
  export type Storage = {
23
32
  get: <T>(id: string) => T | undefined;
24
33
  set: <T>(id: string, data: T) => void;
@@ -1,7 +0,0 @@
1
- 'use strict';
2
-
3
- var t=(e=>(e.PRODUCTION="production",e.DEV="dev",e))(t||{});
4
-
5
- exports.a = t;
6
- //# sourceMappingURL=out.js.map
7
- //# sourceMappingURL=chunk-XQGU7MZ4.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/common.ts"],"names":["Environment"],"mappings":"AA8BO,IAAKA,OACVA,EAAA,WAAa,aACbA,EAAA,IAAM,MAFIA,OAAA","sourcesContent":["import type { NetworkToken } from './token';\n\nexport type Network = {\n isTestnet?: boolean;\n chainId: number;\n chainName: string;\n rpcUrl: string;\n utilityAddresses?: {\n multicall: string;\n };\n networkToken: NetworkToken;\n pricingProviders?: {\n coingecko: {\n assetPlatformId?: string;\n nativeTokenId?: string;\n };\n };\n explorerUrl?: string;\n logoUri?: string;\n};\n\nexport type Storage = {\n get: <T>(id: string) => T | undefined;\n set: <T>(id: string, data: T) => void;\n};\n\nexport type Caip2ChainId = string;\n\nexport type Hex = `0x${string}`;\n\nexport enum Environment {\n PRODUCTION = 'production',\n DEV = 'dev',\n}\n"]}
@@ -1,5 +0,0 @@
1
- var t=(e=>(e.PRODUCTION="production",e.DEV="dev",e))(t||{});
2
-
3
- export { t as a };
4
- //# sourceMappingURL=out.js.map
5
- //# sourceMappingURL=chunk-YJHKZHST.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/common.ts"],"names":["Environment"],"mappings":"AA8BO,IAAKA,OACVA,EAAA,WAAa,aACbA,EAAA,IAAM,MAFIA,OAAA","sourcesContent":["import type { NetworkToken } from './token';\n\nexport type Network = {\n isTestnet?: boolean;\n chainId: number;\n chainName: string;\n rpcUrl: string;\n utilityAddresses?: {\n multicall: string;\n };\n networkToken: NetworkToken;\n pricingProviders?: {\n coingecko: {\n assetPlatformId?: string;\n nativeTokenId?: string;\n };\n };\n explorerUrl?: string;\n logoUri?: string;\n};\n\nexport type Storage = {\n get: <T>(id: string) => T | undefined;\n set: <T>(id: string, data: T) => void;\n};\n\nexport type Caip2ChainId = string;\n\nexport type Hex = `0x${string}`;\n\nexport enum Environment {\n PRODUCTION = 'production',\n DEV = 'dev',\n}\n"]}