@zkp2p/sdk 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -289,6 +289,7 @@ declare function apiRedeemReferralCode(req: RedeemReferralCodeRequest, opts: Api
289
289
  declare function apiUpdateReferralCode(req: UpdateReferralCodeRequest, opts: ApiAdapterOptions): Promise<UpdateReferralCodeResponse>;
290
290
  declare function apiUploadGoogleOAuthSellerCredential<P extends GoogleOAuthSellerCredentialPlatform>(processorName: P, payeeDetails: Hash, body: GoogleOAuthSellerCredentialUploadBodyByPlatform[P], baseApiUrl: string, opts?: {
291
291
  timeoutMs?: number;
292
+ authorizationToken?: string;
292
293
  }): Promise<CuratorSellerCredentialUploadResponse>;
293
294
  declare function apiGetOrderbook(params: GetOrderbookParams, opts: ApiAdapterOptions): Promise<GetOrderbookResponse>;
294
295
  declare function apiGetOrderbook(params: GetOrderbookParams, baseApiUrl: string, timeoutMs?: number): Promise<GetOrderbookResponse>;
package/dist/index.d.ts CHANGED
@@ -289,6 +289,7 @@ declare function apiRedeemReferralCode(req: RedeemReferralCodeRequest, opts: Api
289
289
  declare function apiUpdateReferralCode(req: UpdateReferralCodeRequest, opts: ApiAdapterOptions): Promise<UpdateReferralCodeResponse>;
290
290
  declare function apiUploadGoogleOAuthSellerCredential<P extends GoogleOAuthSellerCredentialPlatform>(processorName: P, payeeDetails: Hash, body: GoogleOAuthSellerCredentialUploadBodyByPlatform[P], baseApiUrl: string, opts?: {
291
291
  timeoutMs?: number;
292
+ authorizationToken?: string;
292
293
  }): Promise<CuratorSellerCredentialUploadResponse>;
293
294
  declare function apiGetOrderbook(params: GetOrderbookParams, opts: ApiAdapterOptions): Promise<GetOrderbookResponse>;
294
295
  declare function apiGetOrderbook(params: GetOrderbookParams, baseApiUrl: string, timeoutMs?: number): Promise<GetOrderbookResponse>;
package/dist/index.mjs CHANGED
@@ -4643,7 +4643,8 @@ async function apiUploadGoogleOAuthSellerCredential(processorName, payeeDetails,
4643
4643
  url: `${withApiBase(baseApiUrl)}${endpoint}`,
4644
4644
  method: "POST",
4645
4645
  body,
4646
- timeoutMs: opts?.timeoutMs
4646
+ timeoutMs: opts?.timeoutMs,
4647
+ authorizationToken: opts?.authorizationToken
4647
4648
  });
4648
4649
  }
4649
4650
  async function apiGetSellerCredentialStatus(processorName, payeeDetails, baseApiUrl, timeoutMs) {
@@ -8704,6 +8705,18 @@ var Zkp2pClient = class {
8704
8705
  opts?.baseApiUrl ?? this.baseApiUrl ?? DEFAULT_BASE_API_URL
8705
8706
  );
8706
8707
  const timeoutMs = opts?.timeoutMs ?? this.apiTimeoutMs;
8708
+ const getUploadOptions = async () => {
8709
+ let authorizationToken;
8710
+ try {
8711
+ authorizationToken = await this.resolveAuthorizationToken();
8712
+ } catch {
8713
+ authorizationToken = void 0;
8714
+ }
8715
+ return {
8716
+ timeoutMs,
8717
+ ...authorizationToken ? { authorizationToken } : {}
8718
+ };
8719
+ };
8707
8720
  if (params.platform === "paypal") {
8708
8721
  return apiUploadGoogleOAuthSellerCredential(
8709
8722
  "paypal",
@@ -8714,9 +8727,7 @@ var Zkp2pClient = class {
8714
8727
  redirectUri: params.redirectUri
8715
8728
  },
8716
8729
  baseApiUrl,
8717
- {
8718
- timeoutMs
8719
- }
8730
+ await getUploadOptions()
8720
8731
  );
8721
8732
  }
8722
8733
  if (params.platform === "venmo") {
@@ -8729,9 +8740,7 @@ var Zkp2pClient = class {
8729
8740
  redirectUri: params.redirectUri
8730
8741
  },
8731
8742
  baseApiUrl,
8732
- {
8733
- timeoutMs
8734
- }
8743
+ await getUploadOptions()
8735
8744
  );
8736
8745
  }
8737
8746
  throw new ValidationError(