@fileverse-dev/formulajs 4.4.12-mod-4 → 4.4.12-mod-6
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/lib/browser/formula.js +24 -28
- package/lib/browser/formula.min.js +2 -2
- package/lib/browser/formula.min.js.map +1 -1
- package/lib/cjs/index.cjs +17 -14
- package/lib/esm/crypto-constants.mjs +28 -7
- package/lib/esm/index.mjs +17 -14
- package/package.json +1 -1
package/lib/cjs/index.cjs
CHANGED
|
@@ -18602,19 +18602,20 @@ async function DUNESIM() {
|
|
|
18602
18602
|
};
|
|
18603
18603
|
|
|
18604
18604
|
if (type === 'activity') {
|
|
18605
|
-
const address =
|
|
18605
|
+
const address = fromEnsNameToAddress$1.validateAndGetAddress(input1);
|
|
18606
18606
|
const qs = buildQuery([['chain_ids', SUPPORTED_TOKEN_NAMES[input2] || input2], ['limit', input3]]);
|
|
18607
18607
|
route = `activity/${address}${qs}`;
|
|
18608
18608
|
}
|
|
18609
18609
|
|
|
18610
18610
|
if (type === 'price') {
|
|
18611
|
-
const chain = SUPPORTED_TOKEN_NAMES[input1] ||
|
|
18611
|
+
const chain = SUPPORTED_TOKEN_NAMES[input1] || input1;
|
|
18612
18612
|
const qs = buildQuery([
|
|
18613
18613
|
['chain_ids', chain],
|
|
18614
|
-
['historical_prices',
|
|
18614
|
+
['historical_prices', input2],
|
|
18615
18615
|
['limit', input4],
|
|
18616
18616
|
]);
|
|
18617
|
-
|
|
18617
|
+
const tokenAddress = input3 || "native";
|
|
18618
|
+
route = `token-info/${tokenAddress}${qs}`;
|
|
18618
18619
|
}
|
|
18619
18620
|
|
|
18620
18621
|
if (type === 'token_holders') {
|
|
@@ -18623,9 +18624,11 @@ async function DUNESIM() {
|
|
|
18623
18624
|
route = `token-holders/${chain}/${input1}${qs}`;
|
|
18624
18625
|
}
|
|
18625
18626
|
|
|
18626
|
-
const apiKey =
|
|
18627
|
+
const apiKey = window.localStorage.getItem(SERVICES_API_KEY.DuneSim);
|
|
18627
18628
|
const url = `https://api.sim.dune.com/v1/evm/${route}`;
|
|
18628
18629
|
|
|
18630
|
+
console.log({route});
|
|
18631
|
+
|
|
18629
18632
|
const { URL: finalUrl, HEADERS } = getUrlAndHeaders({
|
|
18630
18633
|
url, serviceName: "DuneSim",
|
|
18631
18634
|
headers: { "X-Sim-Api-Key": apiKey },
|
|
@@ -18650,17 +18653,17 @@ async function DUNESIM() {
|
|
|
18650
18653
|
|
|
18651
18654
|
|
|
18652
18655
|
// (async () => {
|
|
18653
|
-
//
|
|
18654
|
-
//
|
|
18655
|
-
//
|
|
18656
|
+
// Example: activity
|
|
18657
|
+
// const res1 = await DUNESIM('activity', '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045', "eth", 5);
|
|
18658
|
+
// console.log('Activity result:', res1, res1.length);
|
|
18656
18659
|
|
|
18657
|
-
//
|
|
18658
|
-
//
|
|
18659
|
-
//
|
|
18660
|
+
// // Example: price (token-info)
|
|
18661
|
+
// const res2 = await DUNESIM('price', 'base', '1,6,24', "0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca", 5);
|
|
18662
|
+
// console.log('Price result:', res2);
|
|
18660
18663
|
|
|
18661
|
-
//
|
|
18662
|
-
//
|
|
18663
|
-
//
|
|
18664
|
+
// // Example: token holders
|
|
18665
|
+
// const res3 = await DUNESIM('token_holders', '0x63706e401c06ac8513145b7687A14804d17f814b', "8453", 5);
|
|
18666
|
+
// console.log('Holders result:', res3, res3.length);
|
|
18664
18667
|
// })();
|
|
18665
18668
|
|
|
18666
18669
|
// export {GNOSISPAY} from './gnosispay/gnosispay.js'
|
|
@@ -883,22 +883,43 @@ var DUNESIM_metadata = {
|
|
|
883
883
|
BRAND_SECONDARY_COLOR: "#f9ab99",
|
|
884
884
|
n: "DUNESIM",
|
|
885
885
|
t: 20,
|
|
886
|
-
d: "Query Sim APIs for blockchain activity and
|
|
887
|
-
a: "Query Sim APIs for blockchain activity and
|
|
886
|
+
d: "Query Sim APIs for blockchain activity, token prices, and token-holder data.",
|
|
887
|
+
a: "Query Sim APIs for blockchain activity, token prices, and token-holder data.",
|
|
888
888
|
p: [
|
|
889
889
|
{
|
|
890
890
|
name: "type",
|
|
891
|
-
detail: "
|
|
892
|
-
example: `"
|
|
891
|
+
detail: "Specify \u201Cprice\u201D to query token price info, \u201Cactivity\u201D for wallet activity, or \u201Ctoken_holders\u201D for token-holder distribution.",
|
|
892
|
+
example: `"price"`,
|
|
893
893
|
require: "m",
|
|
894
894
|
type: "string"
|
|
895
895
|
},
|
|
896
896
|
{
|
|
897
|
-
name: "
|
|
898
|
-
detail: "
|
|
899
|
-
example:
|
|
897
|
+
name: "input1",
|
|
898
|
+
detail: 'When type is "price": the chain ID or name to query token prices. When "activity": wallet address or ENS. When "token_holders": token address.',
|
|
899
|
+
example: "base",
|
|
900
900
|
require: "m",
|
|
901
901
|
type: "string"
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
name: "input2",
|
|
905
|
+
detail: 'When "price": optional historical price offsets. When "activity": optional chain ID or name ( e.g eth ). When "token_holders": chain ID or name ( e.g eth ).',
|
|
906
|
+
example: `"1,6,24"`,
|
|
907
|
+
require: "o",
|
|
908
|
+
type: "string"
|
|
909
|
+
},
|
|
910
|
+
{
|
|
911
|
+
name: "input3",
|
|
912
|
+
detail: 'When "price": optional token contract address, when "activity": limit (1\u2013100), when "token_holders": limit (1\u2013500).',
|
|
913
|
+
example: `"0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca"`,
|
|
914
|
+
require: "o",
|
|
915
|
+
type: "number"
|
|
916
|
+
},
|
|
917
|
+
{
|
|
918
|
+
name: "input4",
|
|
919
|
+
detail: 'When "price": optional limit for results.',
|
|
920
|
+
example: `5`,
|
|
921
|
+
require: "o",
|
|
922
|
+
type: "number"
|
|
902
923
|
}
|
|
903
924
|
]
|
|
904
925
|
};
|
package/lib/esm/index.mjs
CHANGED
|
@@ -18600,19 +18600,20 @@ async function DUNESIM() {
|
|
|
18600
18600
|
};
|
|
18601
18601
|
|
|
18602
18602
|
if (type === 'activity') {
|
|
18603
|
-
const address =
|
|
18603
|
+
const address = fromEnsNameToAddress$1.validateAndGetAddress(input1);
|
|
18604
18604
|
const qs = buildQuery([['chain_ids', SUPPORTED_TOKEN_NAMES[input2] || input2], ['limit', input3]]);
|
|
18605
18605
|
route = `activity/${address}${qs}`;
|
|
18606
18606
|
}
|
|
18607
18607
|
|
|
18608
18608
|
if (type === 'price') {
|
|
18609
|
-
const chain = SUPPORTED_TOKEN_NAMES[input1] ||
|
|
18609
|
+
const chain = SUPPORTED_TOKEN_NAMES[input1] || input1;
|
|
18610
18610
|
const qs = buildQuery([
|
|
18611
18611
|
['chain_ids', chain],
|
|
18612
|
-
['historical_prices',
|
|
18612
|
+
['historical_prices', input2],
|
|
18613
18613
|
['limit', input4],
|
|
18614
18614
|
]);
|
|
18615
|
-
|
|
18615
|
+
const tokenAddress = input3 || "native";
|
|
18616
|
+
route = `token-info/${tokenAddress}${qs}`;
|
|
18616
18617
|
}
|
|
18617
18618
|
|
|
18618
18619
|
if (type === 'token_holders') {
|
|
@@ -18621,9 +18622,11 @@ async function DUNESIM() {
|
|
|
18621
18622
|
route = `token-holders/${chain}/${input1}${qs}`;
|
|
18622
18623
|
}
|
|
18623
18624
|
|
|
18624
|
-
const apiKey =
|
|
18625
|
+
const apiKey = window.localStorage.getItem(SERVICES_API_KEY.DuneSim);
|
|
18625
18626
|
const url = `https://api.sim.dune.com/v1/evm/${route}`;
|
|
18626
18627
|
|
|
18628
|
+
console.log({route});
|
|
18629
|
+
|
|
18627
18630
|
const { URL: finalUrl, HEADERS } = getUrlAndHeaders({
|
|
18628
18631
|
url, serviceName: "DuneSim",
|
|
18629
18632
|
headers: { "X-Sim-Api-Key": apiKey },
|
|
@@ -18648,17 +18651,17 @@ async function DUNESIM() {
|
|
|
18648
18651
|
|
|
18649
18652
|
|
|
18650
18653
|
// (async () => {
|
|
18651
|
-
//
|
|
18652
|
-
//
|
|
18653
|
-
//
|
|
18654
|
+
// Example: activity
|
|
18655
|
+
// const res1 = await DUNESIM('activity', '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045', "eth", 5);
|
|
18656
|
+
// console.log('Activity result:', res1, res1.length);
|
|
18654
18657
|
|
|
18655
|
-
//
|
|
18656
|
-
//
|
|
18657
|
-
//
|
|
18658
|
+
// // Example: price (token-info)
|
|
18659
|
+
// const res2 = await DUNESIM('price', 'base', '1,6,24', "0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca", 5);
|
|
18660
|
+
// console.log('Price result:', res2);
|
|
18658
18661
|
|
|
18659
|
-
//
|
|
18660
|
-
//
|
|
18661
|
-
//
|
|
18662
|
+
// // Example: token holders
|
|
18663
|
+
// const res3 = await DUNESIM('token_holders', '0x63706e401c06ac8513145b7687A14804d17f814b', "8453", 5);
|
|
18664
|
+
// console.log('Holders result:', res3, res3.length);
|
|
18662
18665
|
// })();
|
|
18663
18666
|
|
|
18664
18667
|
// export {GNOSISPAY} from './gnosispay/gnosispay.js'
|