@spicenet-io/spiceflow-core 0.7.1 → 0.7.3
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.cjs +22 -3
- package/dist/index.js +22 -3
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/list.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -487,6 +487,13 @@ var TOKENS = [
|
|
|
487
487
|
network: "mainnet",
|
|
488
488
|
swapContracts: []
|
|
489
489
|
},
|
|
490
|
+
{
|
|
491
|
+
chainId: 8453,
|
|
492
|
+
address: "0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2",
|
|
493
|
+
decimals: 6,
|
|
494
|
+
network: "mainnet",
|
|
495
|
+
swapContracts: []
|
|
496
|
+
},
|
|
490
497
|
{
|
|
491
498
|
chainId: 42161,
|
|
492
499
|
address: "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",
|
|
@@ -690,7 +697,8 @@ var TOKENS = [
|
|
|
690
697
|
deployments: [
|
|
691
698
|
{
|
|
692
699
|
chainId: 4114,
|
|
693
|
-
|
|
700
|
+
// Native cBTC; 0x310...0002 is Citrea's bridge contract, not a token.
|
|
701
|
+
address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
|
|
694
702
|
decimals: 18,
|
|
695
703
|
network: "mainnet",
|
|
696
704
|
swapContracts: []
|
|
@@ -753,18 +761,29 @@ var TOKENS = [
|
|
|
753
761
|
|
|
754
762
|
// src/tokens/index.ts
|
|
755
763
|
var _addressIndex = /* @__PURE__ */ new Map();
|
|
764
|
+
var _ambiguousAddresses = /* @__PURE__ */ new Set();
|
|
756
765
|
var _deploymentIndex = /* @__PURE__ */ new Map();
|
|
757
766
|
var _chainIndex = /* @__PURE__ */ new Map();
|
|
758
767
|
var _equivalenceIndex = /* @__PURE__ */ new Map();
|
|
759
768
|
var NATIVE_SENTINEL = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
760
769
|
var NATIVE_ALIASES = ["0x0000000000000000000000000000000000000000", "0x0"];
|
|
770
|
+
function indexAddress(address, token) {
|
|
771
|
+
if (_ambiguousAddresses.has(address)) return;
|
|
772
|
+
const previous = _addressIndex.get(address);
|
|
773
|
+
if (previous && previous.equivalenceGroup !== token.equivalenceGroup) {
|
|
774
|
+
_addressIndex.delete(address);
|
|
775
|
+
_ambiguousAddresses.add(address);
|
|
776
|
+
return;
|
|
777
|
+
}
|
|
778
|
+
_addressIndex.set(address, token);
|
|
779
|
+
}
|
|
761
780
|
function _buildIndexes() {
|
|
762
781
|
for (const token of TOKENS) {
|
|
763
782
|
const groupAddrs = _equivalenceIndex.get(token.equivalenceGroup) ?? [];
|
|
764
783
|
for (const d of token.deployments) {
|
|
765
784
|
const addr = d.address.toLowerCase();
|
|
766
785
|
const key = `${d.chainId}:${addr}`;
|
|
767
|
-
|
|
786
|
+
indexAddress(addr, token);
|
|
768
787
|
_deploymentIndex.set(key, { token, deployment: d });
|
|
769
788
|
const chainEntries = _chainIndex.get(d.chainId) ?? [];
|
|
770
789
|
chainEntries.push({ token, deployment: d });
|
|
@@ -774,7 +793,7 @@ function _buildIndexes() {
|
|
|
774
793
|
}
|
|
775
794
|
if (addr === NATIVE_SENTINEL) {
|
|
776
795
|
for (const alias of NATIVE_ALIASES) {
|
|
777
|
-
|
|
796
|
+
indexAddress(alias, token);
|
|
778
797
|
_deploymentIndex.set(`${d.chainId}:${alias}`, {
|
|
779
798
|
token,
|
|
780
799
|
deployment: d
|
package/dist/index.js
CHANGED
|
@@ -399,6 +399,13 @@ var TOKENS = [
|
|
|
399
399
|
network: "mainnet",
|
|
400
400
|
swapContracts: []
|
|
401
401
|
},
|
|
402
|
+
{
|
|
403
|
+
chainId: 8453,
|
|
404
|
+
address: "0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2",
|
|
405
|
+
decimals: 6,
|
|
406
|
+
network: "mainnet",
|
|
407
|
+
swapContracts: []
|
|
408
|
+
},
|
|
402
409
|
{
|
|
403
410
|
chainId: 42161,
|
|
404
411
|
address: "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9",
|
|
@@ -602,7 +609,8 @@ var TOKENS = [
|
|
|
602
609
|
deployments: [
|
|
603
610
|
{
|
|
604
611
|
chainId: 4114,
|
|
605
|
-
|
|
612
|
+
// Native cBTC; 0x310...0002 is Citrea's bridge contract, not a token.
|
|
613
|
+
address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
|
|
606
614
|
decimals: 18,
|
|
607
615
|
network: "mainnet",
|
|
608
616
|
swapContracts: []
|
|
@@ -665,18 +673,29 @@ var TOKENS = [
|
|
|
665
673
|
|
|
666
674
|
// src/tokens/index.ts
|
|
667
675
|
var _addressIndex = /* @__PURE__ */ new Map();
|
|
676
|
+
var _ambiguousAddresses = /* @__PURE__ */ new Set();
|
|
668
677
|
var _deploymentIndex = /* @__PURE__ */ new Map();
|
|
669
678
|
var _chainIndex = /* @__PURE__ */ new Map();
|
|
670
679
|
var _equivalenceIndex = /* @__PURE__ */ new Map();
|
|
671
680
|
var NATIVE_SENTINEL = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
672
681
|
var NATIVE_ALIASES = ["0x0000000000000000000000000000000000000000", "0x0"];
|
|
682
|
+
function indexAddress(address, token) {
|
|
683
|
+
if (_ambiguousAddresses.has(address)) return;
|
|
684
|
+
const previous = _addressIndex.get(address);
|
|
685
|
+
if (previous && previous.equivalenceGroup !== token.equivalenceGroup) {
|
|
686
|
+
_addressIndex.delete(address);
|
|
687
|
+
_ambiguousAddresses.add(address);
|
|
688
|
+
return;
|
|
689
|
+
}
|
|
690
|
+
_addressIndex.set(address, token);
|
|
691
|
+
}
|
|
673
692
|
function _buildIndexes() {
|
|
674
693
|
for (const token of TOKENS) {
|
|
675
694
|
const groupAddrs = _equivalenceIndex.get(token.equivalenceGroup) ?? [];
|
|
676
695
|
for (const d of token.deployments) {
|
|
677
696
|
const addr = d.address.toLowerCase();
|
|
678
697
|
const key = `${d.chainId}:${addr}`;
|
|
679
|
-
|
|
698
|
+
indexAddress(addr, token);
|
|
680
699
|
_deploymentIndex.set(key, { token, deployment: d });
|
|
681
700
|
const chainEntries = _chainIndex.get(d.chainId) ?? [];
|
|
682
701
|
chainEntries.push({ token, deployment: d });
|
|
@@ -686,7 +705,7 @@ function _buildIndexes() {
|
|
|
686
705
|
}
|
|
687
706
|
if (addr === NATIVE_SENTINEL) {
|
|
688
707
|
for (const alias of NATIVE_ALIASES) {
|
|
689
|
-
|
|
708
|
+
indexAddress(alias, token);
|
|
690
709
|
_deploymentIndex.set(`${d.chainId}:${alias}`, {
|
|
691
710
|
token,
|
|
692
711
|
deployment: d
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tokens/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,YAAY,EACZ,eAAe,EACf,eAAe,EACf,KAAK,GACN,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tokens/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,YAAY,EACZ,eAAe,EACf,eAAe,EACf,KAAK,GACN,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAkFxD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,EAAE,CAI1D;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,KAAK,GAAG,SAAS,CAInB;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd,KAAK,GAAG,SAAS,CAInB;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,KAAK,CAO3E;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,GACd,eAAe,GAAG,SAAS,CAE7B;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,eAAe,GAAG,SAAS,CAG7B;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,EAAE,CAQrE;AAED,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE5E;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAK3D;AAKD,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGzD;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGzD;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,QAAQ,GAAG,UAAU,CAgBzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/tokens/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAWlD,eAAO,MAAM,MAAM,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/tokens/list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAWlD,eAAO,MAAM,MAAM,EAAE,eAAe,EA4anC,CAAC"}
|