@zkp2p/sdk 0.5.0 → 0.5.2
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/README.md +7 -3
- package/dist/index.cjs +63 -126
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +5 -13
- package/dist/index.d.ts +5 -13
- package/dist/index.mjs +59 -124
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/{vaultUtils-BL8tzsmH.d.mts → vaultUtils-CtNcKlpg.d.mts} +21 -51
- package/dist/{vaultUtils-BL8tzsmH.d.ts → vaultUtils-CtNcKlpg.d.ts} +21 -51
- package/package.json +2 -2
package/dist/react.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Z as Zkp2pClient, P as PostDepositDetailsRequest,
|
|
2
|
-
export {
|
|
1
|
+
import { Z as Zkp2pClient, P as PostDepositDetailsRequest, x as SignalIntentMethodParams, bm as PreparedTransaction, bp as TakerTier, n as GetTakerTierRequest, o as GetTakerTierResponse, F as FulfillIntentMethodParams, cF as SendTransactionFn, cG as SendBatchFn, cD as DelegationDepositTarget, cE as BatchResult } from './vaultUtils-CtNcKlpg.mjs';
|
|
2
|
+
export { cB as DelegationRoute, cC as DelegationState, cH as VAULT_ZERO_ADDRESS, cv as ZERO_RATE_MANAGER_ID, cI as asErrorMessage, cJ as assertDelegationMethodSupport, cA as classifyDelegationState, cz as getDelegationRoute, cw as isZeroRateManagerId, cx as normalizeRateManagerId, cy as normalizeRegistry } from './vaultUtils-CtNcKlpg.mjs';
|
|
3
3
|
import { Hash, Address, Hex } from 'viem';
|
|
4
4
|
import '@zkp2p/indexer-schema';
|
|
5
5
|
import 'abitype';
|
package/dist/react.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Z as Zkp2pClient, P as PostDepositDetailsRequest,
|
|
2
|
-
export {
|
|
1
|
+
import { Z as Zkp2pClient, P as PostDepositDetailsRequest, x as SignalIntentMethodParams, bm as PreparedTransaction, bp as TakerTier, n as GetTakerTierRequest, o as GetTakerTierResponse, F as FulfillIntentMethodParams, cF as SendTransactionFn, cG as SendBatchFn, cD as DelegationDepositTarget, cE as BatchResult } from './vaultUtils-CtNcKlpg.js';
|
|
2
|
+
export { cB as DelegationRoute, cC as DelegationState, cH as VAULT_ZERO_ADDRESS, cv as ZERO_RATE_MANAGER_ID, cI as asErrorMessage, cJ as assertDelegationMethodSupport, cA as classifyDelegationState, cz as getDelegationRoute, cw as isZeroRateManagerId, cx as normalizeRateManagerId, cy as normalizeRegistry } from './vaultUtils-CtNcKlpg.js';
|
|
3
3
|
import { Hash, Address, Hex } from 'viem';
|
|
4
4
|
import '@zkp2p/indexer-schema';
|
|
5
5
|
import 'abitype';
|
|
@@ -2,7 +2,7 @@ import * as _zkp2p_indexer_schema from '@zkp2p/indexer-schema';
|
|
|
2
2
|
import { Deposit, DepositStatus as DepositStatus$2, IntentStatus as IntentStatus$1, DepositPaymentMethod, MethodCurrency, Intent as Intent$1, MakerProfitSnapshot, RateManager, ManagerAggregateStats, RateManagerRate, ManagerStats, DepositFundActivity, DepositDailySnapshot, ManagerDailySnapshot } from '@zkp2p/indexer-schema';
|
|
3
3
|
import { Address, Hex, AccessList, AuthorizationList, Hash, WalletClient, PublicClient } from 'viem';
|
|
4
4
|
import { Abi } from 'abitype';
|
|
5
|
-
import { IdentityPlatform, IdentityActionTypeByPlatform,
|
|
5
|
+
import { IdentityPlatform, IdentityActionTypeByPlatform, IdentityAttestationOutputFor as IdentityAttestationOutputFor$1, IdentityParamsByPlatform } from '@zkp2p/zkp2p-attestation';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Supported fiat currency codes.
|
|
@@ -938,6 +938,15 @@ type PrepareableMethod<TParams, TResult> = {
|
|
|
938
938
|
prepare(params: TParams): Promise<PreparedTransaction>;
|
|
939
939
|
};
|
|
940
940
|
|
|
941
|
+
type IdentityTypedDataValueFor<P extends IdentityPlatform> = IdentityAttestationOutputFor$1<P>['typedDataValue'] & {
|
|
942
|
+
callerAddress: string;
|
|
943
|
+
};
|
|
944
|
+
type IdentityAttestationOutputFor<P extends IdentityPlatform> = Omit<IdentityAttestationOutputFor$1<P>, 'typedDataValue'> & {
|
|
945
|
+
typedDataValue: IdentityTypedDataValueFor<P>;
|
|
946
|
+
};
|
|
947
|
+
type IdentityAttestationOutput = {
|
|
948
|
+
[P in IdentityPlatform]: IdentityAttestationOutputFor<P>;
|
|
949
|
+
}[IdentityPlatform];
|
|
941
950
|
/**
|
|
942
951
|
* Timeout configuration for different operation types
|
|
943
952
|
*/
|
|
@@ -1004,8 +1013,8 @@ type CuratorPayeeDataInput = {
|
|
|
1004
1013
|
type FulfillIntentParams = {
|
|
1005
1014
|
/** Hash of the intent to fulfill */
|
|
1006
1015
|
intentHash: Hash;
|
|
1007
|
-
/**
|
|
1008
|
-
proof:
|
|
1016
|
+
/** Buyer TEE payment proof input */
|
|
1017
|
+
proof: BuyerTeePaymentProofInput;
|
|
1009
1018
|
/** Optional attestation timestamp buffer override in milliseconds */
|
|
1010
1019
|
timestampBufferMs?: number | string;
|
|
1011
1020
|
/** Override the attestation service base URL */
|
|
@@ -1086,10 +1095,6 @@ type PostDepositDetailsResponse = {
|
|
|
1086
1095
|
metadata: CuratorMetadata | null;
|
|
1087
1096
|
hashedOnchainId: string;
|
|
1088
1097
|
createdAt: string;
|
|
1089
|
-
/** Per-merchant forwarding alias (PayPal multi-merchant flow) */
|
|
1090
|
-
forwardingMailboxAlias?: string | null;
|
|
1091
|
-
/** Alias surfaced by curator maker lookup (alternative field name from GET /v1/makers/paypal/<hash>) */
|
|
1092
|
-
paypalForwardingAlias?: string | null;
|
|
1093
1098
|
};
|
|
1094
1099
|
statusCode: number;
|
|
1095
1100
|
};
|
|
@@ -1131,11 +1136,6 @@ type WiseProfileNotFound = {
|
|
|
1131
1136
|
profileId: string;
|
|
1132
1137
|
profiles: WiseProfileInfo[];
|
|
1133
1138
|
};
|
|
1134
|
-
type PayPalSessionMaterial = {
|
|
1135
|
-
payeeEmail: string;
|
|
1136
|
-
forwardingBaseMailbox: string;
|
|
1137
|
-
forwardingMailboxAlias: string;
|
|
1138
|
-
};
|
|
1139
1139
|
type GoogleOAuthSellerCredentialPlatform = Extract<SellerPlatform, 'paypal' | 'venmo'>;
|
|
1140
1140
|
type PayPalGoogleOAuthSellerCredentialUploadBody = {
|
|
1141
1141
|
payeeEmail: string;
|
|
@@ -1162,17 +1162,13 @@ type CashAppCredentialUploadInput = {
|
|
|
1162
1162
|
type WiseCredentialUploadInput = {
|
|
1163
1163
|
sessionMaterial: WiseSessionMaterial;
|
|
1164
1164
|
};
|
|
1165
|
-
type PayPalCredentialUploadInput = {
|
|
1166
|
-
payeeId: string;
|
|
1167
|
-
sessionMaterial: PayPalSessionMaterial;
|
|
1168
|
-
};
|
|
1169
1165
|
type SellerCredentialUploadInputByPlatform = {
|
|
1170
1166
|
venmo: VenmoCredentialUploadInput;
|
|
1171
1167
|
cashapp: CashAppCredentialUploadInput;
|
|
1172
1168
|
wise: WiseCredentialUploadInput;
|
|
1173
|
-
paypal: PayPalCredentialUploadInput;
|
|
1174
1169
|
};
|
|
1175
|
-
type
|
|
1170
|
+
type SellerCredentialUploadPlatform = keyof SellerCredentialUploadInputByPlatform;
|
|
1171
|
+
type SellerCredentialUploadInput = SellerCredentialUploadInputByPlatform[keyof SellerCredentialUploadInputByPlatform];
|
|
1176
1172
|
type SellerCiphertextBundle = {
|
|
1177
1173
|
encryptedBlob: string;
|
|
1178
1174
|
encryptedDataKey: string;
|
|
@@ -1243,10 +1239,12 @@ type BuyerTeeSessionMaterialEncryptionInput = {
|
|
|
1243
1239
|
type MakerIdentityPlatform = Extract<IdentityPlatform, 'paypal' | 'wise'>;
|
|
1244
1240
|
type IdentityAttestationParams = IdentityParamsByPlatform[IdentityPlatform] | Record<string, string | number | boolean>;
|
|
1245
1241
|
type IdentityAttestationRequestBody = {
|
|
1242
|
+
callerAddress: string;
|
|
1246
1243
|
encryptedSessionMaterial: string;
|
|
1247
1244
|
params: IdentityAttestationParams;
|
|
1248
1245
|
};
|
|
1249
1246
|
type MakerIdentityAttestationRequestBody<P extends MakerIdentityPlatform> = {
|
|
1247
|
+
callerAddress: string;
|
|
1250
1248
|
encryptedSessionMaterial: string;
|
|
1251
1249
|
params: IdentityParamsByPlatform[P];
|
|
1252
1250
|
};
|
|
@@ -1324,7 +1322,7 @@ type CuratorSellerVerifyResponse = {
|
|
|
1324
1322
|
responseObject: SellerAttestationOutput;
|
|
1325
1323
|
statusCode: number;
|
|
1326
1324
|
};
|
|
1327
|
-
type RegisteredSellerCredentialPlatform = Exclude<
|
|
1325
|
+
type RegisteredSellerCredentialPlatform = Exclude<SellerCredentialUploadPlatform, 'wise'>;
|
|
1328
1326
|
type UploadSellerCredentialParams = ({
|
|
1329
1327
|
platform: 'wise';
|
|
1330
1328
|
} & WiseCredentialUploadInput) | {
|
|
@@ -1365,21 +1363,6 @@ type GetSellerCredentialStatusParams = {
|
|
|
1365
1363
|
processorName: SellerPlatform;
|
|
1366
1364
|
payeeDetails: Hash;
|
|
1367
1365
|
};
|
|
1368
|
-
type PayPalForwardingConfirmationErrorCode = 'paypal_forwarding_confirmation_not_found' | 'paypal_forwarding_initiator_email_mismatch' | 'paypal_forwarding_confirmation_expired' | 'paypal_forwarding_confirmation_rejected';
|
|
1369
|
-
type ConfirmPayPalForwardingRequest = {
|
|
1370
|
-
payeeDetails: Hash;
|
|
1371
|
-
payeeEmail: string;
|
|
1372
|
-
forwardingInitiatorEmail: string;
|
|
1373
|
-
};
|
|
1374
|
-
type ConfirmPayPalForwardingStatus = Omit<SellerCredentialStatus, 'payeeIdHash'> & {
|
|
1375
|
-
payeeIdHash?: Hash;
|
|
1376
|
-
};
|
|
1377
|
-
type ConfirmPayPalForwardingResponse = {
|
|
1378
|
-
success: boolean;
|
|
1379
|
-
message: string;
|
|
1380
|
-
responseObject: ConfirmPayPalForwardingStatus;
|
|
1381
|
-
statusCode: number;
|
|
1382
|
-
};
|
|
1383
1366
|
type GoogleOAuthSellerCredentialBaseParams = {
|
|
1384
1367
|
authorizationCode: string;
|
|
1385
1368
|
payeeDetails: Hash;
|
|
@@ -1616,8 +1599,6 @@ type GetPayeeDetailsResponse = {
|
|
|
1616
1599
|
metadata: CuratorMetadata | null;
|
|
1617
1600
|
hashedOnchainId: string;
|
|
1618
1601
|
createdAt: string;
|
|
1619
|
-
/** Per-merchant forwarding alias surfaced on maker lookup (PayPal multi-merchant flow) */
|
|
1620
|
-
paypalForwardingAlias?: string | null;
|
|
1621
1602
|
};
|
|
1622
1603
|
statusCode: number;
|
|
1623
1604
|
};
|
|
@@ -2046,8 +2027,8 @@ type CancelIntentMethodParams = {
|
|
|
2046
2027
|
type FulfillIntentMethodParams = {
|
|
2047
2028
|
/** The intent hash to fulfill (0x-prefixed, 32 bytes) */
|
|
2048
2029
|
intentHash: `0x${string}`;
|
|
2049
|
-
/**
|
|
2050
|
-
proof:
|
|
2030
|
+
/** Buyer TEE payment proof input */
|
|
2031
|
+
proof: BuyerTeePaymentProofInput;
|
|
2051
2032
|
/** Allowed timestamp variance in ms (default: 300000ms) */
|
|
2052
2033
|
timestampBufferMs?: string;
|
|
2053
2034
|
/** Override attestation service URL */
|
|
@@ -3352,7 +3333,7 @@ declare class Zkp2pClient {
|
|
|
3352
3333
|
* ```
|
|
3353
3334
|
*
|
|
3354
3335
|
* @param params.intentHash - The intent hash to fulfill (0x-prefixed, 32 bytes)
|
|
3355
|
-
* @param params.proof -
|
|
3336
|
+
* @param params.proof - Buyer TEE payment proof input
|
|
3356
3337
|
* @param params.timestampBufferMs - Allowed timestamp variance (default: 300000ms)
|
|
3357
3338
|
* @param params.attestationServiceUrl - Override attestation service URL
|
|
3358
3339
|
* @param params.postIntentHookData - Data to pass to post-intent hook
|
|
@@ -3475,17 +3456,6 @@ declare class Zkp2pClient {
|
|
|
3475
3456
|
baseApiUrl?: string;
|
|
3476
3457
|
timeoutMs?: number;
|
|
3477
3458
|
}): Promise<CuratorSellerCredentialUploadResponse>;
|
|
3478
|
-
/**
|
|
3479
|
-
* Confirms the PayPal Gmail-forwarding setup for an existing maker payee hash.
|
|
3480
|
-
*
|
|
3481
|
-
* Uses curator's `/forwarding-confirmation` route and forwards both API key and
|
|
3482
|
-
* bearer token so either auth strategy can satisfy the hybrid gate. The endpoint
|
|
3483
|
-
* is rate-limited server-side; callers should surface retry guidance from APIError.
|
|
3484
|
-
*/
|
|
3485
|
-
confirmPayPalForwarding(params: ConfirmPayPalForwardingRequest, opts?: {
|
|
3486
|
-
baseApiUrl?: string;
|
|
3487
|
-
timeoutMs?: number;
|
|
3488
|
-
}): Promise<ConfirmPayPalForwardingResponse>;
|
|
3489
3459
|
/**
|
|
3490
3460
|
* Upload a seller Gmail OAuth authorization code through curator.
|
|
3491
3461
|
*
|
|
@@ -3682,4 +3652,4 @@ type SendBatchFn = (txs: Array<{
|
|
|
3682
3652
|
value?: bigint;
|
|
3683
3653
|
}>) => Promise<string>;
|
|
3684
3654
|
|
|
3685
|
-
export { type
|
|
3655
|
+
export { type GetBestByPlatformResponse as $, type AttestationServiceIdentityResponse as A, type BuyerTeeSessionMaterialEncryptionInput as B, type CuratorSellerCredentialUploadResponse as C, type DepositWithRelations as D, type AuthorizationTokenProvider as E, type FulfillIntentMethodParams as F, type GoogleOAuthSellerCredentialPlatform as G, type TimeoutConfig as H, type IntentEntity$1 as I, type ActionCallback as J, type CreateDepositParams as K, type CreateDepositConversionRate as L, type Range as M, type SignalIntentParams as N, type FulfillIntentParams as O, type PostDepositDetailsRequest as P, type QuotesBestByPlatformRequest as Q, type ReferrerFeeConfig as R, type SellerCredentialBundle as S, type TxOverrides as T, type UploadSellerCredentialBundleParams as U, type ValidatePayeeDetailsRequest as V, type WithdrawDepositParams as W, type ReleaseFundsToPayerParams as X, type CancelIntentParams as Y, Zkp2pClient as Z, type BestByPlatformResponseObject as _, type IdentityAttestationRequestBody as a, type AttestationServiceSellerCredentialProbeResponse as a$, type GetBestByPlatformResponseObject as a0, type GetPlatformQuote as a1, type PlatformQuote as a2, type QuoteRequest as a3, type GetNearbyQuote as a4, type GetNearbySuggestions as a5, type GetQuoteResponse as a6, type GetQuoteResponseObject as a7, type GetQuoteSingleResponse as a8, type QuoteResponse as a9, type CashAppSessionMaterial as aA, type WiseSessionMaterial as aB, type WiseProfileInfo as aC, type WiseProfileSelectionRequired as aD, type WiseProfileNotFound as aE, type PayPalGoogleOAuthSellerCredentialUploadBody as aF, type VenmoGoogleOAuthSellerCredentialUploadBody as aG, type VenmoCredentialUploadInput as aH, type CashAppCredentialUploadInput as aI, type WiseCredentialUploadInput as aJ, type SellerCredentialUploadInputByPlatform as aK, type SellerCiphertextBundle as aL, type SellerSignedCiphertextBundle as aM, type SellerVerifyIntentDetails as aN, type SellerVerifyInput as aO, type SellerProbeInput as aP, type SellerCredentialBundleUpload as aQ, type SellerCredentialStatusValue as aR, type SellerCredentialStatus as aS, type SellerVerifyProxyBody as aT, type SellerTypedDataField as aU, type SellerTypedDataSpec as aV, type SellerPaymentTypedDataValue as aW, type SellerAttestationOutput as aX, type SellerCredentialProbeResponse as aY, type AttestationServiceSellerVerifyResponse as aZ, type FulfillIntentAttestationResponse as a_, type QuoteResponseObject as aa, type QuoteSingleResponse as ab, type QuoteIntentResponse as ac, type QuoteFeesResponse as ad, type FiatResponse as ae, type TokenResponse as af, type NearbyQuote as ag, type NearbySuggestions as ah, type ApiDeposit as ai, type DepositVerifier as aj, type DepositVerifierCurrency as ak, type DepositStatus as al, type GetDepositByIdRequest as am, type GetDepositByIdResponse as an, type Intent as ao, type ApiIntentStatus as ap, type GetOwnerIntentsRequest as aq, type GetOwnerIntentsResponse as ar, type GetIntentsByDepositRequest as as, type GetIntentsByDepositResponse as at, type GetIntentByHashRequest as au, type GetIntentByHashResponse as av, type RegisterPayeeDetailsRequest as aw, type RegisterPayeeDetailsResponse as ax, type SellerPlatform as ay, type VenmoSessionMaterial as az, type SellerCredentialUploadInput as b, type RateManagerOrderField as b$, type BuyerTeePaymentParams as b0, type BuyerTeePaymentProofInput as b1, type BuyerTeeSessionMaterial as b2, type CuratorSellerCredentialStatusResponse as b3, type CuratorSellerVerifyResponse as b4, type RegisteredSellerCredentialPlatform as b5, type UploadSellerCredentialParams as b6, type RegisteredUploadSellerCredentialParams as b7, type UploadSellerCredentialOptions as b8, type GetSellerCredentialStatusParams as b9, fetchFulfillmentAndPayment as bA, type DepositEntity$1 as bB, type IntentFulfilledEntity as bC, type IntentFulfillmentAmountsEntity as bD, type DepositPaymentMethodEntity$1 as bE, type MethodCurrencyEntity$1 as bF, type IntentStatus as bG, type RateManagerEntity as bH, type RateManagerRateEntity as bI, type RateManagerDelegationEntity as bJ, type ManagerAggregateStatsEntity as bK, type ManagerStatsEntity as bL, type ManagerDailySnapshotEntity as bM, type RateManagerListItem as bN, type RateManagerDetail as bO, type ManualRateUpdateEntity as bP, type OracleConfigUpdateEntity as bQ, type DepositFundActivityEntity$1 as bR, type DepositDailySnapshotEntity$1 as bS, type DepositFundActivityType$1 as bT, type DepositFilter as bU, type PaginationOptions as bV, type DepositOrderField as bW, type OrderDirection$1 as bX, type RateManagerFilter as bY, type RateManagerPaginationOptions as bZ, type RateManagerDelegationPaginationOptions as b_, type UploadPayPalGoogleOAuthSellerCredentialParams as ba, type UploadVenmoGoogleOAuthSellerCredentialParams as bb, type UploadGoogleOAuthSellerCredentialParams as bc, type VerifySellerPaymentParams as bd, type IdentityAttestationActionType as be, type IdentityAttestationOutput as bf, type IdentityAttestationOutputFor as bg, type IdentityAttestationParams as bh, type MakerIdentityAttestationRequestBody as bi, type MakerIdentityPlatform as bj, type OnchainCurrency as bk, type DepositVerifierData as bl, type PreparedTransaction as bm, type OrderStats as bn, type DepositIntentStatistics as bo, type TakerTier as bp, type TakerTierStats as bq, type TakerTierLevel as br, type PlatformLimit as bs, type PlatformRiskLevel as bt, type OrderbookEntry as bu, IndexerClient as bv, defaultIndexerEndpoint as bw, IndexerDepositService as bx, IndexerRateManagerService as by, compareEventCursorIdsByRecency as bz, type SellerCredentialUploadPlatform as c, type OrderDirection as c0, type DeploymentEnv as c1, type FulfillmentRecord as c2, type PaymentVerifiedRecord as c3, type FulfillmentAndPaymentResponse as c4, PAYMENT_PLATFORMS as c5, type PaymentPlatformType as c6, Currency as c7, currencyInfo as c8, getCurrencyInfoFromHash as c9, classifyDelegationState as cA, type DelegationRoute as cB, type DelegationState as cC, type DelegationDepositTarget as cD, type BatchResult as cE, type SendTransactionFn as cF, type SendBatchFn as cG, ZERO_ADDRESS as cH, asErrorMessage as cI, assertDelegationMethodSupport as cJ, getCurrencyInfoFromCountryCode as ca, getCurrencyCodeFromHash as cb, isSupportedCurrencyHash as cc, mapConversionRatesToOnchainMinRate as cd, type CurrencyData as ce, getContracts as cf, getRateManagerContracts as cg, getPaymentMethodsCatalog as ch, getGatingServiceAddress as ci, type RuntimeEnv as cj, parseDepositView as ck, parseIntentView as cl, enrichPvDepositView as cm, enrichPvIntentView as cn, type PV_DepositView as co, type PV_Deposit as cp, type PV_PaymentMethodData as cq, type PV_Currency as cr, type PV_ReferralFee as cs, type PV_IntentView as ct, type PV_Intent as cu, ZERO_RATE_MANAGER_ID as cv, isZeroRateManagerId as cw, normalizeRateManagerId as cx, normalizeRegistry as cy, getDelegationRoute as cz, type SellerCredentialAttestationRuntime as d, type AttestationServiceSellerCredentialUploadResponse as e, type GoogleOAuthSellerCredentialUploadBodyByPlatform as f, type BestByPlatformResponse as g, type ValidatePayeeDetailsResponse as h, type PostDepositDetailsResponse as i, type GetPayeeDetailsRequest as j, type GetPayeeDetailsResponse as k, type GetOwnerDepositsRequest as l, type GetOwnerDepositsResponse as m, type GetTakerTierRequest as n, type GetTakerTierResponse as o, type GetDepositBundleParams as p, type ApiAdapterOptions as q, type GetDepositBundleResponse as r, type GetOrderbookParams as s, type GetOrderbookResponse as t, type CurrencyType as u, type PaymentMethodCatalog as v, type SignalIntentReferralFee as w, type SignalIntentMethodParams as x, type CancelIntentMethodParams as y, type Zkp2pNextOptions as z };
|
|
@@ -2,7 +2,7 @@ import * as _zkp2p_indexer_schema from '@zkp2p/indexer-schema';
|
|
|
2
2
|
import { Deposit, DepositStatus as DepositStatus$2, IntentStatus as IntentStatus$1, DepositPaymentMethod, MethodCurrency, Intent as Intent$1, MakerProfitSnapshot, RateManager, ManagerAggregateStats, RateManagerRate, ManagerStats, DepositFundActivity, DepositDailySnapshot, ManagerDailySnapshot } from '@zkp2p/indexer-schema';
|
|
3
3
|
import { Address, Hex, AccessList, AuthorizationList, Hash, WalletClient, PublicClient } from 'viem';
|
|
4
4
|
import { Abi } from 'abitype';
|
|
5
|
-
import { IdentityPlatform, IdentityActionTypeByPlatform,
|
|
5
|
+
import { IdentityPlatform, IdentityActionTypeByPlatform, IdentityAttestationOutputFor as IdentityAttestationOutputFor$1, IdentityParamsByPlatform } from '@zkp2p/zkp2p-attestation';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Supported fiat currency codes.
|
|
@@ -938,6 +938,15 @@ type PrepareableMethod<TParams, TResult> = {
|
|
|
938
938
|
prepare(params: TParams): Promise<PreparedTransaction>;
|
|
939
939
|
};
|
|
940
940
|
|
|
941
|
+
type IdentityTypedDataValueFor<P extends IdentityPlatform> = IdentityAttestationOutputFor$1<P>['typedDataValue'] & {
|
|
942
|
+
callerAddress: string;
|
|
943
|
+
};
|
|
944
|
+
type IdentityAttestationOutputFor<P extends IdentityPlatform> = Omit<IdentityAttestationOutputFor$1<P>, 'typedDataValue'> & {
|
|
945
|
+
typedDataValue: IdentityTypedDataValueFor<P>;
|
|
946
|
+
};
|
|
947
|
+
type IdentityAttestationOutput = {
|
|
948
|
+
[P in IdentityPlatform]: IdentityAttestationOutputFor<P>;
|
|
949
|
+
}[IdentityPlatform];
|
|
941
950
|
/**
|
|
942
951
|
* Timeout configuration for different operation types
|
|
943
952
|
*/
|
|
@@ -1004,8 +1013,8 @@ type CuratorPayeeDataInput = {
|
|
|
1004
1013
|
type FulfillIntentParams = {
|
|
1005
1014
|
/** Hash of the intent to fulfill */
|
|
1006
1015
|
intentHash: Hash;
|
|
1007
|
-
/**
|
|
1008
|
-
proof:
|
|
1016
|
+
/** Buyer TEE payment proof input */
|
|
1017
|
+
proof: BuyerTeePaymentProofInput;
|
|
1009
1018
|
/** Optional attestation timestamp buffer override in milliseconds */
|
|
1010
1019
|
timestampBufferMs?: number | string;
|
|
1011
1020
|
/** Override the attestation service base URL */
|
|
@@ -1086,10 +1095,6 @@ type PostDepositDetailsResponse = {
|
|
|
1086
1095
|
metadata: CuratorMetadata | null;
|
|
1087
1096
|
hashedOnchainId: string;
|
|
1088
1097
|
createdAt: string;
|
|
1089
|
-
/** Per-merchant forwarding alias (PayPal multi-merchant flow) */
|
|
1090
|
-
forwardingMailboxAlias?: string | null;
|
|
1091
|
-
/** Alias surfaced by curator maker lookup (alternative field name from GET /v1/makers/paypal/<hash>) */
|
|
1092
|
-
paypalForwardingAlias?: string | null;
|
|
1093
1098
|
};
|
|
1094
1099
|
statusCode: number;
|
|
1095
1100
|
};
|
|
@@ -1131,11 +1136,6 @@ type WiseProfileNotFound = {
|
|
|
1131
1136
|
profileId: string;
|
|
1132
1137
|
profiles: WiseProfileInfo[];
|
|
1133
1138
|
};
|
|
1134
|
-
type PayPalSessionMaterial = {
|
|
1135
|
-
payeeEmail: string;
|
|
1136
|
-
forwardingBaseMailbox: string;
|
|
1137
|
-
forwardingMailboxAlias: string;
|
|
1138
|
-
};
|
|
1139
1139
|
type GoogleOAuthSellerCredentialPlatform = Extract<SellerPlatform, 'paypal' | 'venmo'>;
|
|
1140
1140
|
type PayPalGoogleOAuthSellerCredentialUploadBody = {
|
|
1141
1141
|
payeeEmail: string;
|
|
@@ -1162,17 +1162,13 @@ type CashAppCredentialUploadInput = {
|
|
|
1162
1162
|
type WiseCredentialUploadInput = {
|
|
1163
1163
|
sessionMaterial: WiseSessionMaterial;
|
|
1164
1164
|
};
|
|
1165
|
-
type PayPalCredentialUploadInput = {
|
|
1166
|
-
payeeId: string;
|
|
1167
|
-
sessionMaterial: PayPalSessionMaterial;
|
|
1168
|
-
};
|
|
1169
1165
|
type SellerCredentialUploadInputByPlatform = {
|
|
1170
1166
|
venmo: VenmoCredentialUploadInput;
|
|
1171
1167
|
cashapp: CashAppCredentialUploadInput;
|
|
1172
1168
|
wise: WiseCredentialUploadInput;
|
|
1173
|
-
paypal: PayPalCredentialUploadInput;
|
|
1174
1169
|
};
|
|
1175
|
-
type
|
|
1170
|
+
type SellerCredentialUploadPlatform = keyof SellerCredentialUploadInputByPlatform;
|
|
1171
|
+
type SellerCredentialUploadInput = SellerCredentialUploadInputByPlatform[keyof SellerCredentialUploadInputByPlatform];
|
|
1176
1172
|
type SellerCiphertextBundle = {
|
|
1177
1173
|
encryptedBlob: string;
|
|
1178
1174
|
encryptedDataKey: string;
|
|
@@ -1243,10 +1239,12 @@ type BuyerTeeSessionMaterialEncryptionInput = {
|
|
|
1243
1239
|
type MakerIdentityPlatform = Extract<IdentityPlatform, 'paypal' | 'wise'>;
|
|
1244
1240
|
type IdentityAttestationParams = IdentityParamsByPlatform[IdentityPlatform] | Record<string, string | number | boolean>;
|
|
1245
1241
|
type IdentityAttestationRequestBody = {
|
|
1242
|
+
callerAddress: string;
|
|
1246
1243
|
encryptedSessionMaterial: string;
|
|
1247
1244
|
params: IdentityAttestationParams;
|
|
1248
1245
|
};
|
|
1249
1246
|
type MakerIdentityAttestationRequestBody<P extends MakerIdentityPlatform> = {
|
|
1247
|
+
callerAddress: string;
|
|
1250
1248
|
encryptedSessionMaterial: string;
|
|
1251
1249
|
params: IdentityParamsByPlatform[P];
|
|
1252
1250
|
};
|
|
@@ -1324,7 +1322,7 @@ type CuratorSellerVerifyResponse = {
|
|
|
1324
1322
|
responseObject: SellerAttestationOutput;
|
|
1325
1323
|
statusCode: number;
|
|
1326
1324
|
};
|
|
1327
|
-
type RegisteredSellerCredentialPlatform = Exclude<
|
|
1325
|
+
type RegisteredSellerCredentialPlatform = Exclude<SellerCredentialUploadPlatform, 'wise'>;
|
|
1328
1326
|
type UploadSellerCredentialParams = ({
|
|
1329
1327
|
platform: 'wise';
|
|
1330
1328
|
} & WiseCredentialUploadInput) | {
|
|
@@ -1365,21 +1363,6 @@ type GetSellerCredentialStatusParams = {
|
|
|
1365
1363
|
processorName: SellerPlatform;
|
|
1366
1364
|
payeeDetails: Hash;
|
|
1367
1365
|
};
|
|
1368
|
-
type PayPalForwardingConfirmationErrorCode = 'paypal_forwarding_confirmation_not_found' | 'paypal_forwarding_initiator_email_mismatch' | 'paypal_forwarding_confirmation_expired' | 'paypal_forwarding_confirmation_rejected';
|
|
1369
|
-
type ConfirmPayPalForwardingRequest = {
|
|
1370
|
-
payeeDetails: Hash;
|
|
1371
|
-
payeeEmail: string;
|
|
1372
|
-
forwardingInitiatorEmail: string;
|
|
1373
|
-
};
|
|
1374
|
-
type ConfirmPayPalForwardingStatus = Omit<SellerCredentialStatus, 'payeeIdHash'> & {
|
|
1375
|
-
payeeIdHash?: Hash;
|
|
1376
|
-
};
|
|
1377
|
-
type ConfirmPayPalForwardingResponse = {
|
|
1378
|
-
success: boolean;
|
|
1379
|
-
message: string;
|
|
1380
|
-
responseObject: ConfirmPayPalForwardingStatus;
|
|
1381
|
-
statusCode: number;
|
|
1382
|
-
};
|
|
1383
1366
|
type GoogleOAuthSellerCredentialBaseParams = {
|
|
1384
1367
|
authorizationCode: string;
|
|
1385
1368
|
payeeDetails: Hash;
|
|
@@ -1616,8 +1599,6 @@ type GetPayeeDetailsResponse = {
|
|
|
1616
1599
|
metadata: CuratorMetadata | null;
|
|
1617
1600
|
hashedOnchainId: string;
|
|
1618
1601
|
createdAt: string;
|
|
1619
|
-
/** Per-merchant forwarding alias surfaced on maker lookup (PayPal multi-merchant flow) */
|
|
1620
|
-
paypalForwardingAlias?: string | null;
|
|
1621
1602
|
};
|
|
1622
1603
|
statusCode: number;
|
|
1623
1604
|
};
|
|
@@ -2046,8 +2027,8 @@ type CancelIntentMethodParams = {
|
|
|
2046
2027
|
type FulfillIntentMethodParams = {
|
|
2047
2028
|
/** The intent hash to fulfill (0x-prefixed, 32 bytes) */
|
|
2048
2029
|
intentHash: `0x${string}`;
|
|
2049
|
-
/**
|
|
2050
|
-
proof:
|
|
2030
|
+
/** Buyer TEE payment proof input */
|
|
2031
|
+
proof: BuyerTeePaymentProofInput;
|
|
2051
2032
|
/** Allowed timestamp variance in ms (default: 300000ms) */
|
|
2052
2033
|
timestampBufferMs?: string;
|
|
2053
2034
|
/** Override attestation service URL */
|
|
@@ -3352,7 +3333,7 @@ declare class Zkp2pClient {
|
|
|
3352
3333
|
* ```
|
|
3353
3334
|
*
|
|
3354
3335
|
* @param params.intentHash - The intent hash to fulfill (0x-prefixed, 32 bytes)
|
|
3355
|
-
* @param params.proof -
|
|
3336
|
+
* @param params.proof - Buyer TEE payment proof input
|
|
3356
3337
|
* @param params.timestampBufferMs - Allowed timestamp variance (default: 300000ms)
|
|
3357
3338
|
* @param params.attestationServiceUrl - Override attestation service URL
|
|
3358
3339
|
* @param params.postIntentHookData - Data to pass to post-intent hook
|
|
@@ -3475,17 +3456,6 @@ declare class Zkp2pClient {
|
|
|
3475
3456
|
baseApiUrl?: string;
|
|
3476
3457
|
timeoutMs?: number;
|
|
3477
3458
|
}): Promise<CuratorSellerCredentialUploadResponse>;
|
|
3478
|
-
/**
|
|
3479
|
-
* Confirms the PayPal Gmail-forwarding setup for an existing maker payee hash.
|
|
3480
|
-
*
|
|
3481
|
-
* Uses curator's `/forwarding-confirmation` route and forwards both API key and
|
|
3482
|
-
* bearer token so either auth strategy can satisfy the hybrid gate. The endpoint
|
|
3483
|
-
* is rate-limited server-side; callers should surface retry guidance from APIError.
|
|
3484
|
-
*/
|
|
3485
|
-
confirmPayPalForwarding(params: ConfirmPayPalForwardingRequest, opts?: {
|
|
3486
|
-
baseApiUrl?: string;
|
|
3487
|
-
timeoutMs?: number;
|
|
3488
|
-
}): Promise<ConfirmPayPalForwardingResponse>;
|
|
3489
3459
|
/**
|
|
3490
3460
|
* Upload a seller Gmail OAuth authorization code through curator.
|
|
3491
3461
|
*
|
|
@@ -3682,4 +3652,4 @@ type SendBatchFn = (txs: Array<{
|
|
|
3682
3652
|
value?: bigint;
|
|
3683
3653
|
}>) => Promise<string>;
|
|
3684
3654
|
|
|
3685
|
-
export { type
|
|
3655
|
+
export { type GetBestByPlatformResponse as $, type AttestationServiceIdentityResponse as A, type BuyerTeeSessionMaterialEncryptionInput as B, type CuratorSellerCredentialUploadResponse as C, type DepositWithRelations as D, type AuthorizationTokenProvider as E, type FulfillIntentMethodParams as F, type GoogleOAuthSellerCredentialPlatform as G, type TimeoutConfig as H, type IntentEntity$1 as I, type ActionCallback as J, type CreateDepositParams as K, type CreateDepositConversionRate as L, type Range as M, type SignalIntentParams as N, type FulfillIntentParams as O, type PostDepositDetailsRequest as P, type QuotesBestByPlatformRequest as Q, type ReferrerFeeConfig as R, type SellerCredentialBundle as S, type TxOverrides as T, type UploadSellerCredentialBundleParams as U, type ValidatePayeeDetailsRequest as V, type WithdrawDepositParams as W, type ReleaseFundsToPayerParams as X, type CancelIntentParams as Y, Zkp2pClient as Z, type BestByPlatformResponseObject as _, type IdentityAttestationRequestBody as a, type AttestationServiceSellerCredentialProbeResponse as a$, type GetBestByPlatformResponseObject as a0, type GetPlatformQuote as a1, type PlatformQuote as a2, type QuoteRequest as a3, type GetNearbyQuote as a4, type GetNearbySuggestions as a5, type GetQuoteResponse as a6, type GetQuoteResponseObject as a7, type GetQuoteSingleResponse as a8, type QuoteResponse as a9, type CashAppSessionMaterial as aA, type WiseSessionMaterial as aB, type WiseProfileInfo as aC, type WiseProfileSelectionRequired as aD, type WiseProfileNotFound as aE, type PayPalGoogleOAuthSellerCredentialUploadBody as aF, type VenmoGoogleOAuthSellerCredentialUploadBody as aG, type VenmoCredentialUploadInput as aH, type CashAppCredentialUploadInput as aI, type WiseCredentialUploadInput as aJ, type SellerCredentialUploadInputByPlatform as aK, type SellerCiphertextBundle as aL, type SellerSignedCiphertextBundle as aM, type SellerVerifyIntentDetails as aN, type SellerVerifyInput as aO, type SellerProbeInput as aP, type SellerCredentialBundleUpload as aQ, type SellerCredentialStatusValue as aR, type SellerCredentialStatus as aS, type SellerVerifyProxyBody as aT, type SellerTypedDataField as aU, type SellerTypedDataSpec as aV, type SellerPaymentTypedDataValue as aW, type SellerAttestationOutput as aX, type SellerCredentialProbeResponse as aY, type AttestationServiceSellerVerifyResponse as aZ, type FulfillIntentAttestationResponse as a_, type QuoteResponseObject as aa, type QuoteSingleResponse as ab, type QuoteIntentResponse as ac, type QuoteFeesResponse as ad, type FiatResponse as ae, type TokenResponse as af, type NearbyQuote as ag, type NearbySuggestions as ah, type ApiDeposit as ai, type DepositVerifier as aj, type DepositVerifierCurrency as ak, type DepositStatus as al, type GetDepositByIdRequest as am, type GetDepositByIdResponse as an, type Intent as ao, type ApiIntentStatus as ap, type GetOwnerIntentsRequest as aq, type GetOwnerIntentsResponse as ar, type GetIntentsByDepositRequest as as, type GetIntentsByDepositResponse as at, type GetIntentByHashRequest as au, type GetIntentByHashResponse as av, type RegisterPayeeDetailsRequest as aw, type RegisterPayeeDetailsResponse as ax, type SellerPlatform as ay, type VenmoSessionMaterial as az, type SellerCredentialUploadInput as b, type RateManagerOrderField as b$, type BuyerTeePaymentParams as b0, type BuyerTeePaymentProofInput as b1, type BuyerTeeSessionMaterial as b2, type CuratorSellerCredentialStatusResponse as b3, type CuratorSellerVerifyResponse as b4, type RegisteredSellerCredentialPlatform as b5, type UploadSellerCredentialParams as b6, type RegisteredUploadSellerCredentialParams as b7, type UploadSellerCredentialOptions as b8, type GetSellerCredentialStatusParams as b9, fetchFulfillmentAndPayment as bA, type DepositEntity$1 as bB, type IntentFulfilledEntity as bC, type IntentFulfillmentAmountsEntity as bD, type DepositPaymentMethodEntity$1 as bE, type MethodCurrencyEntity$1 as bF, type IntentStatus as bG, type RateManagerEntity as bH, type RateManagerRateEntity as bI, type RateManagerDelegationEntity as bJ, type ManagerAggregateStatsEntity as bK, type ManagerStatsEntity as bL, type ManagerDailySnapshotEntity as bM, type RateManagerListItem as bN, type RateManagerDetail as bO, type ManualRateUpdateEntity as bP, type OracleConfigUpdateEntity as bQ, type DepositFundActivityEntity$1 as bR, type DepositDailySnapshotEntity$1 as bS, type DepositFundActivityType$1 as bT, type DepositFilter as bU, type PaginationOptions as bV, type DepositOrderField as bW, type OrderDirection$1 as bX, type RateManagerFilter as bY, type RateManagerPaginationOptions as bZ, type RateManagerDelegationPaginationOptions as b_, type UploadPayPalGoogleOAuthSellerCredentialParams as ba, type UploadVenmoGoogleOAuthSellerCredentialParams as bb, type UploadGoogleOAuthSellerCredentialParams as bc, type VerifySellerPaymentParams as bd, type IdentityAttestationActionType as be, type IdentityAttestationOutput as bf, type IdentityAttestationOutputFor as bg, type IdentityAttestationParams as bh, type MakerIdentityAttestationRequestBody as bi, type MakerIdentityPlatform as bj, type OnchainCurrency as bk, type DepositVerifierData as bl, type PreparedTransaction as bm, type OrderStats as bn, type DepositIntentStatistics as bo, type TakerTier as bp, type TakerTierStats as bq, type TakerTierLevel as br, type PlatformLimit as bs, type PlatformRiskLevel as bt, type OrderbookEntry as bu, IndexerClient as bv, defaultIndexerEndpoint as bw, IndexerDepositService as bx, IndexerRateManagerService as by, compareEventCursorIdsByRecency as bz, type SellerCredentialUploadPlatform as c, type OrderDirection as c0, type DeploymentEnv as c1, type FulfillmentRecord as c2, type PaymentVerifiedRecord as c3, type FulfillmentAndPaymentResponse as c4, PAYMENT_PLATFORMS as c5, type PaymentPlatformType as c6, Currency as c7, currencyInfo as c8, getCurrencyInfoFromHash as c9, classifyDelegationState as cA, type DelegationRoute as cB, type DelegationState as cC, type DelegationDepositTarget as cD, type BatchResult as cE, type SendTransactionFn as cF, type SendBatchFn as cG, ZERO_ADDRESS as cH, asErrorMessage as cI, assertDelegationMethodSupport as cJ, getCurrencyInfoFromCountryCode as ca, getCurrencyCodeFromHash as cb, isSupportedCurrencyHash as cc, mapConversionRatesToOnchainMinRate as cd, type CurrencyData as ce, getContracts as cf, getRateManagerContracts as cg, getPaymentMethodsCatalog as ch, getGatingServiceAddress as ci, type RuntimeEnv as cj, parseDepositView as ck, parseIntentView as cl, enrichPvDepositView as cm, enrichPvIntentView as cn, type PV_DepositView as co, type PV_Deposit as cp, type PV_PaymentMethodData as cq, type PV_Currency as cr, type PV_ReferralFee as cs, type PV_IntentView as ct, type PV_Intent as cu, ZERO_RATE_MANAGER_ID as cv, isZeroRateManagerId as cw, normalizeRateManagerId as cx, normalizeRegistry as cy, getDelegationRoute as cz, type SellerCredentialAttestationRuntime as d, type AttestationServiceSellerCredentialUploadResponse as e, type GoogleOAuthSellerCredentialUploadBodyByPlatform as f, type BestByPlatformResponse as g, type ValidatePayeeDetailsResponse as h, type PostDepositDetailsResponse as i, type GetPayeeDetailsRequest as j, type GetPayeeDetailsResponse as k, type GetOwnerDepositsRequest as l, type GetOwnerDepositsResponse as m, type GetTakerTierRequest as n, type GetTakerTierResponse as o, type GetDepositBundleParams as p, type ApiAdapterOptions as q, type GetDepositBundleResponse as r, type GetOrderbookParams as s, type GetOrderbookResponse as t, type CurrencyType as u, type PaymentMethodCatalog as v, type SignalIntentReferralFee as w, type SignalIntentMethodParams as x, type CancelIntentMethodParams as y, type Zkp2pNextOptions as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zkp2p/sdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "ZKP2P Client SDK - TypeScript SDK for deposit management, liquidity provision, and onramping",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"@zkp2p/indexer-schema": "0.2.3",
|
|
91
91
|
"@zkp2p/contracts-v2": "0.2.2",
|
|
92
|
-
"@zkp2p/zkp2p-attestation": "1.
|
|
92
|
+
"@zkp2p/zkp2p-attestation": "1.5.1",
|
|
93
93
|
"ethers": "^6.0.0",
|
|
94
94
|
"ox": "^0.11.1"
|
|
95
95
|
},
|