diff --git a/lerna.json b/lerna.json index d7e77f1c..09908435 100644 --- a/lerna.json +++ b/lerna.json @@ -2,6 +2,6 @@ "packages": [ "packages/*" ], - "version": "6.0.0-alpha.3", + "version": "6.0.0-alpha.4", "$schema": "node_modules/lerna/schemas/lerna-schema.json" } diff --git a/packages/common/package.json b/packages/common/package.json index 42d82ed5..c2fe5f3b 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,6 +1,6 @@ { "name": "@streamflow/common", - "version": "6.0.0-alpha.3", + "version": "6.0.0-alpha.4", "description": "Common utilities and types used by streamflow packages.", "homepage": "https://github.com/streamflow-finance/js-sdk/", "main": "dist/index.js", diff --git a/packages/common/types.ts b/packages/common/types.ts index 03dc8a80..fe726196 100644 --- a/packages/common/types.ts +++ b/packages/common/types.ts @@ -29,14 +29,17 @@ export enum IChain { export class ContractError extends Error { public contractErrorCode: string | null; + public description: string | null; + /** * Constructs the Error Wrapper * @param error Original error raised probably by the chain SDK * @param code extracted code from the error if managed to parse it */ - constructor(error: Error, code?: string | null) { + constructor(error: Error, code?: string | null, description?: string | null) { super(error.message); // Call the base class constructor with the error message this.contractErrorCode = code ?? null; + this.description = description ?? null; // Copy properties from the original error Object.setPrototypeOf(this, ContractError.prototype); this.name = "ContractError"; // Set the name property diff --git a/packages/distributor/package.json b/packages/distributor/package.json index 05f34bec..aa804f88 100644 --- a/packages/distributor/package.json +++ b/packages/distributor/package.json @@ -1,6 +1,6 @@ { "name": "@streamflow/distributor", - "version": "6.0.0-alpha.3", + "version": "6.0.0-alpha.4", "description": "JavaScript SDK to interact with Streamflow Airdrop protocol.", "homepage": "https://github.com/streamflow-finance/js-sdk/", "main": "dist/index.js", diff --git a/packages/distributor/solana/utils.ts b/packages/distributor/solana/utils.ts index 10d252ec..506b8f6f 100644 --- a/packages/distributor/solana/utils.ts +++ b/packages/distributor/solana/utils.ts @@ -37,7 +37,7 @@ export async function wrappedSignAndExecuteTransaction( if (err instanceof Error) { const parsed = fromTxError(err); if (parsed) { - throw new ContractError(err, parsed.name); + throw new ContractError(err, parsed.name, parsed.msg); } } throw err; diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 900fb1d5..70c554c6 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@streamflow/eslint-config", - "version": "6.0.0-alpha.3", + "version": "6.0.0-alpha.4", "license": "ISC", "main": "index.js", "files": [ diff --git a/packages/stream/package.json b/packages/stream/package.json index 332950ed..a4e83789 100644 --- a/packages/stream/package.json +++ b/packages/stream/package.json @@ -1,6 +1,6 @@ { "name": "@streamflow/stream", - "version": "6.0.0-alpha.3", + "version": "6.0.0-alpha.4", "description": "JavaScript SDK to interact with Streamflow protocol.", "homepage": "https://github.com/streamflow-finance/js-sdk/", "main": "dist/index.js",