@spirobel/monero-wallet-api 0.6.12 → 0.6.15

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.
@@ -1949,17 +1949,20 @@ function make(payload) {
1949
1949
  const base = `${TOOL_MAGIC_STRING}001_amount_${payload.amount}_address_${payload.address}`;
1950
1950
  return payload.no_check ? `${base}_no_check` : base;
1951
1951
  }
1952
+ var MONERO_ADDRESS_SHAPE = /^[1-9A-HJ-NP-Za-km-z]{95}$|^[1-9A-HJ-NP-Za-km-z]{106}$/;
1952
1953
  async function validate_check(invo) {
1953
1954
  const tool = invo.tool;
1954
1955
  if (tool.tool_id !== "001")
1955
1956
  return "unverified";
1956
1957
  if (tool.payload.no_check)
1957
1958
  return "unverified";
1959
+ if (!MONERO_ADDRESS_SHAPE.test(tool.payload.address))
1960
+ return "invalid";
1958
1961
  const link = invo[invo.found_in];
1959
1962
  const invo_link = new URL(link);
1960
1963
  const checkUrl = `${invo_link.origin}/monerochan001/${tool.payload.address}`;
1961
1964
  try {
1962
- const result = await (await fetch(checkUrl)).json();
1965
+ const result = await (await fetch(checkUrl, { redirect: "error" })).json();
1963
1966
  if (result && typeof result === "object" && "valid_address" in result && result.valid_address === true) {
1964
1967
  return "valid";
1965
1968
  }
package/package.json CHANGED
@@ -1,6 +1,11 @@
1
1
  {
2
2
  "name": "@spirobel/monero-wallet-api",
3
- "version": "0.6.12",
3
+ "version": "0.6.15",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "https://github.com/monerochan-ecosystem/monero-wallet-api",
7
+ "directory": "typescript"
8
+ },
4
9
  "main": "dist/xmr3.js",
5
10
  "module": "dist/xmr3.js",
6
11
  "devDependencies": {