@silentswap/sdk 0.0.57 → 0.0.58
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/caip19.d.ts +9 -0
- package/dist/caip19.js +11 -0
- package/package.json +1 -1
package/dist/caip19.d.ts
CHANGED
|
@@ -142,12 +142,21 @@ export declare function isEvmAsset(caip19: string): boolean;
|
|
|
142
142
|
* @returns True if Solana asset
|
|
143
143
|
*/
|
|
144
144
|
export declare function isSolanaAsset(caip19: string): boolean;
|
|
145
|
+
/** BIP122 chain ID for Bitcoin mainnet (genesis hash). */
|
|
146
|
+
export declare const BIP122_BITCOIN_MAINNET_CHAIN_ID = "000000000019d6689c085ae165831e93";
|
|
145
147
|
/**
|
|
146
148
|
* Check if CAIP-19 represents a Bitcoin asset
|
|
147
149
|
* @param caip19 - CAIP-19 string
|
|
148
150
|
* @returns True if Bitcoin asset
|
|
149
151
|
*/
|
|
150
152
|
export declare function isBitcoinAsset(caip19: string): boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Check if CAIP-19 represents a Bitcoin mainnet (BTC) asset.
|
|
155
|
+
* Excludes Bitcoin Cash and other bip122 chains; use when fetching from BTC-only APIs (e.g. Mempool.space).
|
|
156
|
+
* @param caip19 - CAIP-19 string
|
|
157
|
+
* @returns True if Bitcoin mainnet asset
|
|
158
|
+
*/
|
|
159
|
+
export declare function isBitcoinMainnetAsset(caip19: string): boolean;
|
|
151
160
|
/**
|
|
152
161
|
* Check if CAIP-19 represents an EVM native token
|
|
153
162
|
* @param caip19 - CAIP-19 string
|
package/dist/caip19.js
CHANGED
|
@@ -186,6 +186,8 @@ export function isEvmAsset(caip19) {
|
|
|
186
186
|
export function isSolanaAsset(caip19) {
|
|
187
187
|
return caip19.startsWith('solana:');
|
|
188
188
|
}
|
|
189
|
+
/** BIP122 chain ID for Bitcoin mainnet (genesis hash). */
|
|
190
|
+
export const BIP122_BITCOIN_MAINNET_CHAIN_ID = '000000000019d6689c085ae165831e93';
|
|
189
191
|
/**
|
|
190
192
|
* Check if CAIP-19 represents a Bitcoin asset
|
|
191
193
|
* @param caip19 - CAIP-19 string
|
|
@@ -194,6 +196,15 @@ export function isSolanaAsset(caip19) {
|
|
|
194
196
|
export function isBitcoinAsset(caip19) {
|
|
195
197
|
return caip19.startsWith('bip122:');
|
|
196
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* Check if CAIP-19 represents a Bitcoin mainnet (BTC) asset.
|
|
201
|
+
* Excludes Bitcoin Cash and other bip122 chains; use when fetching from BTC-only APIs (e.g. Mempool.space).
|
|
202
|
+
* @param caip19 - CAIP-19 string
|
|
203
|
+
* @returns True if Bitcoin mainnet asset
|
|
204
|
+
*/
|
|
205
|
+
export function isBitcoinMainnetAsset(caip19) {
|
|
206
|
+
return caip19.startsWith(`bip122:${BIP122_BITCOIN_MAINNET_CHAIN_ID}/`);
|
|
207
|
+
}
|
|
197
208
|
/**
|
|
198
209
|
* Check if CAIP-19 represents an EVM native token
|
|
199
210
|
* @param caip19 - CAIP-19 string
|