@spirobel/monero-wallet-api 0.3.5 → 0.3.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.
@@ -42,5 +42,8 @@ export declare function parseDestination(destination: string): string;
42
42
  export declare const OPEN_DOMAINS: string[];
43
43
  export declare function checkToolInvocationValidity(invo: ParsedMoneroToolInvocation): Promise<ToolInvocationValidity>;
44
44
  export declare const ADDRESS_VALID_RESPONSE: {
45
- valid_address: boolean;
45
+ readonly valid_address: true;
46
+ };
47
+ export declare const ADDRESS_INVALID_RESPONSE: {
48
+ readonly valid_address: false;
46
49
  };
@@ -129,7 +129,9 @@ export const OPEN_DOMAINS = ["monerochan.city"];
129
129
  export async function checkToolInvocationValidity(invo) {
130
130
  // send 001 fetch from destination domain to check if the address is valid
131
131
  if (invo.tool.tool_id == "001") {
132
- const checkUrl = `${invo.destination_domain}/monerochan001/${invo.tool.payload.address}`;
132
+ const link = invo[invo.found_in];
133
+ const invo_link = new URL(link);
134
+ const checkUrl = `${invo_link.origin}/monerochan001/${invo.tool.payload.address}`;
133
135
  try {
134
136
  if (invo.destination_domain === OPEN_DOMAINS[0]) {
135
137
  return "unverified";
@@ -163,3 +165,6 @@ export async function checkToolInvocationValidity(invo) {
163
165
  export const ADDRESS_VALID_RESPONSE = {
164
166
  valid_address: true,
165
167
  };
168
+ export const ADDRESS_INVALID_RESPONSE = {
169
+ valid_address: false,
170
+ };
package/package.json CHANGED
@@ -40,7 +40,7 @@
40
40
  "clean": "rm -rf ./dist"
41
41
  },
42
42
  "files": ["dist"],
43
- "version": "0.3.5",
43
+ "version": "0.3.7",
44
44
  "devDependencies": {
45
45
  "@types/bun": "latest"
46
46
  },