From 42a0e9799b4d7d621ae8eb7a958c14c9da2d6ba5 Mon Sep 17 00:00:00 2001 From: Mahmoud Aboelenein Date: Thu, 4 Jul 2024 10:28:23 +0300 Subject: [PATCH 1/4] handle method not supported error --- src/adapters/satsConnectAdapter.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/adapters/satsConnectAdapter.ts b/src/adapters/satsConnectAdapter.ts index 2dec09b..ebf5e23 100644 --- a/src/adapters/satsConnectAdapter.ts +++ b/src/adapters/satsConnectAdapter.ts @@ -13,7 +13,15 @@ abstract class SatsConnectAdapter { if (isMintSupported) { const response = await this.requestInternal('runes_mint', params); if (response) { - return response; + if (response.status === 'success') { + return response; + } + if ( + response.status === 'error' && + response.error.code !== RpcErrorCode.METHOD_NOT_SUPPORTED + ) { + return response; + } } } } From e2922e376610056699e7ea80f03073cc4b148c20 Mon Sep 17 00:00:00 2001 From: Mahmoud Aboelenein Date: Thu, 4 Jul 2024 12:30:05 +0300 Subject: [PATCH 2/4] update version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 885596f..28f979c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@sats-connect/core", - "version": "0.0.14", + "version": "0.0.15", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@sats-connect/core", - "version": "0.0.14", + "version": "0.0.15", "license": "ISC", "dependencies": { "axios": "1.6.8", diff --git a/package.json b/package.json index bfe228e..11bc44c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sats-connect/core", - "version": "0.0.14", + "version": "0.0.15", "main": "dist/index.mjs", "module": "dist/index.mjs", "types": "dist/index.d.mts", From 46385f91744d0552a94d88dbb934d34c641864a6 Mon Sep 17 00:00:00 2001 From: Mahmoud Aboelenein Date: Thu, 4 Jul 2024 12:48:24 +0300 Subject: [PATCH 3/4] check for unsupported error on etch --- src/adapters/satsConnectAdapter.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/adapters/satsConnectAdapter.ts b/src/adapters/satsConnectAdapter.ts index ebf5e23..83fda86 100644 --- a/src/adapters/satsConnectAdapter.ts +++ b/src/adapters/satsConnectAdapter.ts @@ -104,7 +104,15 @@ abstract class SatsConnectAdapter { if (isEtchSupported) { const response = await this.requestInternal('runes_etch', params); if (response) { - return response; + if (response.status === 'success') { + return response; + } + if ( + response.status === 'error' && + response.error.code !== RpcErrorCode.METHOD_NOT_SUPPORTED + ) { + return response; + } } } } From a6002078f77616d1c19ee299c3677992b28bbee1 Mon Sep 17 00:00:00 2001 From: Mahmoud Aboelenein Date: Thu, 4 Jul 2024 13:09:21 +0300 Subject: [PATCH 4/4] switch error code check --- src/adapters/satsConnectAdapter.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adapters/satsConnectAdapter.ts b/src/adapters/satsConnectAdapter.ts index 83fda86..9534ec4 100644 --- a/src/adapters/satsConnectAdapter.ts +++ b/src/adapters/satsConnectAdapter.ts @@ -18,7 +18,7 @@ abstract class SatsConnectAdapter { } if ( response.status === 'error' && - response.error.code !== RpcErrorCode.METHOD_NOT_SUPPORTED + response.error.code !== RpcErrorCode.METHOD_NOT_FOUND ) { return response; } @@ -109,7 +109,7 @@ abstract class SatsConnectAdapter { } if ( response.status === 'error' && - response.error.code !== RpcErrorCode.METHOD_NOT_SUPPORTED + response.error.code !== RpcErrorCode.METHOD_NOT_FOUND ) { return response; }