@zkp2p/sdk 0.5.0 → 0.5.4
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 +10 -6
- package/dist/{chunk-LPJE2MN7.mjs → chunk-TGMRXUP2.mjs} +28 -3
- package/dist/chunk-TGMRXUP2.mjs.map +1 -0
- package/dist/{chunk-L526MKG3.mjs → chunk-VJ33XYCV.mjs} +123 -128
- package/dist/{chunk-L526MKG3.mjs.map → chunk-VJ33XYCV.mjs.map} +1 -1
- package/dist/index.cjs +401 -397
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +44 -21
- package/dist/index.d.ts +44 -21
- package/dist/index.mjs +200 -209
- package/dist/index.mjs.map +1 -1
- package/dist/protocolViewerParsers-XN63B2S5.mjs +5 -0
- package/dist/{protocolViewerParsers-GGSM2243.mjs.map → protocolViewerParsers-XN63B2S5.mjs.map} +1 -1
- package/dist/react.cjs +31 -16
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.mjs +6 -18
- package/dist/react.mjs.map +1 -1
- package/dist/{vaultUtils-BL8tzsmH.d.mts → vaultUtils-DOOl9QUP.d.mts} +35 -67
- package/dist/{vaultUtils-BL8tzsmH.d.ts → vaultUtils-DOOl9QUP.d.ts} +35 -67
- package/package.json +3 -3
- package/dist/chunk-LPJE2MN7.mjs.map +0 -1
- package/dist/protocolViewerParsers-GGSM2243.mjs +0 -5
|
@@ -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
|
*/
|
|
@@ -950,8 +959,6 @@ type TimeoutConfig = {
|
|
|
950
959
|
type ApiAdapterOptions = {
|
|
951
960
|
baseApiUrl: string;
|
|
952
961
|
timeoutMs?: number;
|
|
953
|
-
apiKey?: string;
|
|
954
|
-
authToken?: string;
|
|
955
962
|
};
|
|
956
963
|
type AuthorizationTokenProvider = () => string | null | undefined | Promise<string | null | undefined>;
|
|
957
964
|
/**
|
|
@@ -1004,8 +1011,8 @@ type CuratorPayeeDataInput = {
|
|
|
1004
1011
|
type FulfillIntentParams = {
|
|
1005
1012
|
/** Hash of the intent to fulfill */
|
|
1006
1013
|
intentHash: Hash;
|
|
1007
|
-
/**
|
|
1008
|
-
proof:
|
|
1014
|
+
/** Buyer TEE payment proof input */
|
|
1015
|
+
proof: BuyerTeePaymentProofInput;
|
|
1009
1016
|
/** Optional attestation timestamp buffer override in milliseconds */
|
|
1010
1017
|
timestampBufferMs?: number | string;
|
|
1011
1018
|
/** Override the attestation service base URL */
|
|
@@ -1086,10 +1093,6 @@ type PostDepositDetailsResponse = {
|
|
|
1086
1093
|
metadata: CuratorMetadata | null;
|
|
1087
1094
|
hashedOnchainId: string;
|
|
1088
1095
|
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
1096
|
};
|
|
1094
1097
|
statusCode: number;
|
|
1095
1098
|
};
|
|
@@ -1131,11 +1134,6 @@ type WiseProfileNotFound = {
|
|
|
1131
1134
|
profileId: string;
|
|
1132
1135
|
profiles: WiseProfileInfo[];
|
|
1133
1136
|
};
|
|
1134
|
-
type PayPalSessionMaterial = {
|
|
1135
|
-
payeeEmail: string;
|
|
1136
|
-
forwardingBaseMailbox: string;
|
|
1137
|
-
forwardingMailboxAlias: string;
|
|
1138
|
-
};
|
|
1139
1137
|
type GoogleOAuthSellerCredentialPlatform = Extract<SellerPlatform, 'paypal' | 'venmo'>;
|
|
1140
1138
|
type PayPalGoogleOAuthSellerCredentialUploadBody = {
|
|
1141
1139
|
payeeEmail: string;
|
|
@@ -1162,17 +1160,13 @@ type CashAppCredentialUploadInput = {
|
|
|
1162
1160
|
type WiseCredentialUploadInput = {
|
|
1163
1161
|
sessionMaterial: WiseSessionMaterial;
|
|
1164
1162
|
};
|
|
1165
|
-
type PayPalCredentialUploadInput = {
|
|
1166
|
-
payeeId: string;
|
|
1167
|
-
sessionMaterial: PayPalSessionMaterial;
|
|
1168
|
-
};
|
|
1169
1163
|
type SellerCredentialUploadInputByPlatform = {
|
|
1170
1164
|
venmo: VenmoCredentialUploadInput;
|
|
1171
1165
|
cashapp: CashAppCredentialUploadInput;
|
|
1172
1166
|
wise: WiseCredentialUploadInput;
|
|
1173
|
-
paypal: PayPalCredentialUploadInput;
|
|
1174
1167
|
};
|
|
1175
|
-
type
|
|
1168
|
+
type SellerCredentialUploadPlatform = keyof SellerCredentialUploadInputByPlatform;
|
|
1169
|
+
type SellerCredentialUploadInput = SellerCredentialUploadInputByPlatform[keyof SellerCredentialUploadInputByPlatform];
|
|
1176
1170
|
type SellerCiphertextBundle = {
|
|
1177
1171
|
encryptedBlob: string;
|
|
1178
1172
|
encryptedDataKey: string;
|
|
@@ -1243,10 +1237,12 @@ type BuyerTeeSessionMaterialEncryptionInput = {
|
|
|
1243
1237
|
type MakerIdentityPlatform = Extract<IdentityPlatform, 'paypal' | 'wise'>;
|
|
1244
1238
|
type IdentityAttestationParams = IdentityParamsByPlatform[IdentityPlatform] | Record<string, string | number | boolean>;
|
|
1245
1239
|
type IdentityAttestationRequestBody = {
|
|
1240
|
+
callerAddress: string;
|
|
1246
1241
|
encryptedSessionMaterial: string;
|
|
1247
1242
|
params: IdentityAttestationParams;
|
|
1248
1243
|
};
|
|
1249
1244
|
type MakerIdentityAttestationRequestBody<P extends MakerIdentityPlatform> = {
|
|
1245
|
+
callerAddress: string;
|
|
1250
1246
|
encryptedSessionMaterial: string;
|
|
1251
1247
|
params: IdentityParamsByPlatform[P];
|
|
1252
1248
|
};
|
|
@@ -1324,7 +1320,7 @@ type CuratorSellerVerifyResponse = {
|
|
|
1324
1320
|
responseObject: SellerAttestationOutput;
|
|
1325
1321
|
statusCode: number;
|
|
1326
1322
|
};
|
|
1327
|
-
type RegisteredSellerCredentialPlatform = Exclude<
|
|
1323
|
+
type RegisteredSellerCredentialPlatform = Exclude<SellerCredentialUploadPlatform, 'wise'>;
|
|
1328
1324
|
type UploadSellerCredentialParams = ({
|
|
1329
1325
|
platform: 'wise';
|
|
1330
1326
|
} & WiseCredentialUploadInput) | {
|
|
@@ -1365,21 +1361,6 @@ type GetSellerCredentialStatusParams = {
|
|
|
1365
1361
|
processorName: SellerPlatform;
|
|
1366
1362
|
payeeDetails: Hash;
|
|
1367
1363
|
};
|
|
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
1364
|
type GoogleOAuthSellerCredentialBaseParams = {
|
|
1384
1365
|
authorizationCode: string;
|
|
1385
1366
|
payeeDetails: Hash;
|
|
@@ -1616,8 +1597,6 @@ type GetPayeeDetailsResponse = {
|
|
|
1616
1597
|
metadata: CuratorMetadata | null;
|
|
1617
1598
|
hashedOnchainId: string;
|
|
1618
1599
|
createdAt: string;
|
|
1619
|
-
/** Per-merchant forwarding alias surfaced on maker lookup (PayPal multi-merchant flow) */
|
|
1620
|
-
paypalForwardingAlias?: string | null;
|
|
1621
1600
|
};
|
|
1622
1601
|
statusCode: number;
|
|
1623
1602
|
};
|
|
@@ -1941,7 +1920,7 @@ type PaymentPlatformType = (typeof PAYMENT_PLATFORMS)[number];
|
|
|
1941
1920
|
* walletClient,
|
|
1942
1921
|
* chainId: 8453, // Base mainnet
|
|
1943
1922
|
* runtimeEnv: 'production',
|
|
1944
|
-
* // apiKey: '
|
|
1923
|
+
* // apiKey: 'internal-curator-api-key', // Optional: internal seller verification only
|
|
1945
1924
|
* indexerApiKey: 'your-indexer-key',
|
|
1946
1925
|
* };
|
|
1947
1926
|
* ```
|
|
@@ -1960,12 +1939,11 @@ type Zkp2pNextOptions = {
|
|
|
1960
1939
|
/** Base API URL for ZKP2P services (defaults to https://api.zkp2p.xyz) */
|
|
1961
1940
|
baseApiUrl?: string;
|
|
1962
1941
|
/**
|
|
1963
|
-
* Optional curator API key (sent as `x-api-key`) for
|
|
1964
|
-
*
|
|
1965
|
-
* Not used by `registerPayeeDetails` or `getTakerTier`.
|
|
1942
|
+
* Optional internal curator API key (sent as `x-api-key`) for internal seller verification.
|
|
1943
|
+
* Not used by public curator endpoints such as quotes, maker reads, or intent signing.
|
|
1966
1944
|
*/
|
|
1967
1945
|
apiKey?: string;
|
|
1968
|
-
/** Optional bearer token for
|
|
1946
|
+
/** Optional bearer token for indexer authentication */
|
|
1969
1947
|
authorizationToken?: string;
|
|
1970
1948
|
/** Optional async token provider for indexer auth in long-lived clients */
|
|
1971
1949
|
getAuthorizationToken?: IndexerAuthTokenProvider;
|
|
@@ -2046,8 +2024,8 @@ type CancelIntentMethodParams = {
|
|
|
2046
2024
|
type FulfillIntentMethodParams = {
|
|
2047
2025
|
/** The intent hash to fulfill (0x-prefixed, 32 bytes) */
|
|
2048
2026
|
intentHash: `0x${string}`;
|
|
2049
|
-
/**
|
|
2050
|
-
proof:
|
|
2027
|
+
/** Buyer TEE payment proof input */
|
|
2028
|
+
proof: BuyerTeePaymentProofInput;
|
|
2051
2029
|
/** Allowed timestamp variance in ms (default: 300000ms) */
|
|
2052
2030
|
timestampBufferMs?: string;
|
|
2053
2031
|
/** Override attestation service URL */
|
|
@@ -2214,9 +2192,9 @@ declare class Zkp2pClient {
|
|
|
2214
2192
|
readonly orchestratorRegistryAbi?: Abi;
|
|
2215
2193
|
/** Base API URL for ZKP2P services */
|
|
2216
2194
|
readonly baseApiUrl?: string;
|
|
2217
|
-
/** Optional curator API key (`x-api-key`) for
|
|
2195
|
+
/** Optional internal curator API key (`x-api-key`) for internal seller verification */
|
|
2218
2196
|
readonly apiKey?: string;
|
|
2219
|
-
/** Bearer token for
|
|
2197
|
+
/** Bearer token for indexer authentication */
|
|
2220
2198
|
readonly authorizationToken?: string;
|
|
2221
2199
|
/** API timeout in milliseconds */
|
|
2222
2200
|
readonly apiTimeoutMs: number;
|
|
@@ -3177,9 +3155,9 @@ declare class Zkp2pClient {
|
|
|
3177
3155
|
* sending fiat payment to the deposit's payee.
|
|
3178
3156
|
*
|
|
3179
3157
|
* If `gatingServiceSignature` is not provided, the SDK will automatically
|
|
3180
|
-
* fetch one from curator `/v3/intent/sign` when `
|
|
3181
|
-
*
|
|
3182
|
-
*
|
|
3158
|
+
* fetch one from curator `/v3/intent/sign` when `baseApiUrl` is configured.
|
|
3159
|
+
* Otherwise you must provide `gatingServiceSignature` and `signatureExpiration`
|
|
3160
|
+
* yourself.
|
|
3183
3161
|
*
|
|
3184
3162
|
* **Prepare Mode**: Use `.prepare()` to get the transaction calldata without sending:
|
|
3185
3163
|
* ```typescript
|
|
@@ -3352,7 +3330,7 @@ declare class Zkp2pClient {
|
|
|
3352
3330
|
* ```
|
|
3353
3331
|
*
|
|
3354
3332
|
* @param params.intentHash - The intent hash to fulfill (0x-prefixed, 32 bytes)
|
|
3355
|
-
* @param params.proof -
|
|
3333
|
+
* @param params.proof - Buyer TEE payment proof input
|
|
3356
3334
|
* @param params.timestampBufferMs - Allowed timestamp variance (default: 300000ms)
|
|
3357
3335
|
* @param params.attestationServiceUrl - Override attestation service URL
|
|
3358
3336
|
* @param params.postIntentHookData - Data to pass to post-intent hook
|
|
@@ -3431,8 +3409,8 @@ declare class Zkp2pClient {
|
|
|
3431
3409
|
/**
|
|
3432
3410
|
* **Supporting Method** - Fetches the best available quote per supported payment platform.
|
|
3433
3411
|
*
|
|
3434
|
-
* Returns one quote per platform when available.
|
|
3435
|
-
*
|
|
3412
|
+
* Returns one quote per platform when available. The API returns payee details
|
|
3413
|
+
* in each platform's best quote when available.
|
|
3436
3414
|
*
|
|
3437
3415
|
* @param req - Best-by-platform quote request parameters
|
|
3438
3416
|
* @param opts - Optional overrides for API URL and timeout
|
|
@@ -3475,17 +3453,6 @@ declare class Zkp2pClient {
|
|
|
3475
3453
|
baseApiUrl?: string;
|
|
3476
3454
|
timeoutMs?: number;
|
|
3477
3455
|
}): 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
3456
|
/**
|
|
3490
3457
|
* Upload a seller Gmail OAuth authorization code through curator.
|
|
3491
3458
|
*
|
|
@@ -3510,8 +3477,8 @@ declare class Zkp2pClient {
|
|
|
3510
3477
|
timeoutMs?: number;
|
|
3511
3478
|
}): Promise<CuratorSellerCredentialStatusResponse>;
|
|
3512
3479
|
/**
|
|
3513
|
-
* Internal-use endpoint. The curator route requires an internal `x-api-key`;
|
|
3514
|
-
* API keys will be rejected
|
|
3480
|
+
* Internal-use endpoint. The curator route requires an internal `x-api-key`; non-internal
|
|
3481
|
+
* API keys will be rejected. Returns 410 GONE when curator has marked the credential inactive
|
|
3515
3482
|
* or a stale credential fails its synchronous re-probe.
|
|
3516
3483
|
*
|
|
3517
3484
|
* Verify a seller payment via curator's seller-credential proxy.
|
|
@@ -3622,6 +3589,7 @@ declare class Zkp2pClient {
|
|
|
3622
3589
|
intentTimestampMs: string;
|
|
3623
3590
|
paymentMethodHash: `0x${string}`;
|
|
3624
3591
|
paymentVerifier?: `0x${string}`;
|
|
3592
|
+
minimumReleaseAmount?: string;
|
|
3625
3593
|
}>;
|
|
3626
3594
|
}
|
|
3627
3595
|
|
|
@@ -3682,4 +3650,4 @@ type SendBatchFn = (txs: Array<{
|
|
|
3682
3650
|
value?: bigint;
|
|
3683
3651
|
}>) => Promise<string>;
|
|
3684
3652
|
|
|
3685
|
-
export { type BestByPlatformResponseObject as $, type AttestationServiceIdentityResponse as A, type BuyerTeeSessionMaterialEncryptionInput as B, type CuratorSellerCredentialUploadResponse as C, type DepositWithRelations as D, type Zkp2pNextOptions as E, type FulfillIntentMethodParams as F, type GoogleOAuthSellerCredentialPlatform as G, type AuthorizationTokenProvider as H, type IntentEntity$1 as I, type TimeoutConfig as J, type ActionCallback as K, type CreateDepositParams as L, type CreateDepositConversionRate as M, type Range as N, type SignalIntentParams as O, type PostDepositDetailsRequest as P, type QuotesBestByPlatformRequest as Q, type ReferrerFeeConfig as R, type SellerCredentialBundle as S, type
|
|
3653
|
+
export { type BestByPlatformResponseObject as $, type AttestationServiceIdentityResponse as A, type BuyerTeeSessionMaterialEncryptionInput as B, type CuratorSellerCredentialUploadResponse as C, type DepositWithRelations as D, type Zkp2pNextOptions as E, type FulfillIntentMethodParams as F, type GoogleOAuthSellerCredentialPlatform as G, type AuthorizationTokenProvider as H, type IntentEntity$1 as I, type TimeoutConfig as J, type ActionCallback as K, type CreateDepositParams as L, type CreateDepositConversionRate as M, type Range as N, type SignalIntentParams as O, type PostDepositDetailsRequest as P, type QuotesBestByPlatformRequest as Q, type ReferrerFeeConfig as R, type SellerCredentialBundle as S, type TakerTierLevel as T, type UploadSellerCredentialBundleParams as U, type ValidatePayeeDetailsRequest as V, type WithdrawDepositParams as W, type FulfillIntentParams as X, type ReleaseFundsToPayerParams as Y, Zkp2pClient as Z, type CancelIntentParams as _, type IdentityAttestationRequestBody as a, type FulfillIntentAttestationResponse as a$, type GetBestByPlatformResponse as a0, type GetBestByPlatformResponseObject as a1, type GetPlatformQuote as a2, type PlatformQuote as a3, type QuoteRequest as a4, type GetNearbyQuote as a5, type GetNearbySuggestions as a6, type GetQuoteResponse as a7, type GetQuoteResponseObject as a8, type GetQuoteSingleResponse as a9, type VenmoSessionMaterial as aA, type CashAppSessionMaterial as aB, type WiseSessionMaterial as aC, type WiseProfileInfo as aD, type WiseProfileSelectionRequired as aE, type WiseProfileNotFound as aF, type PayPalGoogleOAuthSellerCredentialUploadBody as aG, type VenmoGoogleOAuthSellerCredentialUploadBody as aH, type VenmoCredentialUploadInput as aI, type CashAppCredentialUploadInput as aJ, type WiseCredentialUploadInput as aK, type SellerCredentialUploadInputByPlatform as aL, type SellerCiphertextBundle as aM, type SellerSignedCiphertextBundle as aN, type SellerVerifyIntentDetails as aO, type SellerVerifyInput as aP, type SellerProbeInput as aQ, type SellerCredentialBundleUpload as aR, type SellerCredentialStatusValue as aS, type SellerCredentialStatus as aT, type SellerVerifyProxyBody as aU, type SellerTypedDataField as aV, type SellerTypedDataSpec as aW, type SellerPaymentTypedDataValue as aX, type SellerAttestationOutput as aY, type SellerCredentialProbeResponse as aZ, type AttestationServiceSellerVerifyResponse as a_, type QuoteResponse as aa, type QuoteResponseObject as ab, type QuoteSingleResponse as ac, type QuoteIntentResponse as ad, type QuoteFeesResponse as ae, type FiatResponse as af, type TokenResponse as ag, type NearbyQuote as ah, type NearbySuggestions as ai, type ApiDeposit as aj, type DepositVerifier as ak, type DepositVerifierCurrency as al, type DepositStatus as am, type GetDepositByIdRequest as an, type GetDepositByIdResponse as ao, type Intent as ap, type ApiIntentStatus as aq, type GetOwnerIntentsRequest as ar, type GetOwnerIntentsResponse as as, type GetIntentsByDepositRequest as at, type GetIntentsByDepositResponse as au, type GetIntentByHashRequest as av, type GetIntentByHashResponse as aw, type RegisterPayeeDetailsRequest as ax, type RegisterPayeeDetailsResponse as ay, type SellerPlatform as az, type SellerCredentialUploadInput as b, type RateManagerOrderField as b$, type AttestationServiceSellerCredentialProbeResponse as b0, type BuyerTeePaymentParams as b1, type BuyerTeePaymentProofInput as b2, type BuyerTeeSessionMaterial as b3, type CuratorSellerCredentialStatusResponse as b4, type CuratorSellerVerifyResponse as b5, type RegisteredSellerCredentialPlatform as b6, type UploadSellerCredentialParams as b7, type RegisteredUploadSellerCredentialParams as b8, type UploadSellerCredentialOptions 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 GetSellerCredentialStatusParams as ba, type UploadPayPalGoogleOAuthSellerCredentialParams as bb, type UploadVenmoGoogleOAuthSellerCredentialParams as bc, type UploadGoogleOAuthSellerCredentialParams as bd, type VerifySellerPaymentParams as be, type IdentityAttestationActionType as bf, type IdentityAttestationOutput as bg, type IdentityAttestationOutputFor as bh, type IdentityAttestationParams as bi, type MakerIdentityAttestationRequestBody as bj, type MakerIdentityPlatform as bk, type OnchainCurrency as bl, type DepositVerifierData as bm, type PreparedTransaction as bn, type OrderStats as bo, type DepositIntentStatistics as bp, type TakerTier as bq, type TakerTierStats 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 TxOverrides as w, type SignalIntentReferralFee as x, type SignalIntentMethodParams as y, type CancelIntentMethodParams 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
|
*/
|
|
@@ -950,8 +959,6 @@ type TimeoutConfig = {
|
|
|
950
959
|
type ApiAdapterOptions = {
|
|
951
960
|
baseApiUrl: string;
|
|
952
961
|
timeoutMs?: number;
|
|
953
|
-
apiKey?: string;
|
|
954
|
-
authToken?: string;
|
|
955
962
|
};
|
|
956
963
|
type AuthorizationTokenProvider = () => string | null | undefined | Promise<string | null | undefined>;
|
|
957
964
|
/**
|
|
@@ -1004,8 +1011,8 @@ type CuratorPayeeDataInput = {
|
|
|
1004
1011
|
type FulfillIntentParams = {
|
|
1005
1012
|
/** Hash of the intent to fulfill */
|
|
1006
1013
|
intentHash: Hash;
|
|
1007
|
-
/**
|
|
1008
|
-
proof:
|
|
1014
|
+
/** Buyer TEE payment proof input */
|
|
1015
|
+
proof: BuyerTeePaymentProofInput;
|
|
1009
1016
|
/** Optional attestation timestamp buffer override in milliseconds */
|
|
1010
1017
|
timestampBufferMs?: number | string;
|
|
1011
1018
|
/** Override the attestation service base URL */
|
|
@@ -1086,10 +1093,6 @@ type PostDepositDetailsResponse = {
|
|
|
1086
1093
|
metadata: CuratorMetadata | null;
|
|
1087
1094
|
hashedOnchainId: string;
|
|
1088
1095
|
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
1096
|
};
|
|
1094
1097
|
statusCode: number;
|
|
1095
1098
|
};
|
|
@@ -1131,11 +1134,6 @@ type WiseProfileNotFound = {
|
|
|
1131
1134
|
profileId: string;
|
|
1132
1135
|
profiles: WiseProfileInfo[];
|
|
1133
1136
|
};
|
|
1134
|
-
type PayPalSessionMaterial = {
|
|
1135
|
-
payeeEmail: string;
|
|
1136
|
-
forwardingBaseMailbox: string;
|
|
1137
|
-
forwardingMailboxAlias: string;
|
|
1138
|
-
};
|
|
1139
1137
|
type GoogleOAuthSellerCredentialPlatform = Extract<SellerPlatform, 'paypal' | 'venmo'>;
|
|
1140
1138
|
type PayPalGoogleOAuthSellerCredentialUploadBody = {
|
|
1141
1139
|
payeeEmail: string;
|
|
@@ -1162,17 +1160,13 @@ type CashAppCredentialUploadInput = {
|
|
|
1162
1160
|
type WiseCredentialUploadInput = {
|
|
1163
1161
|
sessionMaterial: WiseSessionMaterial;
|
|
1164
1162
|
};
|
|
1165
|
-
type PayPalCredentialUploadInput = {
|
|
1166
|
-
payeeId: string;
|
|
1167
|
-
sessionMaterial: PayPalSessionMaterial;
|
|
1168
|
-
};
|
|
1169
1163
|
type SellerCredentialUploadInputByPlatform = {
|
|
1170
1164
|
venmo: VenmoCredentialUploadInput;
|
|
1171
1165
|
cashapp: CashAppCredentialUploadInput;
|
|
1172
1166
|
wise: WiseCredentialUploadInput;
|
|
1173
|
-
paypal: PayPalCredentialUploadInput;
|
|
1174
1167
|
};
|
|
1175
|
-
type
|
|
1168
|
+
type SellerCredentialUploadPlatform = keyof SellerCredentialUploadInputByPlatform;
|
|
1169
|
+
type SellerCredentialUploadInput = SellerCredentialUploadInputByPlatform[keyof SellerCredentialUploadInputByPlatform];
|
|
1176
1170
|
type SellerCiphertextBundle = {
|
|
1177
1171
|
encryptedBlob: string;
|
|
1178
1172
|
encryptedDataKey: string;
|
|
@@ -1243,10 +1237,12 @@ type BuyerTeeSessionMaterialEncryptionInput = {
|
|
|
1243
1237
|
type MakerIdentityPlatform = Extract<IdentityPlatform, 'paypal' | 'wise'>;
|
|
1244
1238
|
type IdentityAttestationParams = IdentityParamsByPlatform[IdentityPlatform] | Record<string, string | number | boolean>;
|
|
1245
1239
|
type IdentityAttestationRequestBody = {
|
|
1240
|
+
callerAddress: string;
|
|
1246
1241
|
encryptedSessionMaterial: string;
|
|
1247
1242
|
params: IdentityAttestationParams;
|
|
1248
1243
|
};
|
|
1249
1244
|
type MakerIdentityAttestationRequestBody<P extends MakerIdentityPlatform> = {
|
|
1245
|
+
callerAddress: string;
|
|
1250
1246
|
encryptedSessionMaterial: string;
|
|
1251
1247
|
params: IdentityParamsByPlatform[P];
|
|
1252
1248
|
};
|
|
@@ -1324,7 +1320,7 @@ type CuratorSellerVerifyResponse = {
|
|
|
1324
1320
|
responseObject: SellerAttestationOutput;
|
|
1325
1321
|
statusCode: number;
|
|
1326
1322
|
};
|
|
1327
|
-
type RegisteredSellerCredentialPlatform = Exclude<
|
|
1323
|
+
type RegisteredSellerCredentialPlatform = Exclude<SellerCredentialUploadPlatform, 'wise'>;
|
|
1328
1324
|
type UploadSellerCredentialParams = ({
|
|
1329
1325
|
platform: 'wise';
|
|
1330
1326
|
} & WiseCredentialUploadInput) | {
|
|
@@ -1365,21 +1361,6 @@ type GetSellerCredentialStatusParams = {
|
|
|
1365
1361
|
processorName: SellerPlatform;
|
|
1366
1362
|
payeeDetails: Hash;
|
|
1367
1363
|
};
|
|
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
1364
|
type GoogleOAuthSellerCredentialBaseParams = {
|
|
1384
1365
|
authorizationCode: string;
|
|
1385
1366
|
payeeDetails: Hash;
|
|
@@ -1616,8 +1597,6 @@ type GetPayeeDetailsResponse = {
|
|
|
1616
1597
|
metadata: CuratorMetadata | null;
|
|
1617
1598
|
hashedOnchainId: string;
|
|
1618
1599
|
createdAt: string;
|
|
1619
|
-
/** Per-merchant forwarding alias surfaced on maker lookup (PayPal multi-merchant flow) */
|
|
1620
|
-
paypalForwardingAlias?: string | null;
|
|
1621
1600
|
};
|
|
1622
1601
|
statusCode: number;
|
|
1623
1602
|
};
|
|
@@ -1941,7 +1920,7 @@ type PaymentPlatformType = (typeof PAYMENT_PLATFORMS)[number];
|
|
|
1941
1920
|
* walletClient,
|
|
1942
1921
|
* chainId: 8453, // Base mainnet
|
|
1943
1922
|
* runtimeEnv: 'production',
|
|
1944
|
-
* // apiKey: '
|
|
1923
|
+
* // apiKey: 'internal-curator-api-key', // Optional: internal seller verification only
|
|
1945
1924
|
* indexerApiKey: 'your-indexer-key',
|
|
1946
1925
|
* };
|
|
1947
1926
|
* ```
|
|
@@ -1960,12 +1939,11 @@ type Zkp2pNextOptions = {
|
|
|
1960
1939
|
/** Base API URL for ZKP2P services (defaults to https://api.zkp2p.xyz) */
|
|
1961
1940
|
baseApiUrl?: string;
|
|
1962
1941
|
/**
|
|
1963
|
-
* Optional curator API key (sent as `x-api-key`) for
|
|
1964
|
-
*
|
|
1965
|
-
* Not used by `registerPayeeDetails` or `getTakerTier`.
|
|
1942
|
+
* Optional internal curator API key (sent as `x-api-key`) for internal seller verification.
|
|
1943
|
+
* Not used by public curator endpoints such as quotes, maker reads, or intent signing.
|
|
1966
1944
|
*/
|
|
1967
1945
|
apiKey?: string;
|
|
1968
|
-
/** Optional bearer token for
|
|
1946
|
+
/** Optional bearer token for indexer authentication */
|
|
1969
1947
|
authorizationToken?: string;
|
|
1970
1948
|
/** Optional async token provider for indexer auth in long-lived clients */
|
|
1971
1949
|
getAuthorizationToken?: IndexerAuthTokenProvider;
|
|
@@ -2046,8 +2024,8 @@ type CancelIntentMethodParams = {
|
|
|
2046
2024
|
type FulfillIntentMethodParams = {
|
|
2047
2025
|
/** The intent hash to fulfill (0x-prefixed, 32 bytes) */
|
|
2048
2026
|
intentHash: `0x${string}`;
|
|
2049
|
-
/**
|
|
2050
|
-
proof:
|
|
2027
|
+
/** Buyer TEE payment proof input */
|
|
2028
|
+
proof: BuyerTeePaymentProofInput;
|
|
2051
2029
|
/** Allowed timestamp variance in ms (default: 300000ms) */
|
|
2052
2030
|
timestampBufferMs?: string;
|
|
2053
2031
|
/** Override attestation service URL */
|
|
@@ -2214,9 +2192,9 @@ declare class Zkp2pClient {
|
|
|
2214
2192
|
readonly orchestratorRegistryAbi?: Abi;
|
|
2215
2193
|
/** Base API URL for ZKP2P services */
|
|
2216
2194
|
readonly baseApiUrl?: string;
|
|
2217
|
-
/** Optional curator API key (`x-api-key`) for
|
|
2195
|
+
/** Optional internal curator API key (`x-api-key`) for internal seller verification */
|
|
2218
2196
|
readonly apiKey?: string;
|
|
2219
|
-
/** Bearer token for
|
|
2197
|
+
/** Bearer token for indexer authentication */
|
|
2220
2198
|
readonly authorizationToken?: string;
|
|
2221
2199
|
/** API timeout in milliseconds */
|
|
2222
2200
|
readonly apiTimeoutMs: number;
|
|
@@ -3177,9 +3155,9 @@ declare class Zkp2pClient {
|
|
|
3177
3155
|
* sending fiat payment to the deposit's payee.
|
|
3178
3156
|
*
|
|
3179
3157
|
* If `gatingServiceSignature` is not provided, the SDK will automatically
|
|
3180
|
-
* fetch one from curator `/v3/intent/sign` when `
|
|
3181
|
-
*
|
|
3182
|
-
*
|
|
3158
|
+
* fetch one from curator `/v3/intent/sign` when `baseApiUrl` is configured.
|
|
3159
|
+
* Otherwise you must provide `gatingServiceSignature` and `signatureExpiration`
|
|
3160
|
+
* yourself.
|
|
3183
3161
|
*
|
|
3184
3162
|
* **Prepare Mode**: Use `.prepare()` to get the transaction calldata without sending:
|
|
3185
3163
|
* ```typescript
|
|
@@ -3352,7 +3330,7 @@ declare class Zkp2pClient {
|
|
|
3352
3330
|
* ```
|
|
3353
3331
|
*
|
|
3354
3332
|
* @param params.intentHash - The intent hash to fulfill (0x-prefixed, 32 bytes)
|
|
3355
|
-
* @param params.proof -
|
|
3333
|
+
* @param params.proof - Buyer TEE payment proof input
|
|
3356
3334
|
* @param params.timestampBufferMs - Allowed timestamp variance (default: 300000ms)
|
|
3357
3335
|
* @param params.attestationServiceUrl - Override attestation service URL
|
|
3358
3336
|
* @param params.postIntentHookData - Data to pass to post-intent hook
|
|
@@ -3431,8 +3409,8 @@ declare class Zkp2pClient {
|
|
|
3431
3409
|
/**
|
|
3432
3410
|
* **Supporting Method** - Fetches the best available quote per supported payment platform.
|
|
3433
3411
|
*
|
|
3434
|
-
* Returns one quote per platform when available.
|
|
3435
|
-
*
|
|
3412
|
+
* Returns one quote per platform when available. The API returns payee details
|
|
3413
|
+
* in each platform's best quote when available.
|
|
3436
3414
|
*
|
|
3437
3415
|
* @param req - Best-by-platform quote request parameters
|
|
3438
3416
|
* @param opts - Optional overrides for API URL and timeout
|
|
@@ -3475,17 +3453,6 @@ declare class Zkp2pClient {
|
|
|
3475
3453
|
baseApiUrl?: string;
|
|
3476
3454
|
timeoutMs?: number;
|
|
3477
3455
|
}): 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
3456
|
/**
|
|
3490
3457
|
* Upload a seller Gmail OAuth authorization code through curator.
|
|
3491
3458
|
*
|
|
@@ -3510,8 +3477,8 @@ declare class Zkp2pClient {
|
|
|
3510
3477
|
timeoutMs?: number;
|
|
3511
3478
|
}): Promise<CuratorSellerCredentialStatusResponse>;
|
|
3512
3479
|
/**
|
|
3513
|
-
* Internal-use endpoint. The curator route requires an internal `x-api-key`;
|
|
3514
|
-
* API keys will be rejected
|
|
3480
|
+
* Internal-use endpoint. The curator route requires an internal `x-api-key`; non-internal
|
|
3481
|
+
* API keys will be rejected. Returns 410 GONE when curator has marked the credential inactive
|
|
3515
3482
|
* or a stale credential fails its synchronous re-probe.
|
|
3516
3483
|
*
|
|
3517
3484
|
* Verify a seller payment via curator's seller-credential proxy.
|
|
@@ -3622,6 +3589,7 @@ declare class Zkp2pClient {
|
|
|
3622
3589
|
intentTimestampMs: string;
|
|
3623
3590
|
paymentMethodHash: `0x${string}`;
|
|
3624
3591
|
paymentVerifier?: `0x${string}`;
|
|
3592
|
+
minimumReleaseAmount?: string;
|
|
3625
3593
|
}>;
|
|
3626
3594
|
}
|
|
3627
3595
|
|
|
@@ -3682,4 +3650,4 @@ type SendBatchFn = (txs: Array<{
|
|
|
3682
3650
|
value?: bigint;
|
|
3683
3651
|
}>) => Promise<string>;
|
|
3684
3652
|
|
|
3685
|
-
export { type BestByPlatformResponseObject as $, type AttestationServiceIdentityResponse as A, type BuyerTeeSessionMaterialEncryptionInput as B, type CuratorSellerCredentialUploadResponse as C, type DepositWithRelations as D, type Zkp2pNextOptions as E, type FulfillIntentMethodParams as F, type GoogleOAuthSellerCredentialPlatform as G, type AuthorizationTokenProvider as H, type IntentEntity$1 as I, type TimeoutConfig as J, type ActionCallback as K, type CreateDepositParams as L, type CreateDepositConversionRate as M, type Range as N, type SignalIntentParams as O, type PostDepositDetailsRequest as P, type QuotesBestByPlatformRequest as Q, type ReferrerFeeConfig as R, type SellerCredentialBundle as S, type
|
|
3653
|
+
export { type BestByPlatformResponseObject as $, type AttestationServiceIdentityResponse as A, type BuyerTeeSessionMaterialEncryptionInput as B, type CuratorSellerCredentialUploadResponse as C, type DepositWithRelations as D, type Zkp2pNextOptions as E, type FulfillIntentMethodParams as F, type GoogleOAuthSellerCredentialPlatform as G, type AuthorizationTokenProvider as H, type IntentEntity$1 as I, type TimeoutConfig as J, type ActionCallback as K, type CreateDepositParams as L, type CreateDepositConversionRate as M, type Range as N, type SignalIntentParams as O, type PostDepositDetailsRequest as P, type QuotesBestByPlatformRequest as Q, type ReferrerFeeConfig as R, type SellerCredentialBundle as S, type TakerTierLevel as T, type UploadSellerCredentialBundleParams as U, type ValidatePayeeDetailsRequest as V, type WithdrawDepositParams as W, type FulfillIntentParams as X, type ReleaseFundsToPayerParams as Y, Zkp2pClient as Z, type CancelIntentParams as _, type IdentityAttestationRequestBody as a, type FulfillIntentAttestationResponse as a$, type GetBestByPlatformResponse as a0, type GetBestByPlatformResponseObject as a1, type GetPlatformQuote as a2, type PlatformQuote as a3, type QuoteRequest as a4, type GetNearbyQuote as a5, type GetNearbySuggestions as a6, type GetQuoteResponse as a7, type GetQuoteResponseObject as a8, type GetQuoteSingleResponse as a9, type VenmoSessionMaterial as aA, type CashAppSessionMaterial as aB, type WiseSessionMaterial as aC, type WiseProfileInfo as aD, type WiseProfileSelectionRequired as aE, type WiseProfileNotFound as aF, type PayPalGoogleOAuthSellerCredentialUploadBody as aG, type VenmoGoogleOAuthSellerCredentialUploadBody as aH, type VenmoCredentialUploadInput as aI, type CashAppCredentialUploadInput as aJ, type WiseCredentialUploadInput as aK, type SellerCredentialUploadInputByPlatform as aL, type SellerCiphertextBundle as aM, type SellerSignedCiphertextBundle as aN, type SellerVerifyIntentDetails as aO, type SellerVerifyInput as aP, type SellerProbeInput as aQ, type SellerCredentialBundleUpload as aR, type SellerCredentialStatusValue as aS, type SellerCredentialStatus as aT, type SellerVerifyProxyBody as aU, type SellerTypedDataField as aV, type SellerTypedDataSpec as aW, type SellerPaymentTypedDataValue as aX, type SellerAttestationOutput as aY, type SellerCredentialProbeResponse as aZ, type AttestationServiceSellerVerifyResponse as a_, type QuoteResponse as aa, type QuoteResponseObject as ab, type QuoteSingleResponse as ac, type QuoteIntentResponse as ad, type QuoteFeesResponse as ae, type FiatResponse as af, type TokenResponse as ag, type NearbyQuote as ah, type NearbySuggestions as ai, type ApiDeposit as aj, type DepositVerifier as ak, type DepositVerifierCurrency as al, type DepositStatus as am, type GetDepositByIdRequest as an, type GetDepositByIdResponse as ao, type Intent as ap, type ApiIntentStatus as aq, type GetOwnerIntentsRequest as ar, type GetOwnerIntentsResponse as as, type GetIntentsByDepositRequest as at, type GetIntentsByDepositResponse as au, type GetIntentByHashRequest as av, type GetIntentByHashResponse as aw, type RegisterPayeeDetailsRequest as ax, type RegisterPayeeDetailsResponse as ay, type SellerPlatform as az, type SellerCredentialUploadInput as b, type RateManagerOrderField as b$, type AttestationServiceSellerCredentialProbeResponse as b0, type BuyerTeePaymentParams as b1, type BuyerTeePaymentProofInput as b2, type BuyerTeeSessionMaterial as b3, type CuratorSellerCredentialStatusResponse as b4, type CuratorSellerVerifyResponse as b5, type RegisteredSellerCredentialPlatform as b6, type UploadSellerCredentialParams as b7, type RegisteredUploadSellerCredentialParams as b8, type UploadSellerCredentialOptions 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 GetSellerCredentialStatusParams as ba, type UploadPayPalGoogleOAuthSellerCredentialParams as bb, type UploadVenmoGoogleOAuthSellerCredentialParams as bc, type UploadGoogleOAuthSellerCredentialParams as bd, type VerifySellerPaymentParams as be, type IdentityAttestationActionType as bf, type IdentityAttestationOutput as bg, type IdentityAttestationOutputFor as bh, type IdentityAttestationParams as bi, type MakerIdentityAttestationRequestBody as bj, type MakerIdentityPlatform as bk, type OnchainCurrency as bl, type DepositVerifierData as bm, type PreparedTransaction as bn, type OrderStats as bo, type DepositIntentStatistics as bp, type TakerTier as bq, type TakerTierStats 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 TxOverrides as w, type SignalIntentReferralFee as x, type SignalIntentMethodParams as y, type CancelIntentMethodParams 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.4",
|
|
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",
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"@zkp2p/indexer-schema": "0.2.3",
|
|
91
|
-
"@zkp2p/contracts-v2": "0.2.
|
|
92
|
-
"@zkp2p/zkp2p-attestation": "1.
|
|
91
|
+
"@zkp2p/contracts-v2": "0.2.4",
|
|
92
|
+
"@zkp2p/zkp2p-attestation": "1.6.2",
|
|
93
93
|
"ethers": "^6.0.0",
|
|
94
94
|
"ox": "^0.11.1"
|
|
95
95
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/hooks/vaultUtils.ts"],"names":[],"mappings":"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","file":"chunk-LPJE2MN7.mjs","sourcesContent":["import type { Address, Hex } from 'viem';\nimport type { PreparedTransaction } from '../../types/prepared';\n\n// ---------------------------------------------------------------------------\n// Constants\n// ---------------------------------------------------------------------------\n\nexport const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' as const;\nexport const ZERO_RATE_MANAGER_ID =\n '0x0000000000000000000000000000000000000000000000000000000000000000' as const;\n\n// ---------------------------------------------------------------------------\n// Normalizers\n// ---------------------------------------------------------------------------\n\nexport const normalizeRateManagerId = (value?: string | null): string =>\n (value ?? ZERO_RATE_MANAGER_ID).toLowerCase();\n\nexport const normalizeRegistry = (value?: string | null): string =>\n (value ?? ZERO_ADDRESS).toLowerCase();\n\nexport const isZeroRateManagerId = (value?: string | null): boolean => {\n if (!value) return true;\n const normalized = value.toLowerCase();\n return normalized === ZERO_ADDRESS || normalized === ZERO_RATE_MANAGER_ID;\n};\n\n// ---------------------------------------------------------------------------\n// Error helper\n// ---------------------------------------------------------------------------\n\nexport const asErrorMessage = (error: unknown): string => {\n if (!error) return 'Unknown error';\n if (error instanceof Error) return error.message;\n if (typeof error === 'string') return error;\n\n const anyErr = error as Record<string, unknown>;\n if (typeof anyErr.shortMessage === 'string') return anyErr.shortMessage;\n if (typeof anyErr.details === 'string') return anyErr.details;\n if (typeof anyErr.message === 'string') return anyErr.message;\n\n try {\n return JSON.stringify(error);\n } catch {\n return String(error);\n }\n};\n\n// ---------------------------------------------------------------------------\n// Delegation state classification\n// ---------------------------------------------------------------------------\n\nexport type DelegationState = 'delegated_here' | 'delegated_elsewhere' | 'not_delegated';\n\n/**\n * Classify whether a deposit is delegated to the target vault, delegated\n * elsewhere, or not delegated at all.\n *\n * @param currentRateManagerId The deposit's current rateManagerId (from indexer)\n * @param currentRegistry The deposit's current rateManagerAddress / registry (from indexer)\n * @param targetRateManagerId The vault's rateManagerId we're comparing against\n * @param targetRegistry The vault's registry address we're comparing against\n */\nexport const classifyDelegationState = (\n currentRateManagerId: string | null | undefined,\n currentRegistry: string | null | undefined,\n targetRateManagerId: string,\n targetRegistry: string | null | undefined,\n): DelegationState => {\n if (isZeroRateManagerId(currentRateManagerId)) {\n return 'not_delegated';\n }\n\n const normalizedCurrent = normalizeRateManagerId(currentRateManagerId);\n const normalizedTarget = targetRateManagerId.toLowerCase();\n const normalizedCurrentRegistry = normalizeRegistry(currentRegistry);\n const normalizedTargetRegistry = targetRegistry ? targetRegistry.toLowerCase() : '';\n\n const idsMatch = normalizedCurrent === normalizedTarget;\n const registryMatches = normalizedTargetRegistry\n ? normalizedCurrentRegistry === normalizedTargetRegistry\n : true;\n\n if (idsMatch && registryMatches) {\n return 'delegated_here';\n }\n\n return 'delegated_elsewhere';\n};\n\nexport const assertAtomicDelegationSwitchSupport = (\n requiresSwitch: boolean,\n canBatch: boolean,\n): void => {\n if (!requiresSwitch || canBatch) return;\n throw new Error(\n 'Switching delegation targets requires smart-account batching. Clear the existing delegation first.',\n );\n};\n\n// ---------------------------------------------------------------------------\n// Contract routing\n// ---------------------------------------------------------------------------\n\nexport type DelegationRoute = 'v2';\n\nexport const getDelegationRoute = (_client: unknown, _escrow: Address): DelegationRoute => 'v2';\n\ntype DelegationMethodSupportClient = Partial<\n Record<'setRateManager' | 'clearRateManager', { prepare?: unknown }>\n>;\n\nexport const assertDelegationMethodSupport = (\n client: DelegationMethodSupportClient,\n _route: DelegationRoute,\n action: 'set' | 'clear',\n): void => {\n const method = action === 'set' ? 'setRateManager' : 'clearRateManager';\n if (client?.[method]?.prepare) return;\n throw new Error(`Delegation requires SDK ${method} support`);\n};\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\nexport interface DelegationDepositTarget {\n compositeDepositId: string;\n escrow: Address;\n depositId: bigint;\n currentRateManagerId?: string | null;\n currentRateManagerRegistry?: string | null;\n}\n\nexport interface BatchResult {\n hashes: string[];\n failed: Array<{ compositeDepositId: string; error: string }>;\n}\n\n/**\n * Callback the consumer provides for sending a single prepared transaction.\n * Returns the transaction hash.\n */\nexport type SendTransactionFn = (tx: { to: Address; data: Hex; value?: bigint }) => Promise<string>;\n\n/**\n * Optional callback for batching multiple calls in a single user operation\n * (e.g. via a smart account). If not provided, transactions are sent\n * sequentially via sendTransaction.\n */\nexport type SendBatchFn = (\n txs: Array<{ to: Address; data: Hex; value?: bigint }>,\n) => Promise<string>;\n\n// ---------------------------------------------------------------------------\n// Prepare helpers (used internally by hooks)\n// ---------------------------------------------------------------------------\n\nexport const prepareClearDelegationTx = async (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n client: any,\n params: { escrow: Address; depositId: bigint },\n referrer?: string | string[],\n): Promise<PreparedTransaction> => {\n const route = getDelegationRoute(client, params.escrow);\n assertDelegationMethodSupport(client, route, 'clear');\n return client.clearRateManager.prepare({\n escrowAddress: params.escrow,\n depositId: params.depositId,\n ...(referrer ? { txOverrides: { referrer } } : {}),\n });\n};\n\nexport const prepareSetDelegationTx = async (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n client: any,\n params: {\n escrow: Address;\n depositId: bigint;\n registry: Address;\n rateManagerId: Hex;\n },\n referrer?: string | string[],\n): Promise<PreparedTransaction> => {\n const route = getDelegationRoute(client, params.escrow);\n assertDelegationMethodSupport(client, route, 'set');\n return client.setRateManager.prepare({\n escrowAddress: params.escrow,\n depositId: params.depositId,\n rateManagerAddress: params.registry,\n rateManagerId: params.rateManagerId,\n ...(referrer ? { txOverrides: { referrer } } : {}),\n });\n};\n"]}
|