@spicenet-io/spiceflow-core 0.7.0 → 0.7.1-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.
- 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
|
@@ -697,7 +697,8 @@ var TOKENS = [
|
|
|
697
697
|
deployments: [
|
|
698
698
|
{
|
|
699
699
|
chainId: 4114,
|
|
700
|
-
|
|
700
|
+
// Native cBTC; 0x310...0002 is Citrea's bridge contract, not a token.
|
|
701
|
+
address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
|
|
701
702
|
decimals: 18,
|
|
702
703
|
network: "mainnet",
|
|
703
704
|
swapContracts: []
|
|
@@ -760,18 +761,29 @@ var TOKENS = [
|
|
|
760
761
|
|
|
761
762
|
// src/tokens/index.ts
|
|
762
763
|
var _addressIndex = /* @__PURE__ */ new Map();
|
|
764
|
+
var _ambiguousAddresses = /* @__PURE__ */ new Set();
|
|
763
765
|
var _deploymentIndex = /* @__PURE__ */ new Map();
|
|
764
766
|
var _chainIndex = /* @__PURE__ */ new Map();
|
|
765
767
|
var _equivalenceIndex = /* @__PURE__ */ new Map();
|
|
766
768
|
var NATIVE_SENTINEL = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
767
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
|
+
}
|
|
768
780
|
function _buildIndexes() {
|
|
769
781
|
for (const token of TOKENS) {
|
|
770
782
|
const groupAddrs = _equivalenceIndex.get(token.equivalenceGroup) ?? [];
|
|
771
783
|
for (const d of token.deployments) {
|
|
772
784
|
const addr = d.address.toLowerCase();
|
|
773
785
|
const key = `${d.chainId}:${addr}`;
|
|
774
|
-
|
|
786
|
+
indexAddress(addr, token);
|
|
775
787
|
_deploymentIndex.set(key, { token, deployment: d });
|
|
776
788
|
const chainEntries = _chainIndex.get(d.chainId) ?? [];
|
|
777
789
|
chainEntries.push({ token, deployment: d });
|
|
@@ -781,7 +793,7 @@ function _buildIndexes() {
|
|
|
781
793
|
}
|
|
782
794
|
if (addr === NATIVE_SENTINEL) {
|
|
783
795
|
for (const alias of NATIVE_ALIASES) {
|
|
784
|
-
|
|
796
|
+
indexAddress(alias, token);
|
|
785
797
|
_deploymentIndex.set(`${d.chainId}:${alias}`, {
|
|
786
798
|
token,
|
|
787
799
|
deployment: d
|
package/dist/index.js
CHANGED
|
@@ -609,7 +609,8 @@ var TOKENS = [
|
|
|
609
609
|
deployments: [
|
|
610
610
|
{
|
|
611
611
|
chainId: 4114,
|
|
612
|
-
|
|
612
|
+
// Native cBTC; 0x310...0002 is Citrea's bridge contract, not a token.
|
|
613
|
+
address: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
|
|
613
614
|
decimals: 18,
|
|
614
615
|
network: "mainnet",
|
|
615
616
|
swapContracts: []
|
|
@@ -672,18 +673,29 @@ var TOKENS = [
|
|
|
672
673
|
|
|
673
674
|
// src/tokens/index.ts
|
|
674
675
|
var _addressIndex = /* @__PURE__ */ new Map();
|
|
676
|
+
var _ambiguousAddresses = /* @__PURE__ */ new Set();
|
|
675
677
|
var _deploymentIndex = /* @__PURE__ */ new Map();
|
|
676
678
|
var _chainIndex = /* @__PURE__ */ new Map();
|
|
677
679
|
var _equivalenceIndex = /* @__PURE__ */ new Map();
|
|
678
680
|
var NATIVE_SENTINEL = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
|
|
679
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
|
+
}
|
|
680
692
|
function _buildIndexes() {
|
|
681
693
|
for (const token of TOKENS) {
|
|
682
694
|
const groupAddrs = _equivalenceIndex.get(token.equivalenceGroup) ?? [];
|
|
683
695
|
for (const d of token.deployments) {
|
|
684
696
|
const addr = d.address.toLowerCase();
|
|
685
697
|
const key = `${d.chainId}:${addr}`;
|
|
686
|
-
|
|
698
|
+
indexAddress(addr, token);
|
|
687
699
|
_deploymentIndex.set(key, { token, deployment: d });
|
|
688
700
|
const chainEntries = _chainIndex.get(d.chainId) ?? [];
|
|
689
701
|
chainEntries.push({ token, deployment: d });
|
|
@@ -693,7 +705,7 @@ function _buildIndexes() {
|
|
|
693
705
|
}
|
|
694
706
|
if (addr === NATIVE_SENTINEL) {
|
|
695
707
|
for (const alias of NATIVE_ALIASES) {
|
|
696
|
-
|
|
708
|
+
indexAddress(alias, token);
|
|
697
709
|
_deploymentIndex.set(`${d.chainId}:${alias}`, {
|
|
698
710
|
token,
|
|
699
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,M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,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"}
|