@b3dotfun/sdk 0.0.48-alpha.1 → 0.0.48-alpha.2

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.
@@ -13,15 +13,14 @@ export interface IBaseChain {
13
13
  canDepositNative: boolean;
14
14
  defaultToken: components["schemas"]["Token"];
15
15
  nativeToken: components["schemas"]["Token"];
16
+ coingeckoName: string | null;
16
17
  }
17
18
  export interface IEVMChain extends IBaseChain {
18
19
  type: ChainType.EVM;
19
20
  viem: Chain;
20
21
  pollingInterval: number;
21
22
  zapperEnum?: string;
22
- coingeckoName: string | null;
23
23
  }
24
24
  export interface ISolanaChain extends IBaseChain {
25
25
  type: ChainType.SOLANA;
26
- coingeckoName: string;
27
26
  }
@@ -18,6 +18,7 @@ export declare function isMainnet(chainId: number): boolean;
18
18
  export declare function isTestnet(chainId: number): boolean;
19
19
  export declare function getDefaultToken(chainId: number): components["schemas"]["Token"];
20
20
  export declare function getChainName(chainId: number): string;
21
+ export declare function getCoingeckoName(chainId: number): string | null;
21
22
  export declare function getPaymentUrl(address: string, amount: bigint, currency: string, chainId: number, decimals?: number): string;
22
23
  export declare function getExplorerTxUrl(chainId: number, txHash: string): string;
23
24
  export declare function getExplorerAddressUrl(chainId: number, address: string): string;
@@ -15,6 +15,7 @@ exports.isMainnet = isMainnet;
15
15
  exports.isTestnet = isTestnet;
16
16
  exports.getDefaultToken = getDefaultToken;
17
17
  exports.getChainName = getChainName;
18
+ exports.getCoingeckoName = getCoingeckoName;
18
19
  exports.getPaymentUrl = getPaymentUrl;
19
20
  exports.getExplorerTxUrl = getExplorerTxUrl;
20
21
  exports.getExplorerAddressUrl = getExplorerAddressUrl;
@@ -264,6 +265,10 @@ function getChainName(chainId) {
264
265
  (0, invariant_1.default)(exports.ALL_CHAINS[chainId], `Chain ${chainId} is not supported`);
265
266
  return exports.EVM_CHAINS[chainId] ? exports.EVM_CHAINS[chainId].viem.name : "Solana";
266
267
  }
268
+ function getCoingeckoName(chainId) {
269
+ (0, invariant_1.default)(exports.ALL_CHAINS[chainId], `Chain ${chainId} is not supported`);
270
+ return exports.ALL_CHAINS[chainId].coingeckoName;
271
+ }
267
272
  function getPaymentUrl(address, amount, currency, chainId, decimals) {
268
273
  // Get chain type to determine URL format
269
274
  const chainType = getChainType(chainId);
@@ -13,15 +13,14 @@ export interface IBaseChain {
13
13
  canDepositNative: boolean;
14
14
  defaultToken: components["schemas"]["Token"];
15
15
  nativeToken: components["schemas"]["Token"];
16
+ coingeckoName: string | null;
16
17
  }
17
18
  export interface IEVMChain extends IBaseChain {
18
19
  type: ChainType.EVM;
19
20
  viem: Chain;
20
21
  pollingInterval: number;
21
22
  zapperEnum?: string;
22
- coingeckoName: string | null;
23
23
  }
24
24
  export interface ISolanaChain extends IBaseChain {
25
25
  type: ChainType.SOLANA;
26
- coingeckoName: string;
27
26
  }
@@ -18,6 +18,7 @@ export declare function isMainnet(chainId: number): boolean;
18
18
  export declare function isTestnet(chainId: number): boolean;
19
19
  export declare function getDefaultToken(chainId: number): components["schemas"]["Token"];
20
20
  export declare function getChainName(chainId: number): string;
21
+ export declare function getCoingeckoName(chainId: number): string | null;
21
22
  export declare function getPaymentUrl(address: string, amount: bigint, currency: string, chainId: number, decimals?: number): string;
22
23
  export declare function getExplorerTxUrl(chainId: number, txHash: string): string;
23
24
  export declare function getExplorerAddressUrl(chainId: number, address: string): string;
@@ -241,6 +241,10 @@ export function getChainName(chainId) {
241
241
  invariant(ALL_CHAINS[chainId], `Chain ${chainId} is not supported`);
242
242
  return EVM_CHAINS[chainId] ? EVM_CHAINS[chainId].viem.name : "Solana";
243
243
  }
244
+ export function getCoingeckoName(chainId) {
245
+ invariant(ALL_CHAINS[chainId], `Chain ${chainId} is not supported`);
246
+ return ALL_CHAINS[chainId].coingeckoName;
247
+ }
244
248
  export function getPaymentUrl(address, amount, currency, chainId, decimals) {
245
249
  // Get chain type to determine URL format
246
250
  const chainType = getChainType(chainId);
@@ -13,15 +13,14 @@ export interface IBaseChain {
13
13
  canDepositNative: boolean;
14
14
  defaultToken: components["schemas"]["Token"];
15
15
  nativeToken: components["schemas"]["Token"];
16
+ coingeckoName: string | null;
16
17
  }
17
18
  export interface IEVMChain extends IBaseChain {
18
19
  type: ChainType.EVM;
19
20
  viem: Chain;
20
21
  pollingInterval: number;
21
22
  zapperEnum?: string;
22
- coingeckoName: string | null;
23
23
  }
24
24
  export interface ISolanaChain extends IBaseChain {
25
25
  type: ChainType.SOLANA;
26
- coingeckoName: string;
27
26
  }
@@ -18,6 +18,7 @@ export declare function isMainnet(chainId: number): boolean;
18
18
  export declare function isTestnet(chainId: number): boolean;
19
19
  export declare function getDefaultToken(chainId: number): components["schemas"]["Token"];
20
20
  export declare function getChainName(chainId: number): string;
21
+ export declare function getCoingeckoName(chainId: number): string | null;
21
22
  export declare function getPaymentUrl(address: string, amount: bigint, currency: string, chainId: number, decimals?: number): string;
22
23
  export declare function getExplorerTxUrl(chainId: number, txHash: string): string;
23
24
  export declare function getExplorerAddressUrl(chainId: number, address: string): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b3dotfun/sdk",
3
- "version": "0.0.48-alpha.1",
3
+ "version": "0.0.48-alpha.2",
4
4
  "source": "src/index.ts",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "react-native": "./dist/cjs/index.native.js",
@@ -15,6 +15,7 @@ export interface IBaseChain {
15
15
  canDepositNative: boolean;
16
16
  defaultToken: components["schemas"]["Token"];
17
17
  nativeToken: components["schemas"]["Token"];
18
+ coingeckoName: string | null;
18
19
  }
19
20
 
20
21
  export interface IEVMChain extends IBaseChain {
@@ -22,10 +23,8 @@ export interface IEVMChain extends IBaseChain {
22
23
  viem: Chain;
23
24
  pollingInterval: number;
24
25
  zapperEnum?: string;
25
- coingeckoName: string | null;
26
26
  }
27
27
 
28
28
  export interface ISolanaChain extends IBaseChain {
29
29
  type: ChainType.SOLANA;
30
- coingeckoName: string;
31
30
  }
@@ -305,6 +305,11 @@ export function getChainName(chainId: number): string {
305
305
  return EVM_CHAINS[chainId] ? EVM_CHAINS[chainId].viem.name : "Solana";
306
306
  }
307
307
 
308
+ export function getCoingeckoName(chainId: number): string | null {
309
+ invariant(ALL_CHAINS[chainId], `Chain ${chainId} is not supported`);
310
+ return ALL_CHAINS[chainId].coingeckoName;
311
+ }
312
+
308
313
  export function getPaymentUrl(address: string, amount: bigint, currency: string, chainId: number, decimals?: number) {
309
314
  // Get chain type to determine URL format
310
315
  const chainType = getChainType(chainId);