@spicenet-io/spiceflow-core 0.3.0 → 0.3.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.
- package/dist/chains/index.d.ts +12 -1
- package/dist/chains/index.d.ts.map +1 -1
- package/dist/chains/list.d.ts.map +1 -1
- package/dist/chains/types.d.ts +12 -1
- package/dist/chains/types.d.ts.map +1 -1
- package/dist/index.cjs +283 -31
- package/dist/index.js +280 -31
- package/dist/logos.d.ts +2 -0
- package/dist/logos.d.ts.map +1 -1
- package/dist/tokens/list.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/chains/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { Network, ChainMeta } from "./types.js";
|
|
1
|
+
export type { Network, ChainMeta, ChainType } from "./types.js";
|
|
2
2
|
export { CHAINS } from "./list.js";
|
|
3
3
|
import type { Network, ChainMeta } from "./types.js";
|
|
4
4
|
export declare function getChainMeta(chainId: number): ChainMeta | undefined;
|
|
@@ -6,5 +6,16 @@ export declare function getChainsByNetwork(network: Network): ChainMeta[];
|
|
|
6
6
|
export declare function getChainIdsByNetwork(network: Network): number[];
|
|
7
7
|
export declare function getMainnetChains(): ChainMeta[];
|
|
8
8
|
export declare function getTestnetChains(): ChainMeta[];
|
|
9
|
+
/** Returns ALL chains for a network including non-EVM (StarkNet). */
|
|
10
|
+
export declare function getAllChainsByNetwork(network: Network): ChainMeta[];
|
|
9
11
|
export declare function getDelegateContract(chainId: number): `0x${string}` | undefined;
|
|
12
|
+
export declare function isStarknetChain(chainId: number): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* StarkNet Mainnet chain ID as a JS number.
|
|
15
|
+
* NOTE: This value exceeds MAX_SAFE_INTEGER and is JS-rounded,
|
|
16
|
+
* but it's consistent with how CHAINS keys are stored.
|
|
17
|
+
* Use this constant everywhere instead of the hex literal 0x534e5f4d41494e
|
|
18
|
+
* to ensure consistent rounding across the codebase.
|
|
19
|
+
*/
|
|
20
|
+
export declare const STARKNET_MAINNET_CHAIN_ID: number;
|
|
10
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chains/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/chains/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGrD,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAEnE;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,CAIhE;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,EAAE,CAE/D;AAED,wBAAgB,gBAAgB,IAAI,SAAS,EAAE,CAE9C;AAED,wBAAgB,gBAAgB,IAAI,SAAS,EAAE,CAE9C;AAED,qEAAqE;AACrE,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,EAAE,CAEnE;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,MAAM,EAAE,GAAG,SAAS,CAE9E;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAExD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,EAAE,MAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/chains/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/chains/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAoM5C,CAAC"}
|
package/dist/chains/types.d.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
export type Network = "mainnet" | "testnet";
|
|
2
|
+
export type ChainType = "evm" | "starknet";
|
|
3
|
+
/**
|
|
4
|
+
* NOTE on StarkNet chain IDs: StarkNet uses hex felt values like 0x534e5f4d41494e
|
|
5
|
+
* which exceed Number.MAX_SAFE_INTEGER. JS rounds these silently when used as numbers.
|
|
6
|
+
* The `id` field uses the JS-rounded value for object key consistency (JS always rounds
|
|
7
|
+
* the same way). Use `chainIdHex` for accurate hex representation when interacting
|
|
8
|
+
* with StarkNet RPCs or wallets.
|
|
9
|
+
*/
|
|
2
10
|
export interface ChainMeta {
|
|
3
11
|
id: number;
|
|
4
12
|
name: string;
|
|
@@ -9,7 +17,10 @@ export interface ChainMeta {
|
|
|
9
17
|
symbol: string;
|
|
10
18
|
decimals: number;
|
|
11
19
|
};
|
|
12
|
-
|
|
20
|
+
chainType?: ChainType;
|
|
21
|
+
/** Hex string chain ID for non-EVM chains where numeric ID exceeds MAX_SAFE_INTEGER */
|
|
22
|
+
chainIdHex?: string;
|
|
23
|
+
delegateContract?: `0x${string}`;
|
|
13
24
|
blockExplorer: string;
|
|
14
25
|
rpcUrl: string;
|
|
15
26
|
logo: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/chains/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/chains/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAC5C,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,UAAU,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IACnE,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,uFAAuF;IACvF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,yBAAyB,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
|