@fileverse-dev/formulajs 4.4.21-price-and-wallet-5 → 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';
@@ -19190,17 +19202,16 @@ async function PRICE() {
19190
19202
 
19191
19203
  if(isAddress$1.isAddress(input1)) {
19192
19204
  const tokenAddress = input1;
19193
- url += `&token=${encodeURIComponent(tokenAddress)}&chain=${encodeURIComponent(input2)}`;
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, "");
19199
- url += `&coin=${encodeURIComponent(coin)}`;
19210
+ const coin = input1;
19211
+ url += `&coin=${coin}`;
19200
19212
  if (input2) {
19201
- url += `&time=${encodeURIComponent(input2)}`;
19202
- url += `&coin=${encodeURIComponent(coin)}`;
19203
- } else if(coin.split(',') === 1) {
19213
+ url += `&time=${input2}`;
19214
+ } else if(coin.split(',').length === 1) {
19204
19215
  returnSingleValue = true;
19205
19216
  }
19206
19217
  }
@@ -19263,10 +19274,12 @@ const getResolvedAddresses = async (addresses) => {
19263
19274
 
19264
19275
  async function WALLET() {
19265
19276
  try {
19266
- const [addresses, chains, query, time] = argsToArray(arguments);
19277
+ let [addresses, chains, query, time] = argsToArray(arguments);
19267
19278
  validateParams(walletParamsSchema, { addresses, chains, query, time });
19268
19279
 
19269
- // eslint-disable-next-line no-undef
19280
+ addresses = addresses.replace(/\s+/g, "");
19281
+ chains = chains.replace(/\s+/g, "");
19282
+ time = chains.replace(/\s+/g, "");
19270
19283
  const baseUrl = window.useLocal ? 'http://localhost:3000' : 'https://onchain-proxy.fileverse.io';
19271
19284
 
19272
19285
  const resolvedAddresses = await getResolvedAddresses(addresses);
@@ -19297,7 +19310,7 @@ async function WALLET() {
19297
19310
 
19298
19311
 
19299
19312
  // WALLET("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "ethereum", "balance", "720,1,24").then(console.log)
19300
- // WALLET("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045, 0xfA0253943c3FF0e43898cba5A7a0dA9D17C27995", "ethereum", "txns", "720").then(console.log)
19313
+ // WALLET("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045, 0x50Aa3435E310d5a2d15a989Bc353ce7f5682E1d4", "ethereum, base", "balance", "720").then(console.log)
19301
19314
  // WALLET("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "ethereum", "balance").then(console.log)
19302
19315
 
19303
19316
  // export {GNOSISPAY} from './gnosispay/gnosispay.js'
@@ -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';
@@ -19188,17 +19200,16 @@ async function PRICE() {
19188
19200
 
19189
19201
  if(isAddress$1.isAddress(input1)) {
19190
19202
  const tokenAddress = input1;
19191
- url += `&token=${encodeURIComponent(tokenAddress)}&chain=${encodeURIComponent(input2)}`;
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, "");
19197
- url += `&coin=${encodeURIComponent(coin)}`;
19208
+ const coin = input1;
19209
+ url += `&coin=${coin}`;
19198
19210
  if (input2) {
19199
- url += `&time=${encodeURIComponent(input2)}`;
19200
- url += `&coin=${encodeURIComponent(coin)}`;
19201
- } else if(coin.split(',') === 1) {
19211
+ url += `&time=${input2}`;
19212
+ } else if(coin.split(',').length === 1) {
19202
19213
  returnSingleValue = true;
19203
19214
  }
19204
19215
  }
@@ -19261,10 +19272,12 @@ const getResolvedAddresses = async (addresses) => {
19261
19272
 
19262
19273
  async function WALLET() {
19263
19274
  try {
19264
- const [addresses, chains, query, time] = argsToArray(arguments);
19275
+ let [addresses, chains, query, time] = argsToArray(arguments);
19265
19276
  validateParams(walletParamsSchema, { addresses, chains, query, time });
19266
19277
 
19267
- // eslint-disable-next-line no-undef
19278
+ addresses = addresses.replace(/\s+/g, "");
19279
+ chains = chains.replace(/\s+/g, "");
19280
+ time = chains.replace(/\s+/g, "");
19268
19281
  const baseUrl = window.useLocal ? 'http://localhost:3000' : 'https://onchain-proxy.fileverse.io';
19269
19282
 
19270
19283
  const resolvedAddresses = await getResolvedAddresses(addresses);
@@ -19295,7 +19308,7 @@ async function WALLET() {
19295
19308
 
19296
19309
 
19297
19310
  // WALLET("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "ethereum", "balance", "720,1,24").then(console.log)
19298
- // WALLET("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045, 0xfA0253943c3FF0e43898cba5A7a0dA9D17C27995", "ethereum", "txns", "720").then(console.log)
19311
+ // WALLET("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045, 0x50Aa3435E310d5a2d15a989Bc353ce7f5682E1d4", "ethereum, base", "balance", "720").then(console.log)
19299
19312
  // WALLET("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "ethereum", "balance").then(console.log)
19300
19313
 
19301
19314
  // export {GNOSISPAY} from './gnosispay/gnosispay.js'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/formulajs",
3
- "version": "4.4.21-price-and-wallet-5",
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": {