@phantom/utils 1.0.0-beta.22 → 1.0.0-beta.25

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/index.d.ts CHANGED
@@ -25,7 +25,8 @@ declare const getSecureTimestampSync: () => number;
25
25
  /**
26
26
  * Network utility functions for working with blockchain network identifiers
27
27
  */
28
- declare function isEthereumChain(networkId: string): boolean;
29
28
  declare function getChainPrefix(networkId: string): string;
29
+ declare function isEthereumChain(networkId: string): boolean;
30
+ declare function isSolanaChain(networkId: string): boolean;
30
31
 
31
- export { getChainPrefix, getSecureTimestamp, getSecureTimestampSync, isEthereumChain, randomString, randomUUID };
32
+ export { getChainPrefix, getSecureTimestamp, getSecureTimestampSync, isEthereumChain, isSolanaChain, randomString, randomUUID };
package/dist/index.js CHANGED
@@ -24,6 +24,7 @@ __export(src_exports, {
24
24
  getSecureTimestamp: () => getSecureTimestamp,
25
25
  getSecureTimestampSync: () => getSecureTimestampSync,
26
26
  isEthereumChain: () => isEthereumChain,
27
+ isSolanaChain: () => isSolanaChain,
27
28
  randomString: () => randomString,
28
29
  randomUUID: () => randomUUID
29
30
  });
@@ -117,12 +118,16 @@ var getSecureTimestamp = () => timeService.now();
117
118
  var getSecureTimestampSync = () => timeService.nowSync();
118
119
 
119
120
  // src/network.ts
121
+ function getChainPrefix(networkId) {
122
+ return networkId.split(":")[0].toLowerCase();
123
+ }
120
124
  function isEthereumChain(networkId) {
121
- const network = networkId.split(":")[0].toLowerCase();
125
+ const network = getChainPrefix(networkId);
122
126
  return network === "eip155";
123
127
  }
124
- function getChainPrefix(networkId) {
125
- return networkId.split(":")[0].toLowerCase();
128
+ function isSolanaChain(networkId) {
129
+ const network = getChainPrefix(networkId);
130
+ return network === "solana";
126
131
  }
127
132
  // Annotate the CommonJS export names for ESM import in node:
128
133
  0 && (module.exports = {
@@ -130,6 +135,7 @@ function getChainPrefix(networkId) {
130
135
  getSecureTimestamp,
131
136
  getSecureTimestampSync,
132
137
  isEthereumChain,
138
+ isSolanaChain,
133
139
  randomString,
134
140
  randomUUID
135
141
  });
package/dist/index.mjs CHANGED
@@ -86,18 +86,23 @@ var getSecureTimestamp = () => timeService.now();
86
86
  var getSecureTimestampSync = () => timeService.nowSync();
87
87
 
88
88
  // src/network.ts
89
+ function getChainPrefix(networkId) {
90
+ return networkId.split(":")[0].toLowerCase();
91
+ }
89
92
  function isEthereumChain(networkId) {
90
- const network = networkId.split(":")[0].toLowerCase();
93
+ const network = getChainPrefix(networkId);
91
94
  return network === "eip155";
92
95
  }
93
- function getChainPrefix(networkId) {
94
- return networkId.split(":")[0].toLowerCase();
96
+ function isSolanaChain(networkId) {
97
+ const network = getChainPrefix(networkId);
98
+ return network === "solana";
95
99
  }
96
100
  export {
97
101
  getChainPrefix,
98
102
  getSecureTimestamp,
99
103
  getSecureTimestampSync,
100
104
  isEthereumChain,
105
+ isSolanaChain,
101
106
  randomString,
102
107
  randomUUID
103
108
  };
package/package.json CHANGED
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "name": "@phantom/utils",
3
- "version": "1.0.0-beta.22",
3
+ "version": "1.0.0-beta.25",
4
4
  "description": "Utility functions for Phantom Wallet SDK",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/phantom/phantom-connect-sdk",
8
+ "directory": "packages/utils"
9
+ },
5
10
  "main": "dist/index.js",
6
11
  "module": "dist/index.mjs",
7
12
  "types": "dist/index.d.ts",