@spicenet-io/spiceflow-core 0.7.1 → 0.7.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/index.cjs +15 -3
- package/dist/index.js +15 -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
|
@@ -690,7 +690,8 @@ var TOKENS = [
|
|
|
690
690
|
deployments: [
|
|
691
691
|
{
|
|
692
692
|
chainId: 4114,
|
|
693
|
-
|
|
693
|
+
// Native cBTC; 0x310...0002 is Citrea's bridge contract, not a token.
|
|
694
|
+
address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
|
|
694
695
|
decimals: 18,
|
|
695
696
|
network: "mainnet",
|
|
696
697
|
swapContracts: []
|
|
@@ -753,18 +754,29 @@ var TOKENS = [
|
|
|
753
754
|
|
|
754
755
|
// src/tokens/index.ts
|
|
755
756
|
var _addressIndex = /* @__PURE__ */ new Map();
|
|
757
|
+
var _ambiguousAddresses = /* @__PURE__ */ new Set();
|
|
756
758
|
var _deploymentIndex = /* @__PURE__ */ new Map();
|
|
757
759
|
var _chainIndex = /* @__PURE__ */ new Map();
|
|
758
760
|
var _equivalenceIndex = /* @__PURE__ */ new Map();
|
|
759
761
|
var NATIVE_SENTINEL = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
760
762
|
var NATIVE_ALIASES = ["0x0000000000000000000000000000000000000000", "0x0"];
|
|
763
|
+
function indexAddress(address, token) {
|
|
764
|
+
if (_ambiguousAddresses.has(address)) return;
|
|
765
|
+
const previous = _addressIndex.get(address);
|
|
766
|
+
if (previous && previous.equivalenceGroup !== token.equivalenceGroup) {
|
|
767
|
+
_addressIndex.delete(address);
|
|
768
|
+
_ambiguousAddresses.add(address);
|
|
769
|
+
return;
|
|
770
|
+
}
|
|
771
|
+
_addressIndex.set(address, token);
|
|
772
|
+
}
|
|
761
773
|
function _buildIndexes() {
|
|
762
774
|
for (const token of TOKENS) {
|
|
763
775
|
const groupAddrs = _equivalenceIndex.get(token.equivalenceGroup) ?? [];
|
|
764
776
|
for (const d of token.deployments) {
|
|
765
777
|
const addr = d.address.toLowerCase();
|
|
766
778
|
const key = `${d.chainId}:${addr}`;
|
|
767
|
-
|
|
779
|
+
indexAddress(addr, token);
|
|
768
780
|
_deploymentIndex.set(key, { token, deployment: d });
|
|
769
781
|
const chainEntries = _chainIndex.get(d.chainId) ?? [];
|
|
770
782
|
chainEntries.push({ token, deployment: d });
|
|
@@ -774,7 +786,7 @@ function _buildIndexes() {
|
|
|
774
786
|
}
|
|
775
787
|
if (addr === NATIVE_SENTINEL) {
|
|
776
788
|
for (const alias of NATIVE_ALIASES) {
|
|
777
|
-
|
|
789
|
+
indexAddress(alias, token);
|
|
778
790
|
_deploymentIndex.set(`${d.chainId}:${alias}`, {
|
|
779
791
|
token,
|
|
780
792
|
deployment: d
|
package/dist/index.js
CHANGED
|
@@ -602,7 +602,8 @@ var TOKENS = [
|
|
|
602
602
|
deployments: [
|
|
603
603
|
{
|
|
604
604
|
chainId: 4114,
|
|
605
|
-
|
|
605
|
+
// Native cBTC; 0x310...0002 is Citrea's bridge contract, not a token.
|
|
606
|
+
address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
|
|
606
607
|
decimals: 18,
|
|
607
608
|
network: "mainnet",
|
|
608
609
|
swapContracts: []
|
|
@@ -665,18 +666,29 @@ var TOKENS = [
|
|
|
665
666
|
|
|
666
667
|
// src/tokens/index.ts
|
|
667
668
|
var _addressIndex = /* @__PURE__ */ new Map();
|
|
669
|
+
var _ambiguousAddresses = /* @__PURE__ */ new Set();
|
|
668
670
|
var _deploymentIndex = /* @__PURE__ */ new Map();
|
|
669
671
|
var _chainIndex = /* @__PURE__ */ new Map();
|
|
670
672
|
var _equivalenceIndex = /* @__PURE__ */ new Map();
|
|
671
673
|
var NATIVE_SENTINEL = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
672
674
|
var NATIVE_ALIASES = ["0x0000000000000000000000000000000000000000", "0x0"];
|
|
675
|
+
function indexAddress(address, token) {
|
|
676
|
+
if (_ambiguousAddresses.has(address)) return;
|
|
677
|
+
const previous = _addressIndex.get(address);
|
|
678
|
+
if (previous && previous.equivalenceGroup !== token.equivalenceGroup) {
|
|
679
|
+
_addressIndex.delete(address);
|
|
680
|
+
_ambiguousAddresses.add(address);
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
683
|
+
_addressIndex.set(address, token);
|
|
684
|
+
}
|
|
673
685
|
function _buildIndexes() {
|
|
674
686
|
for (const token of TOKENS) {
|
|
675
687
|
const groupAddrs = _equivalenceIndex.get(token.equivalenceGroup) ?? [];
|
|
676
688
|
for (const d of token.deployments) {
|
|
677
689
|
const addr = d.address.toLowerCase();
|
|
678
690
|
const key = `${d.chainId}:${addr}`;
|
|
679
|
-
|
|
691
|
+
indexAddress(addr, token);
|
|
680
692
|
_deploymentIndex.set(key, { token, deployment: d });
|
|
681
693
|
const chainEntries = _chainIndex.get(d.chainId) ?? [];
|
|
682
694
|
chainEntries.push({ token, deployment: d });
|
|
@@ -686,7 +698,7 @@ function _buildIndexes() {
|
|
|
686
698
|
}
|
|
687
699
|
if (addr === NATIVE_SENTINEL) {
|
|
688
700
|
for (const alias of NATIVE_ALIASES) {
|
|
689
|
-
|
|
701
|
+
indexAddress(alias, token);
|
|
690
702
|
_deploymentIndex.set(`${d.chainId}:${alias}`, {
|
|
691
703
|
token,
|
|
692
704
|
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,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E,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,EAqanC,CAAC"}
|