diff --git a/examples/simple-dapp/public/.well-known/radix.json b/examples/simple-dapp/public/.well-known/radix.json index 2a1b0c64..f1984d78 100644 --- a/examples/simple-dapp/public/.well-known/radix.json +++ b/examples/simple-dapp/public/.well-known/radix.json @@ -1,5 +1,4 @@ { - "callbackPath": "/connect", "dApps": [ { "dAppDefinitionAddress": "account_tdx_2_12yf9gd53yfep7a669fv2t3wm7nz9zeezwd04n02a433ker8vza6rhe" diff --git a/packages/dapp-toolkit/src/error.ts b/packages/dapp-toolkit/src/error.ts index 13c2a86d..df0bd9fb 100644 --- a/packages/dapp-toolkit/src/error.ts +++ b/packages/dapp-toolkit/src/error.ts @@ -31,14 +31,21 @@ const defaultErrorMessage = new Map() .set(ErrorType.rejectedByUser, 'user rejected request') .set(ErrorType.canceledByUser, 'user has canceled the request') -export type SdkError = ReturnType +export type SdkError = { + error: string + interactionId: string + message?: string + jsError?: unknown +} export const SdkError = ( error: string, interactionId: string, message?: string, -) => ({ + jsError?: unknown, +): SdkError => ({ error, interactionId, message: message || defaultErrorMessage.get(error) || '', + jsError, }) diff --git a/packages/dapp-toolkit/src/modules/gateway/gateway.module.ts b/packages/dapp-toolkit/src/modules/gateway/gateway.module.ts index dc084882..33e45664 100644 --- a/packages/dapp-toolkit/src/modules/gateway/gateway.module.ts +++ b/packages/dapp-toolkit/src/modules/gateway/gateway.module.ts @@ -41,7 +41,16 @@ export const GatewayModule = (input: { retry.withBackoff$.pipe( switchMap((result) => { if (result.isErr()) - return [err(SdkError('failedToPollSubmittedTransaction', ''))] + return [ + err( + SdkError('failedToPollSubmittedTransaction', '', undefined, { + error: result.error, + context: + 'GatewayModule.pollTransactionStatus.retry.withBackoff$', + transactionIntentHash, + }), + ), + ] logger?.debug(`pollingTxStatus retry #${result.value + 1}`) @@ -56,7 +65,17 @@ export const GatewayModule = (input: { }) .mapErr((response) => { logger?.debug(response) - return SdkError('failedToPollSubmittedTransaction', '') + return SdkError( + 'failedToPollSubmittedTransaction', + '', + undefined, + { + error: response, + transactionIntentHash, + context: + 'GatewayModule.pollTransactionStatus.getTransactionStatus', + }, + ) }) }), filter(