From 45a2b118a6e00e391aaebdb94f830ccc19273cfa Mon Sep 17 00:00:00 2001 From: bitbeckers Date: Wed, 12 Jun 2024 20:51:30 +0200 Subject: [PATCH] fix(storage): upload with default config --- sdk/package.json | 2 +- sdk/src/client.ts | 4 ---- sdk/src/storage.ts | 10 ++++++---- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/sdk/package.json b/sdk/package.json index 56abffa1..eabc5abf 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@hypercerts-org/sdk", - "version": "2.0.0-alpha.18", + "version": "2.0.0-alpha.19", "description": "SDK for hypercerts protocol", "repository": "git@github.com:hypercerts-org/hypercerts.git", "author": "Hypercerts team", diff --git a/sdk/src/client.ts b/sdk/src/client.ts index bbe3b8ed..de830108 100644 --- a/sdk/src/client.ts +++ b/sdk/src/client.ts @@ -70,10 +70,6 @@ export class HypercertClient implements HypercertClientInterface { */ constructor(config: Partial) { this._config = getConfig({ config }); - if (!this._config.publicClient) { - throw new ClientError("Could not connect to public client."); - } - this._publicClient = this._config?.publicClient; this._walletClient = this._config?.walletClient; this._storage = getStorage({ environment: this._config.environment }); diff --git a/sdk/src/storage.ts b/sdk/src/storage.ts index 83e9497a..ea37cb3c 100644 --- a/sdk/src/storage.ts +++ b/sdk/src/storage.ts @@ -19,10 +19,12 @@ export const getStorage = ({ const _config = { ...config, baseURL }; + console.log("config", _config); + return { - storeMetadata: async (metadata: HypercertMetadata, config: AxiosRequestConfig = _config) => - storeMetadata(metadata, config), - storeAllowlist: async (createAllowListRequest: CreateAllowListRequest, config: AxiosRequestConfig = _config) => - storeAllowList(createAllowListRequest, config), + storeMetadata: async (metadata: HypercertMetadata, config: AxiosRequestConfig = {}) => + storeMetadata(metadata, { ..._config, ...config }), + storeAllowlist: async (createAllowListRequest: CreateAllowListRequest, config: AxiosRequestConfig = {}) => + storeAllowList(createAllowListRequest, { ..._config, ...config }), }; };