@spicenet-io/spiceflow-core 0.6.3 → 0.7.0-next.0

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 +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;AAc5C,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CA6P5C,CAAC"}
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/chains/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAc5C,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAmQ5C,CAAC"}
@@ -26,6 +26,15 @@ export interface ChainMeta {
26
26
  rpcUrl: string;
27
27
  logo: string;
28
28
  wrappedNativeTokenAddress?: `0x${string}`;
29
+ /**
30
+ * Value for the `chain` query parameter of the Moralis Web3 Data API, which
31
+ * backs wallet token discovery. Moralis takes either a name alias or the hex
32
+ * chain id for every chain it indexes, so both forms appear here.
33
+ *
34
+ * Set it only on a chain Moralis actually indexes, and re-check when adding
35
+ * one — Moralis has dropped chains before. Absent is the safe default: it
36
+ * means callers read a fixed token list over RPC instead.
37
+ */
29
38
  moralisId?: string;
30
39
  }
31
40
  //# sourceMappingURL=types.d.ts.map
@@ -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;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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AAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,yBAAyB,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;IAC1C;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
package/dist/index.cjs CHANGED
@@ -891,7 +891,8 @@ var CHAINS = {
891
891
  escrowContract: "0x93ee466f920e1b4961f85749001f03aAd868eF0E",
892
892
  blockExplorer: "https://etherscan.io",
893
893
  rpcUrl: "https://eth-mainnet.g.alchemy.com/v2/alch_4ehgbBF6bx-U6loLSFRIy",
894
- logo: logo_eth
894
+ logo: logo_eth,
895
+ moralisId: "eth"
895
896
  },
896
897
  8453: {
897
898
  id: 8453,
@@ -903,7 +904,8 @@ var CHAINS = {
903
904
  escrowContract: "0xd3F8f177BB3d7dfD883d7c232f3093EdD61C3De9",
904
905
  blockExplorer: "https://basescan.org",
905
906
  rpcUrl: "https://base-mainnet.g.alchemy.com/v2/alch_4ehgbBF6bx-U6loLSFRIy",
906
- logo: logo_base
907
+ logo: logo_base,
908
+ moralisId: "base"
907
909
  },
908
910
  42161: {
909
911
  id: 42161,
@@ -915,7 +917,8 @@ var CHAINS = {
915
917
  escrowContract: "0x47d6DB10d99b1E0A074B1467407C7A53B68e1147",
916
918
  blockExplorer: "https://arbiscan.io",
917
919
  rpcUrl: "https://arb-mainnet.g.alchemy.com/v2/alch_4ehgbBF6bx-U6loLSFRIy",
918
- logo: logo_arb
920
+ logo: logo_arb,
921
+ moralisId: "arbitrum"
919
922
  },
920
923
  4114: {
921
924
  id: 4114,
@@ -954,7 +957,8 @@ var CHAINS = {
954
957
  blockExplorer: "https://bscscan.com",
955
958
  rpcUrl: "https://bsc-dataseed.bnbchain.org",
956
959
  logo: logo_bnb,
957
- wrappedNativeTokenAddress: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"
960
+ wrappedNativeTokenAddress: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
961
+ moralisId: "bsc"
958
962
  },
959
963
  137: {
960
964
  id: 137,
@@ -967,7 +971,8 @@ var CHAINS = {
967
971
  blockExplorer: "https://polygonscan.com",
968
972
  rpcUrl: "https://polygon-bor-rpc.publicnode.com",
969
973
  logo: logo_polygon,
970
- wrappedNativeTokenAddress: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"
974
+ wrappedNativeTokenAddress: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
975
+ moralisId: "polygon"
971
976
  },
972
977
  143: {
973
978
  id: 143,
@@ -980,7 +985,8 @@ var CHAINS = {
980
985
  blockExplorer: "https://monadexplorer.com",
981
986
  rpcUrl: "https://rpc.monad.xyz",
982
987
  logo: logo_monad,
983
- wrappedNativeTokenAddress: "0x3bd359c1119da7da1d913d1c4d2b7c461115433a"
988
+ wrappedNativeTokenAddress: "0x3bd359c1119da7da1d913d1c4d2b7c461115433a",
989
+ moralisId: "monad"
984
990
  },
985
991
  11155111: {
986
992
  id: 11155111,
package/dist/index.js CHANGED
@@ -803,7 +803,8 @@ var CHAINS = {
803
803
  escrowContract: "0x93ee466f920e1b4961f85749001f03aAd868eF0E",
804
804
  blockExplorer: "https://etherscan.io",
805
805
  rpcUrl: "https://eth-mainnet.g.alchemy.com/v2/alch_4ehgbBF6bx-U6loLSFRIy",
806
- logo: logo_eth
806
+ logo: logo_eth,
807
+ moralisId: "eth"
807
808
  },
808
809
  8453: {
809
810
  id: 8453,
@@ -815,7 +816,8 @@ var CHAINS = {
815
816
  escrowContract: "0xd3F8f177BB3d7dfD883d7c232f3093EdD61C3De9",
816
817
  blockExplorer: "https://basescan.org",
817
818
  rpcUrl: "https://base-mainnet.g.alchemy.com/v2/alch_4ehgbBF6bx-U6loLSFRIy",
818
- logo: logo_base
819
+ logo: logo_base,
820
+ moralisId: "base"
819
821
  },
820
822
  42161: {
821
823
  id: 42161,
@@ -827,7 +829,8 @@ var CHAINS = {
827
829
  escrowContract: "0x47d6DB10d99b1E0A074B1467407C7A53B68e1147",
828
830
  blockExplorer: "https://arbiscan.io",
829
831
  rpcUrl: "https://arb-mainnet.g.alchemy.com/v2/alch_4ehgbBF6bx-U6loLSFRIy",
830
- logo: logo_arb
832
+ logo: logo_arb,
833
+ moralisId: "arbitrum"
831
834
  },
832
835
  4114: {
833
836
  id: 4114,
@@ -866,7 +869,8 @@ var CHAINS = {
866
869
  blockExplorer: "https://bscscan.com",
867
870
  rpcUrl: "https://bsc-dataseed.bnbchain.org",
868
871
  logo: logo_bnb,
869
- wrappedNativeTokenAddress: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"
872
+ wrappedNativeTokenAddress: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
873
+ moralisId: "bsc"
870
874
  },
871
875
  137: {
872
876
  id: 137,
@@ -879,7 +883,8 @@ var CHAINS = {
879
883
  blockExplorer: "https://polygonscan.com",
880
884
  rpcUrl: "https://polygon-bor-rpc.publicnode.com",
881
885
  logo: logo_polygon,
882
- wrappedNativeTokenAddress: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270"
886
+ wrappedNativeTokenAddress: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
887
+ moralisId: "polygon"
883
888
  },
884
889
  143: {
885
890
  id: 143,
@@ -892,7 +897,8 @@ var CHAINS = {
892
897
  blockExplorer: "https://monadexplorer.com",
893
898
  rpcUrl: "https://rpc.monad.xyz",
894
899
  logo: logo_monad,
895
- wrappedNativeTokenAddress: "0x3bd359c1119da7da1d913d1c4d2b7c461115433a"
900
+ wrappedNativeTokenAddress: "0x3bd359c1119da7da1d913d1c4d2b7c461115433a",
901
+ moralisId: "monad"
896
902
  },
897
903
  11155111: {
898
904
  id: 11155111,
package/dist/types.d.ts CHANGED
@@ -28,11 +28,25 @@ export interface ChainToken {
28
28
  chainId: number;
29
29
  }
30
30
  export type TokenRef = [symbol: string, chainId: number];
31
- export type RouteStrategy = "direct" | "source-swap" | "intermediary";
31
+ /**
32
+ * How a route carries the user's source asset into the action's output asset.
33
+ *
34
+ * The first three front the source through escrow, so they all end up holding a
35
+ * token the rollup maps. `direct-swap` is the one route that never touches
36
+ * escrow, which is what makes it the route for an asset the rollup cannot map.
37
+ *
38
+ * - `direct` — the source has an equivalent on the destination; front it, no source swap.
39
+ * - `source-swap` — swap source into the output asset on the source chain, then front.
40
+ * - `intermediary` — swap into a common asset on the source, front it, swap into the output.
41
+ * - `direct-swap` — source and output are on one chain: swap and act in a single
42
+ * batch, nothing escrowed and nothing fronted.
43
+ */
44
+ export type RouteStrategy = "direct" | "source-swap" | "intermediary" | "direct-swap";
32
45
  export interface RoutePlan {
33
46
  strategy: RouteStrategy;
34
47
  sourceAsset: ChainToken;
35
48
  outputAsset: ChainToken;
49
+ /** `intermediary` only: the asset escrow fronts, named on the DESTINATION chain. */
36
50
  intermediaryAsset?: ChainToken;
37
51
  sourceChainId: number;
38
52
  destinationChainId: number;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAE1D,MAAM,MAAM,IAAI,GAAG;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAE,CAAC;AAE7D,mGAAmG;AACnG,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,2EAA2E;AAC3E,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,UAAU,CAAC;AAE3C,0EAA0E;AAC1E,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,QAA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D,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,aAAa,CAAC;IACxB,WAAW,EAAE,UAAU,CAAC;IACxB,WAAW,EAAE,UAAU,CAAC;IACxB,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,MAAM;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,SAAS,GAAG,GAAG,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,IAAI,EAAE,CAAA;KAAE,CAAC,CAAC;CACrE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spicenet-io/spiceflow-core",
3
- "version": "0.6.3",
3
+ "version": "0.7.0-next.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",