@fileverse-dev/formulajs 4.4.21-price-and-wallet-6 → 4.4.21-price-and-wallet-7

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/cjs/index.cjs CHANGED
@@ -19172,12 +19172,24 @@ const priceSchema = objectType({
19172
19172
  path: ["input2"],
19173
19173
  });
19174
19174
  }
19175
+ if(data.input1?.split(',').length > 1){
19176
+ ctx.addIssue({
19177
+ code: ZodIssueCode.custom,
19178
+ message: "You can query a single token address at a time.",
19179
+ path: ["input1"],
19180
+ });
19181
+ }
19175
19182
  });
19176
19183
 
19177
19184
  async function PRICE() {
19178
19185
  try {
19179
- const [input1, input2, input3] = argsToArray(arguments);
19186
+ let [input1, input2, input3] = argsToArray(arguments);
19180
19187
  validateParams(priceSchema, { input1, input2, input3 });
19188
+ input1 = input1.replace(/\s+/g, "");
19189
+ input2 = input2.replace(/\s+/g, "");
19190
+ input3 = input3.replace(/\s+/g, "");
19191
+
19192
+
19181
19193
 
19182
19194
  // eslint-disable-next-line no-undef
19183
19195
  const baseUrl = window.useLocal ? 'http://localhost:3000' : 'https://onchain-proxy.fileverse.io';
@@ -19192,14 +19204,14 @@ async function PRICE() {
19192
19204
  const tokenAddress = input1;
19193
19205
  url += `&token=${tokenAddress}&chain=${input2}`;
19194
19206
  if(input3){
19195
- url += `&time=${encodeURIComponent(input3)}`;
19207
+ url += `&time=${input3}`;
19196
19208
  }
19197
19209
  } else {
19198
- const coin = input1.replace(/\s+/g, "");
19210
+ const coin = input1;
19199
19211
  url += `&coin=${coin}`;
19200
19212
  if (input2) {
19201
- url += `&time=${encodeURIComponent(input2)}`;
19202
- } else if(coin.split(',') === 1) {
19213
+ url += `&time=${input2}`;
19214
+ } else if(coin.split(',').length === 1) {
19203
19215
  returnSingleValue = true;
19204
19216
  }
19205
19217
  }
@@ -19266,6 +19278,8 @@ async function WALLET() {
19266
19278
  validateParams(walletParamsSchema, { addresses, chains, query, time });
19267
19279
 
19268
19280
  addresses = addresses.replace(/\s+/g, "");
19281
+ chains = chains.replace(/\s+/g, "");
19282
+ time = chains.replace(/\s+/g, "");
19269
19283
  const baseUrl = window.useLocal ? 'http://localhost:3000' : 'https://onchain-proxy.fileverse.io';
19270
19284
 
19271
19285
  const resolvedAddresses = await getResolvedAddresses(addresses);
@@ -965,7 +965,7 @@ var WALLET_metadata = {
965
965
  {
966
966
  name: "addresses",
967
967
  detail: "Comma separated addresses / ens",
968
- example: "vitalik.eth, 0xfA0253943c3FF0e43898cba5A7a0dA9D17C27995",
968
+ example: '"vitalik.eth, 0xfA0253943c3FF0e43898cba5A7a0dA9D17C27995"',
969
969
  require: "m",
970
970
  type: "string"
971
971
  },
package/lib/esm/index.mjs CHANGED
@@ -19170,12 +19170,24 @@ const priceSchema = objectType({
19170
19170
  path: ["input2"],
19171
19171
  });
19172
19172
  }
19173
+ if(data.input1?.split(',').length > 1){
19174
+ ctx.addIssue({
19175
+ code: ZodIssueCode.custom,
19176
+ message: "You can query a single token address at a time.",
19177
+ path: ["input1"],
19178
+ });
19179
+ }
19173
19180
  });
19174
19181
 
19175
19182
  async function PRICE() {
19176
19183
  try {
19177
- const [input1, input2, input3] = argsToArray(arguments);
19184
+ let [input1, input2, input3] = argsToArray(arguments);
19178
19185
  validateParams(priceSchema, { input1, input2, input3 });
19186
+ input1 = input1.replace(/\s+/g, "");
19187
+ input2 = input2.replace(/\s+/g, "");
19188
+ input3 = input3.replace(/\s+/g, "");
19189
+
19190
+
19179
19191
 
19180
19192
  // eslint-disable-next-line no-undef
19181
19193
  const baseUrl = window.useLocal ? 'http://localhost:3000' : 'https://onchain-proxy.fileverse.io';
@@ -19190,14 +19202,14 @@ async function PRICE() {
19190
19202
  const tokenAddress = input1;
19191
19203
  url += `&token=${tokenAddress}&chain=${input2}`;
19192
19204
  if(input3){
19193
- url += `&time=${encodeURIComponent(input3)}`;
19205
+ url += `&time=${input3}`;
19194
19206
  }
19195
19207
  } else {
19196
- const coin = input1.replace(/\s+/g, "");
19208
+ const coin = input1;
19197
19209
  url += `&coin=${coin}`;
19198
19210
  if (input2) {
19199
- url += `&time=${encodeURIComponent(input2)}`;
19200
- } else if(coin.split(',') === 1) {
19211
+ url += `&time=${input2}`;
19212
+ } else if(coin.split(',').length === 1) {
19201
19213
  returnSingleValue = true;
19202
19214
  }
19203
19215
  }
@@ -19264,6 +19276,8 @@ async function WALLET() {
19264
19276
  validateParams(walletParamsSchema, { addresses, chains, query, time });
19265
19277
 
19266
19278
  addresses = addresses.replace(/\s+/g, "");
19279
+ chains = chains.replace(/\s+/g, "");
19280
+ time = chains.replace(/\s+/g, "");
19267
19281
  const baseUrl = window.useLocal ? 'http://localhost:3000' : 'https://onchain-proxy.fileverse.io';
19268
19282
 
19269
19283
  const resolvedAddresses = await getResolvedAddresses(addresses);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/formulajs",
3
- "version": "4.4.21-price-and-wallet-6",
3
+ "version": "4.4.21-price-and-wallet-7",
4
4
  "description": "JavaScript implementation of most Microsoft Excel formula functions",
5
5
  "author": "Formulajs",
6
6
  "publishConfig": {