From c6e9685bb248e79ea7ba71cefa2d298cd2c3ce30 Mon Sep 17 00:00:00 2001 From: Mahmoud Aboelenein Date: Mon, 20 May 2024 21:14:09 +0300 Subject: [PATCH 1/3] propagate request to wallets that supports runes_mint --- src/adapters/satsConnectAdapter.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/adapters/satsConnectAdapter.ts b/src/adapters/satsConnectAdapter.ts index 4b4b6ac..39afc4a 100644 --- a/src/adapters/satsConnectAdapter.ts +++ b/src/adapters/satsConnectAdapter.ts @@ -7,6 +7,16 @@ abstract class SatsConnectAdapter { private async mintRunes(params: Params<'runes_mint'>): Promise> { try { + const walletInfo = await this.requestInternal('getInfo', null).catch(() => null); + if (walletInfo && walletInfo.status === 'success') { + const isMintSupported = walletInfo.result.methods?.includes('runes_mint'); + if (isMintSupported) { + const response = await this.requestInternal('runes_mint', params); + if (response) { + return response; + } + } + } const mintRequest: Omit, 'network'> = { destinationAddress: params.destinationAddress, feeRate: params.feeRate, From a056af6ce27bc57ebf1af97b4465622678bd77e3 Mon Sep 17 00:00:00 2001 From: Mahmoud Aboelenein Date: Wed, 22 May 2024 03:07:49 +0300 Subject: [PATCH 2/3] propagate request to wallets that supports runes_etch --- src/adapters/satsConnectAdapter.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/adapters/satsConnectAdapter.ts b/src/adapters/satsConnectAdapter.ts index 39afc4a..a40936c 100644 --- a/src/adapters/satsConnectAdapter.ts +++ b/src/adapters/satsConnectAdapter.ts @@ -96,6 +96,16 @@ abstract class SatsConnectAdapter { appServiceFeeAddress: params.appServiceFeeAddress, }; try { + const walletInfo = await this.requestInternal('getInfo', null).catch(() => null); + if (walletInfo && walletInfo.status === 'success') { + const isMintSupported = walletInfo.result.methods?.includes('rune_etch'); + if (isMintSupported) { + const response = await this.requestInternal('runes_etch', params); + if (response) { + return response; + } + } + } const orderResponse = await new RunesApi(params.network).createEtchOrder(etchRequest); if (!orderResponse.data) { return { From eeb41dfe38258551f572802ec3bfc117d18e0e77 Mon Sep 17 00:00:00 2001 From: fede erbes Date: Tue, 4 Jun 2024 17:03:39 +0200 Subject: [PATCH 3/3] fix: typos --- 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 a40936c..9e605b7 100644 --- a/src/adapters/satsConnectAdapter.ts +++ b/src/adapters/satsConnectAdapter.ts @@ -98,8 +98,8 @@ abstract class SatsConnectAdapter { try { const walletInfo = await this.requestInternal('getInfo', null).catch(() => null); if (walletInfo && walletInfo.status === 'success') { - const isMintSupported = walletInfo.result.methods?.includes('rune_etch'); - if (isMintSupported) { + const isEtchSupported = walletInfo.result.methods?.includes('runes_etch'); + if (isEtchSupported) { const response = await this.requestInternal('runes_etch', params); if (response) { return response;