@zkp2p/sdk 0.4.0-rc.4 → 0.4.0
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.cjs +95 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +95 -27
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/{vaultUtils-ChVrAlJN.d.mts → vaultUtils-CyPf4QGT.d.mts} +45 -10
- package/dist/{vaultUtils-ChVrAlJN.d.ts → vaultUtils-CyPf4QGT.d.ts} +45 -10
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, S as SellerCredentialUploadInput, a as SellerPlatform, b as SellerCredentialAttestationRuntime, A as AttestationServiceSellerCredentialUploadResponse, Q as QuotesBestByPlatformRequest, B as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, c as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, d as PostDepositDetailsResponse, G as GetPayeeDetailsRequest, e as GetPayeeDetailsResponse, f as GetOwnerDepositsRequest, g as GetOwnerDepositsResponse, h as GetTakerTierRequest, i as GetTakerTierResponse, j as GetDepositBundleParams, k as ApiAdapterOptions, l as GetDepositBundleResponse, m as GetOrderbookParams, n as GetOrderbookResponse, C as CurrencyType, o as PaymentMethodCatalog, T as TxOverrides } from './vaultUtils-
|
|
2
|
-
export { v as ActionCallback, aa as ApiDeposit, ah as ApiIntentStatus,
|
|
1
|
+
import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, S as SellerCredentialUploadInput, a as SellerPlatform, b as SellerCredentialAttestationRuntime, A as AttestationServiceSellerCredentialUploadResponse, Q as QuotesBestByPlatformRequest, B as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, c as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, d as PostDepositDetailsResponse, G as GetPayeeDetailsRequest, e as GetPayeeDetailsResponse, f as GetOwnerDepositsRequest, g as GetOwnerDepositsResponse, h as GetTakerTierRequest, i as GetTakerTierResponse, j as GetDepositBundleParams, k as ApiAdapterOptions, l as GetDepositBundleResponse, m as GetOrderbookParams, n as GetOrderbookResponse, C as CurrencyType, o as PaymentMethodCatalog, T as TxOverrides } from './vaultUtils-CyPf4QGT.mjs';
|
|
2
|
+
export { v as ActionCallback, aa as ApiDeposit, ah as ApiIntentStatus, aS as AttestationServiceSellerCredentialProbeResponse, aR as AttestationServiceSellerVerifyResponse, t as AuthorizationTokenProvider, cj as BatchResult, K as BestByPlatformResponseObject, r as CancelIntentMethodParams, J as CancelIntentParams, ay as CashAppCredentialUploadInput, ar as CashAppSessionMaterial, x as CreateDepositConversionRate, w as CreateDepositParams, aU as CuratorSellerCredentialStatusResponse, aT as CuratorSellerCredentialUploadResponse, aV as CuratorSellerVerifyResponse, bO as Currency, bV as CurrencyData, ci as DelegationDepositTarget, cg as DelegationRoute, ch as DelegationState, c4 as Deposit, c6 as DepositCurrency, b3 as DepositIntentStatistics, ad as DepositStatus, ab as DepositVerifier, ac as DepositVerifierCurrency, b0 as DepositVerifierData, c3 as DepositView, a6 as FiatResponse, F as FulfillIntentMethodParams, E as FulfillIntentParams, L as GetBestByPlatformResponse, M as GetBestByPlatformResponseObject, ae as GetDepositByIdRequest, af as GetDepositByIdResponse, am as GetIntentByHashRequest, an as GetIntentByHashResponse, ak as GetIntentsByDepositRequest, al as GetIntentsByDepositResponse, X as GetNearbyQuote, Y as GetNearbySuggestions, ai as GetOwnerIntentsRequest, aj as GetOwnerIntentsResponse, N as GetPlatformQuote, _ as GetQuoteResponse, $ as GetQuoteResponseObject, a0 as GetQuoteSingleResponse, aZ as GetSellerCredentialStatusParams, ba as IndexerClient, bI as IndexerDeploymentEnv, bg as IndexerDeposit, bx as IndexerDepositDailySnapshot, bz as IndexerDepositFilter, bw as IndexerDepositFundActivity, by as IndexerDepositFundActivityType, bC as IndexerDepositOrderDirection, bB as IndexerDepositOrderField, bA as IndexerDepositPagination, bj as IndexerDepositPaymentMethod, bc as IndexerDepositService, bL as IndexerFulfillmentAndPaymentResponse, bJ as IndexerFulfillmentRecord, bh as IndexerIntentFulfilled, bi as IndexerIntentFulfillmentAmounts, bl as IndexerIntentStatus, bp as IndexerManagerAggregateStats, br as IndexerManagerDailySnapshot, bq as IndexerManagerStats, bu as IndexerManualRateUpdate, bk as IndexerMethodCurrency, bv as IndexerOracleConfigUpdate, bK as IndexerPaymentVerifiedRecord, bm as IndexerRateManager, bo as IndexerRateManagerDelegation, bF as IndexerRateManagerDelegationPagination, bt as IndexerRateManagerDetail, bD as IndexerRateManagerFilter, bs as IndexerRateManagerListItem, bH as IndexerRateManagerOrderDirection, bG as IndexerRateManagerOrderField, bE as IndexerRateManagerPagination, bn as IndexerRateManagerRate, bd as IndexerRateManagerService, ag as Intent, c8 as IntentView, a8 as NearbyQuote, a9 as NearbySuggestions, Z as OfframpClient, a$ as OnchainCurrency, c9 as OnchainIntent, b2 as OrderStats, b9 as OrderbookEntry, bM as PAYMENT_PLATFORMS, aA as PayPalCredentialUploadInput, aw as PayPalSessionMaterial, c5 as PaymentMethodData, bN as PaymentPlatformType, b7 as PlatformLimit, O as PlatformQuote, b8 as PlatformRiskLevel, b1 as PreparedTransaction, a5 as QuoteFeesResponse, a4 as QuoteIntentResponse, U as QuoteRequest, a1 as QuoteResponse, a2 as QuoteResponseObject, a3 as QuoteSingleResponse, y as Range, c7 as ReferralFee, ao as RegisterPayeeDetailsRequest, ap as RegisterPayeeDetailsResponse, aX as RegisteredUploadSellerCredentialParams, H as ReleaseFundsToPayerParams, b_ as RuntimeEnv, aP as SellerAttestationOutput, aC as SellerCiphertextBundle, aH as SellerCredentialBundle, aI as SellerCredentialBundleUpload, aQ as SellerCredentialProbeResponse, aK as SellerCredentialStatus, aJ as SellerCredentialStatusValue, aB as SellerCredentialUploadInputByPlatform, aO as SellerPaymentTypedDataValue, aG as SellerProbeInput, aD as SellerSignedCiphertextBundle, aM as SellerTypedDataField, aN as SellerTypedDataSpec, aF as SellerVerifyInput, aE as SellerVerifyIntentDetails, aL as SellerVerifyProxyBody, cl as SendBatchFn, ck as SendTransactionFn, q as SignalIntentMethodParams, z as SignalIntentParams, p as SignalIntentReferralFee, b4 as TakerTier, b6 as TakerTierLevel, b5 as TakerTierStats, u as TimeoutConfig, a7 as TokenResponse, aY as UploadSellerCredentialOptions, aW as UploadSellerCredentialParams, ax as VenmoCredentialUploadInput, aq as VenmoSessionMaterial, a_ as VerifySellerPaymentParams, az as WiseCredentialUploadInput, at as WiseProfileInfo, av as WiseProfileNotFound, au as WiseProfileSelectionRequired, as as WiseSessionMaterial, W as WithdrawDepositParams, ca as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, s as Zkp2pClientOptions, cf as classifyDelegationState, be as compareEventCursorIdsByRecency, bP as currencyInfo, bb as defaultIndexerEndpoint, c1 as enrichPvDepositView, c2 as enrichPvIntentView, bf as fetchIndexerFulfillmentAndPayment, bW as getContracts, bS as getCurrencyCodeFromHash, bR as getCurrencyInfoFromCountryCode, bQ as getCurrencyInfoFromHash, ce as getDelegationRoute, bZ as getGatingServiceAddress, bY as getPaymentMethodsCatalog, bX as getRateManagerContracts, bT as isSupportedCurrencyHash, cb as isZeroRateManagerId, bU as mapConversionRatesToOnchainMinRate, cc as normalizeRateManagerId, cd as normalizeRegistry, b$ as parseDepositView, c0 as parseIntentView } from './vaultUtils-CyPf4QGT.mjs';
|
|
3
3
|
import { Address, Hex, WalletClient, Hash } from 'viem';
|
|
4
4
|
import { Abi } from 'abitype';
|
|
5
5
|
import '@zkp2p/indexer-schema';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, S as SellerCredentialUploadInput, a as SellerPlatform, b as SellerCredentialAttestationRuntime, A as AttestationServiceSellerCredentialUploadResponse, Q as QuotesBestByPlatformRequest, B as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, c as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, d as PostDepositDetailsResponse, G as GetPayeeDetailsRequest, e as GetPayeeDetailsResponse, f as GetOwnerDepositsRequest, g as GetOwnerDepositsResponse, h as GetTakerTierRequest, i as GetTakerTierResponse, j as GetDepositBundleParams, k as ApiAdapterOptions, l as GetDepositBundleResponse, m as GetOrderbookParams, n as GetOrderbookResponse, C as CurrencyType, o as PaymentMethodCatalog, T as TxOverrides } from './vaultUtils-
|
|
2
|
-
export { v as ActionCallback, aa as ApiDeposit, ah as ApiIntentStatus,
|
|
1
|
+
import { R as ReferrerFeeConfig, D as DepositWithRelations, I as IntentEntity, S as SellerCredentialUploadInput, a as SellerPlatform, b as SellerCredentialAttestationRuntime, A as AttestationServiceSellerCredentialUploadResponse, Q as QuotesBestByPlatformRequest, B as BestByPlatformResponse, V as ValidatePayeeDetailsRequest, c as ValidatePayeeDetailsResponse, P as PostDepositDetailsRequest, d as PostDepositDetailsResponse, G as GetPayeeDetailsRequest, e as GetPayeeDetailsResponse, f as GetOwnerDepositsRequest, g as GetOwnerDepositsResponse, h as GetTakerTierRequest, i as GetTakerTierResponse, j as GetDepositBundleParams, k as ApiAdapterOptions, l as GetDepositBundleResponse, m as GetOrderbookParams, n as GetOrderbookResponse, C as CurrencyType, o as PaymentMethodCatalog, T as TxOverrides } from './vaultUtils-CyPf4QGT.js';
|
|
2
|
+
export { v as ActionCallback, aa as ApiDeposit, ah as ApiIntentStatus, aS as AttestationServiceSellerCredentialProbeResponse, aR as AttestationServiceSellerVerifyResponse, t as AuthorizationTokenProvider, cj as BatchResult, K as BestByPlatformResponseObject, r as CancelIntentMethodParams, J as CancelIntentParams, ay as CashAppCredentialUploadInput, ar as CashAppSessionMaterial, x as CreateDepositConversionRate, w as CreateDepositParams, aU as CuratorSellerCredentialStatusResponse, aT as CuratorSellerCredentialUploadResponse, aV as CuratorSellerVerifyResponse, bO as Currency, bV as CurrencyData, ci as DelegationDepositTarget, cg as DelegationRoute, ch as DelegationState, c4 as Deposit, c6 as DepositCurrency, b3 as DepositIntentStatistics, ad as DepositStatus, ab as DepositVerifier, ac as DepositVerifierCurrency, b0 as DepositVerifierData, c3 as DepositView, a6 as FiatResponse, F as FulfillIntentMethodParams, E as FulfillIntentParams, L as GetBestByPlatformResponse, M as GetBestByPlatformResponseObject, ae as GetDepositByIdRequest, af as GetDepositByIdResponse, am as GetIntentByHashRequest, an as GetIntentByHashResponse, ak as GetIntentsByDepositRequest, al as GetIntentsByDepositResponse, X as GetNearbyQuote, Y as GetNearbySuggestions, ai as GetOwnerIntentsRequest, aj as GetOwnerIntentsResponse, N as GetPlatformQuote, _ as GetQuoteResponse, $ as GetQuoteResponseObject, a0 as GetQuoteSingleResponse, aZ as GetSellerCredentialStatusParams, ba as IndexerClient, bI as IndexerDeploymentEnv, bg as IndexerDeposit, bx as IndexerDepositDailySnapshot, bz as IndexerDepositFilter, bw as IndexerDepositFundActivity, by as IndexerDepositFundActivityType, bC as IndexerDepositOrderDirection, bB as IndexerDepositOrderField, bA as IndexerDepositPagination, bj as IndexerDepositPaymentMethod, bc as IndexerDepositService, bL as IndexerFulfillmentAndPaymentResponse, bJ as IndexerFulfillmentRecord, bh as IndexerIntentFulfilled, bi as IndexerIntentFulfillmentAmounts, bl as IndexerIntentStatus, bp as IndexerManagerAggregateStats, br as IndexerManagerDailySnapshot, bq as IndexerManagerStats, bu as IndexerManualRateUpdate, bk as IndexerMethodCurrency, bv as IndexerOracleConfigUpdate, bK as IndexerPaymentVerifiedRecord, bm as IndexerRateManager, bo as IndexerRateManagerDelegation, bF as IndexerRateManagerDelegationPagination, bt as IndexerRateManagerDetail, bD as IndexerRateManagerFilter, bs as IndexerRateManagerListItem, bH as IndexerRateManagerOrderDirection, bG as IndexerRateManagerOrderField, bE as IndexerRateManagerPagination, bn as IndexerRateManagerRate, bd as IndexerRateManagerService, ag as Intent, c8 as IntentView, a8 as NearbyQuote, a9 as NearbySuggestions, Z as OfframpClient, a$ as OnchainCurrency, c9 as OnchainIntent, b2 as OrderStats, b9 as OrderbookEntry, bM as PAYMENT_PLATFORMS, aA as PayPalCredentialUploadInput, aw as PayPalSessionMaterial, c5 as PaymentMethodData, bN as PaymentPlatformType, b7 as PlatformLimit, O as PlatformQuote, b8 as PlatformRiskLevel, b1 as PreparedTransaction, a5 as QuoteFeesResponse, a4 as QuoteIntentResponse, U as QuoteRequest, a1 as QuoteResponse, a2 as QuoteResponseObject, a3 as QuoteSingleResponse, y as Range, c7 as ReferralFee, ao as RegisterPayeeDetailsRequest, ap as RegisterPayeeDetailsResponse, aX as RegisteredUploadSellerCredentialParams, H as ReleaseFundsToPayerParams, b_ as RuntimeEnv, aP as SellerAttestationOutput, aC as SellerCiphertextBundle, aH as SellerCredentialBundle, aI as SellerCredentialBundleUpload, aQ as SellerCredentialProbeResponse, aK as SellerCredentialStatus, aJ as SellerCredentialStatusValue, aB as SellerCredentialUploadInputByPlatform, aO as SellerPaymentTypedDataValue, aG as SellerProbeInput, aD as SellerSignedCiphertextBundle, aM as SellerTypedDataField, aN as SellerTypedDataSpec, aF as SellerVerifyInput, aE as SellerVerifyIntentDetails, aL as SellerVerifyProxyBody, cl as SendBatchFn, ck as SendTransactionFn, q as SignalIntentMethodParams, z as SignalIntentParams, p as SignalIntentReferralFee, b4 as TakerTier, b6 as TakerTierLevel, b5 as TakerTierStats, u as TimeoutConfig, a7 as TokenResponse, aY as UploadSellerCredentialOptions, aW as UploadSellerCredentialParams, ax as VenmoCredentialUploadInput, aq as VenmoSessionMaterial, a_ as VerifySellerPaymentParams, az as WiseCredentialUploadInput, at as WiseProfileInfo, av as WiseProfileNotFound, au as WiseProfileSelectionRequired, as as WiseSessionMaterial, W as WithdrawDepositParams, ca as ZERO_RATE_MANAGER_ID, Z as Zkp2pClient, s as Zkp2pClientOptions, cf as classifyDelegationState, be as compareEventCursorIdsByRecency, bP as currencyInfo, bb as defaultIndexerEndpoint, c1 as enrichPvDepositView, c2 as enrichPvIntentView, bf as fetchIndexerFulfillmentAndPayment, bW as getContracts, bS as getCurrencyCodeFromHash, bR as getCurrencyInfoFromCountryCode, bQ as getCurrencyInfoFromHash, ce as getDelegationRoute, bZ as getGatingServiceAddress, bY as getPaymentMethodsCatalog, bX as getRateManagerContracts, bT as isSupportedCurrencyHash, cb as isZeroRateManagerId, bU as mapConversionRatesToOnchainMinRate, cc as normalizeRateManagerId, cd as normalizeRegistry, b$ as parseDepositView, c0 as parseIntentView } from './vaultUtils-CyPf4QGT.js';
|
|
3
3
|
import { Address, Hex, WalletClient, Hash } from 'viem';
|
|
4
4
|
import { Abi } from 'abitype';
|
|
5
5
|
import '@zkp2p/indexer-schema';
|
package/dist/index.mjs
CHANGED
|
@@ -326,15 +326,19 @@ var ContractRouter = class {
|
|
|
326
326
|
// src/errors/utils.ts
|
|
327
327
|
function parseAPIError(response, responseText) {
|
|
328
328
|
let message = `Request failed: ${response.statusText}`;
|
|
329
|
+
let parsedBody;
|
|
329
330
|
try {
|
|
330
|
-
|
|
331
|
-
if (
|
|
332
|
-
|
|
331
|
+
parsedBody = responseText ? JSON.parse(responseText) : void 0;
|
|
332
|
+
if (parsedBody && typeof parsedBody === "object") {
|
|
333
|
+
const body = parsedBody;
|
|
334
|
+
if (body.error || body.message) {
|
|
335
|
+
message = body.error || body.message;
|
|
336
|
+
}
|
|
333
337
|
}
|
|
334
338
|
} catch {
|
|
335
339
|
if (responseText && responseText.length < 200) message = responseText;
|
|
336
340
|
}
|
|
337
|
-
return new APIError(message, response.status, { url: response.url });
|
|
341
|
+
return new APIError(message, response.status, { url: response.url, responseBody: parsedBody });
|
|
338
342
|
}
|
|
339
343
|
async function withRetry(fn, maxRetries = 3, delayMs = 1e3, timeoutMs) {
|
|
340
344
|
let lastErr;
|
|
@@ -409,6 +413,47 @@ async function apiSignIntentV3(request, opts) {
|
|
|
409
413
|
function headers() {
|
|
410
414
|
return { "Content-Type": "application/json" };
|
|
411
415
|
}
|
|
416
|
+
function isPayeeBoundSellerCredentialUploadInput(payload) {
|
|
417
|
+
return typeof payload.payeeId === "string";
|
|
418
|
+
}
|
|
419
|
+
function isWiseCredentialUploadInput(payload) {
|
|
420
|
+
return typeof payload.sessionMaterial?.apiToken === "string";
|
|
421
|
+
}
|
|
422
|
+
async function createEncryptedSellerCredentialUploadForPlatform({
|
|
423
|
+
attestationServiceUrl,
|
|
424
|
+
attestationRuntime,
|
|
425
|
+
payload,
|
|
426
|
+
platform,
|
|
427
|
+
timeoutMs
|
|
428
|
+
}) {
|
|
429
|
+
if (platform === "wise") {
|
|
430
|
+
if (!isWiseCredentialUploadInput(payload)) {
|
|
431
|
+
throw new Error("apiToken is required for wise seller credential uploads");
|
|
432
|
+
}
|
|
433
|
+
return createEncryptedSellerCredentialUpload({
|
|
434
|
+
attestationServiceUrl,
|
|
435
|
+
platform: "wise",
|
|
436
|
+
sessionMaterial: payload.sessionMaterial,
|
|
437
|
+
...typeof timeoutMs === "number" ? { timeoutMs } : {},
|
|
438
|
+
...attestationRuntime?.fetch ? { fetch: attestationRuntime.fetch } : {},
|
|
439
|
+
...attestationRuntime?.subtle ? { subtle: attestationRuntime.subtle } : {},
|
|
440
|
+
...attestationRuntime?.getRandomValues ? { getRandomValues: attestationRuntime.getRandomValues } : {}
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
if (!isPayeeBoundSellerCredentialUploadInput(payload)) {
|
|
444
|
+
throw new Error(`payeeId is required for ${platform} seller credential uploads`);
|
|
445
|
+
}
|
|
446
|
+
return createEncryptedSellerCredentialUpload({
|
|
447
|
+
attestationServiceUrl,
|
|
448
|
+
platform,
|
|
449
|
+
payeeId: payload.payeeId,
|
|
450
|
+
sessionMaterial: payload.sessionMaterial,
|
|
451
|
+
...typeof timeoutMs === "number" ? { timeoutMs } : {},
|
|
452
|
+
...attestationRuntime?.fetch ? { fetch: attestationRuntime.fetch } : {},
|
|
453
|
+
...attestationRuntime?.subtle ? { subtle: attestationRuntime.subtle } : {},
|
|
454
|
+
...attestationRuntime?.getRandomValues ? { getRandomValues: attestationRuntime.getRandomValues } : {}
|
|
455
|
+
});
|
|
456
|
+
}
|
|
412
457
|
async function apiCreatePaymentAttestation(payload, attestationServiceUrl, platform, actionType) {
|
|
413
458
|
return withRetry(async () => {
|
|
414
459
|
let res;
|
|
@@ -436,14 +481,12 @@ async function apiCreateSellerCredentialBundle(payload, attestationServiceUrl, p
|
|
|
436
481
|
return withRetry(
|
|
437
482
|
async () => {
|
|
438
483
|
const requestFetch = attestationRuntime?.fetch ?? fetch;
|
|
439
|
-
const encryptedUpload = await
|
|
484
|
+
const encryptedUpload = await createEncryptedSellerCredentialUploadForPlatform({
|
|
440
485
|
attestationServiceUrl,
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
...attestationRuntime?.subtle ? { subtle: attestationRuntime.subtle } : {},
|
|
446
|
-
...attestationRuntime?.getRandomValues ? { getRandomValues: attestationRuntime.getRandomValues } : {}
|
|
486
|
+
attestationRuntime,
|
|
487
|
+
payload,
|
|
488
|
+
platform,
|
|
489
|
+
timeoutMs
|
|
447
490
|
});
|
|
448
491
|
let res;
|
|
449
492
|
try {
|
|
@@ -5125,10 +5168,16 @@ async function apiGetSellerCredentialStatus(processorName, payeeDetails, baseApi
|
|
|
5125
5168
|
});
|
|
5126
5169
|
}
|
|
5127
5170
|
async function apiVerifySellerPayment(platform, req, baseApiUrl, timeoutMs, apiKey, authToken) {
|
|
5171
|
+
const body = {
|
|
5172
|
+
txId: req.txId,
|
|
5173
|
+
chainId: req.chainId,
|
|
5174
|
+
intent: req.intent,
|
|
5175
|
+
...req.metadata !== void 0 ? { metadata: req.metadata } : {}
|
|
5176
|
+
};
|
|
5128
5177
|
return apiFetch({
|
|
5129
5178
|
url: `${withApiBase(baseApiUrl)}/v2/verify/seller/${encodeURIComponent(platform)}`,
|
|
5130
5179
|
method: "POST",
|
|
5131
|
-
body
|
|
5180
|
+
body,
|
|
5132
5181
|
apiKey,
|
|
5133
5182
|
authToken,
|
|
5134
5183
|
timeoutMs
|
|
@@ -7732,8 +7781,10 @@ var Zkp2pClient = class {
|
|
|
7732
7781
|
* seller-automated-release availability is governed by curator's probe/revalidation state
|
|
7733
7782
|
* rather than these timestamps.
|
|
7734
7783
|
*
|
|
7735
|
-
*
|
|
7736
|
-
*
|
|
7784
|
+
* Create a signed seller credential bundle with attestation-service and store it via
|
|
7785
|
+
* curator's platform plus hashed payee-details route. Session-cookie platforms register
|
|
7786
|
+
* or recover the payee maker row before upload; Wise derives the payee hash inside the enclave
|
|
7787
|
+
* from the submitted Personal API Token.
|
|
7737
7788
|
*/
|
|
7738
7789
|
async uploadSellerCredential(params, opts) {
|
|
7739
7790
|
const baseApiUrl = this.stripTrailingSlash(
|
|
@@ -7743,6 +7794,33 @@ var Zkp2pClient = class {
|
|
|
7743
7794
|
const attestationServiceUrl = this.stripTrailingSlash(
|
|
7744
7795
|
opts?.attestationServiceUrl ?? this.defaultAttestationServiceForBaseApiUrl(baseApiUrl)
|
|
7745
7796
|
);
|
|
7797
|
+
const createBundle = (uploadPayload2) => opts?.attestationRuntime ? apiCreateSellerCredentialBundle(
|
|
7798
|
+
uploadPayload2,
|
|
7799
|
+
attestationServiceUrl,
|
|
7800
|
+
params.platform,
|
|
7801
|
+
timeoutMs,
|
|
7802
|
+
opts.attestationRuntime
|
|
7803
|
+
) : apiCreateSellerCredentialBundle(
|
|
7804
|
+
uploadPayload2,
|
|
7805
|
+
attestationServiceUrl,
|
|
7806
|
+
params.platform,
|
|
7807
|
+
timeoutMs
|
|
7808
|
+
);
|
|
7809
|
+
if (params.platform === "wise") {
|
|
7810
|
+
const bundleResponse2 = await createBundle({
|
|
7811
|
+
sessionMaterial: params.sessionMaterial
|
|
7812
|
+
});
|
|
7813
|
+
if (!bundleResponse2.success || !bundleResponse2.responseObject) {
|
|
7814
|
+
throw new Error(bundleResponse2.message || "Failed to create seller credential bundle");
|
|
7815
|
+
}
|
|
7816
|
+
return apiUploadSellerCredential(
|
|
7817
|
+
params.platform,
|
|
7818
|
+
bundleResponse2.responseObject.payeeIdHash,
|
|
7819
|
+
bundleResponse2.responseObject,
|
|
7820
|
+
baseApiUrl,
|
|
7821
|
+
timeoutMs
|
|
7822
|
+
);
|
|
7823
|
+
}
|
|
7746
7824
|
const registeredPayeePayload = {
|
|
7747
7825
|
offchainId: params.offchainId,
|
|
7748
7826
|
processorName: params.platform
|
|
@@ -7765,18 +7843,7 @@ var Zkp2pClient = class {
|
|
|
7765
7843
|
payeeId: params.payeeId,
|
|
7766
7844
|
sessionMaterial: params.sessionMaterial
|
|
7767
7845
|
};
|
|
7768
|
-
const bundleResponse =
|
|
7769
|
-
uploadPayload,
|
|
7770
|
-
attestationServiceUrl,
|
|
7771
|
-
params.platform,
|
|
7772
|
-
timeoutMs,
|
|
7773
|
-
opts.attestationRuntime
|
|
7774
|
-
) : await apiCreateSellerCredentialBundle(
|
|
7775
|
-
uploadPayload,
|
|
7776
|
-
attestationServiceUrl,
|
|
7777
|
-
params.platform,
|
|
7778
|
-
timeoutMs
|
|
7779
|
-
);
|
|
7846
|
+
const bundleResponse = await createBundle(uploadPayload);
|
|
7780
7847
|
if (!bundleResponse.success || !bundleResponse.responseObject) {
|
|
7781
7848
|
throw new Error(bundleResponse.message || "Failed to create seller credential bundle");
|
|
7782
7849
|
}
|
|
@@ -7830,7 +7897,8 @@ var Zkp2pClient = class {
|
|
|
7830
7897
|
{
|
|
7831
7898
|
txId: params.txId,
|
|
7832
7899
|
chainId: params.chainId,
|
|
7833
|
-
intent: params.intent
|
|
7900
|
+
intent: params.intent,
|
|
7901
|
+
...params.metadata !== void 0 ? { metadata: params.metadata } : {}
|
|
7834
7902
|
},
|
|
7835
7903
|
baseApiUrl,
|
|
7836
7904
|
timeoutMs,
|