Skip to content

Commit

Permalink
fix(storage): upload with default config
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbeckers committed Jun 12, 2024
1 parent c2613fe commit 45a2b11
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion sdk/package.json
Original file line number Diff line number Diff line change
@@ -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": "[email protected]:hypercerts-org/hypercerts.git",
"author": "Hypercerts team",
Expand Down
4 changes: 0 additions & 4 deletions sdk/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ export class HypercertClient implements HypercertClientInterface {
*/
constructor(config: Partial<HypercertClientConfig>) {
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 });
Expand Down
10 changes: 6 additions & 4 deletions sdk/src/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }),
};
};

0 comments on commit 45a2b11

Please sign in to comment.