@zkp2p/sdk 0.4.1 → 0.4.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/dist/index.cjs +68 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +8 -3
- package/dist/index.d.ts +8 -3
- package/dist/index.mjs +68 -4
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/{vaultUtils-Dt7ZOITQ.d.mts → vaultUtils-Bi2uldoa.d.mts} +42 -1
- package/dist/{vaultUtils-Dt7ZOITQ.d.ts → vaultUtils-Bi2uldoa.d.ts} +42 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -43301,8 +43301,8 @@ var IntentOperations = class {
|
|
|
43301
43301
|
intent
|
|
43302
43302
|
},
|
|
43303
43303
|
attestationServiceUrl,
|
|
43304
|
-
platformConfig.actionPlatform,
|
|
43305
|
-
platformConfig.actionType
|
|
43304
|
+
buyerTeeProof.actionPlatform ?? platformConfig.actionPlatform,
|
|
43305
|
+
buyerTeeProof.actionType ?? platformConfig.actionType
|
|
43306
43306
|
) : await apiCreatePaymentAttestation(
|
|
43307
43307
|
{
|
|
43308
43308
|
proofType: "reclaim",
|
|
@@ -43442,11 +43442,18 @@ function parseBuyerTeePaymentProofInput(proof) {
|
|
|
43442
43442
|
if (typeof proof.encryptedSessionMaterial !== "string" || !isBuyerTeeParams(proof.params)) {
|
|
43443
43443
|
throw new Error("Buyer TEE proof requires encryptedSessionMaterial and params.");
|
|
43444
43444
|
}
|
|
43445
|
-
|
|
43445
|
+
const parsed = {
|
|
43446
43446
|
proofType: "buyerTee",
|
|
43447
43447
|
encryptedSessionMaterial: proof.encryptedSessionMaterial,
|
|
43448
43448
|
params: proof.params
|
|
43449
43449
|
};
|
|
43450
|
+
if (typeof proof.actionType === "string") {
|
|
43451
|
+
parsed.actionType = proof.actionType;
|
|
43452
|
+
}
|
|
43453
|
+
if (typeof proof.actionPlatform === "string") {
|
|
43454
|
+
parsed.actionPlatform = proof.actionPlatform;
|
|
43455
|
+
}
|
|
43456
|
+
return parsed;
|
|
43450
43457
|
}
|
|
43451
43458
|
function normalizeSignalIntentReferralFees(params) {
|
|
43452
43459
|
if (params.referralFees) {
|
|
@@ -47238,6 +47245,19 @@ async function apiConfirmPayPalForwarding(payeeDetails, body, baseApiUrl, opts)
|
|
|
47238
47245
|
timeoutMs: opts?.timeoutMs
|
|
47239
47246
|
});
|
|
47240
47247
|
}
|
|
47248
|
+
async function apiUploadGoogleOAuthSellerCredential(processorName, payeeDetails, body, baseApiUrl, opts) {
|
|
47249
|
+
const endpoint = `/v2/makers/${encodeURIComponent(processorName)}/${encodeURIComponent(
|
|
47250
|
+
payeeDetails
|
|
47251
|
+
)}/seller-credential/google-oauth`;
|
|
47252
|
+
return apiFetch({
|
|
47253
|
+
url: `${withApiBase(baseApiUrl)}${endpoint}`,
|
|
47254
|
+
method: "POST",
|
|
47255
|
+
body,
|
|
47256
|
+
apiKey: opts?.apiKey,
|
|
47257
|
+
authToken: opts?.authToken,
|
|
47258
|
+
timeoutMs: opts?.timeoutMs
|
|
47259
|
+
});
|
|
47260
|
+
}
|
|
47241
47261
|
async function apiGetSellerCredentialStatus(processorName, payeeDetails, baseApiUrl, timeoutMs) {
|
|
47242
47262
|
const endpoint = `/v2/makers/${encodeURIComponent(processorName)}/${encodeURIComponent(
|
|
47243
47263
|
payeeDetails
|
|
@@ -49976,6 +49996,50 @@ var Zkp2pClient = class {
|
|
|
49976
49996
|
}
|
|
49977
49997
|
);
|
|
49978
49998
|
}
|
|
49999
|
+
/**
|
|
50000
|
+
* Upload a seller Gmail OAuth authorization code through curator.
|
|
50001
|
+
*
|
|
50002
|
+
* Curator owns the encryption hop to attestation-service for this flow, so
|
|
50003
|
+
* callers send the one-time Google code plus the stable seller identity.
|
|
50004
|
+
*/
|
|
50005
|
+
async uploadGoogleOAuthSellerCredential(params, opts) {
|
|
50006
|
+
const baseApiUrl = this.stripTrailingSlash(
|
|
50007
|
+
opts?.baseApiUrl ?? this.baseApiUrl ?? DEFAULT_BASE_API_URL
|
|
50008
|
+
);
|
|
50009
|
+
const timeoutMs = opts?.timeoutMs ?? this.apiTimeoutMs;
|
|
50010
|
+
if (params.platform === "paypal") {
|
|
50011
|
+
return apiUploadGoogleOAuthSellerCredential(
|
|
50012
|
+
"paypal",
|
|
50013
|
+
params.payeeDetails,
|
|
50014
|
+
{
|
|
50015
|
+
payeeEmail: params.payeeEmail,
|
|
50016
|
+
authorizationCode: params.authorizationCode,
|
|
50017
|
+
redirectUri: params.redirectUri
|
|
50018
|
+
},
|
|
50019
|
+
baseApiUrl,
|
|
50020
|
+
{
|
|
50021
|
+
apiKey: this.apiKey,
|
|
50022
|
+
authToken: this.authorizationToken,
|
|
50023
|
+
timeoutMs
|
|
50024
|
+
}
|
|
50025
|
+
);
|
|
50026
|
+
}
|
|
50027
|
+
return apiUploadGoogleOAuthSellerCredential(
|
|
50028
|
+
"venmo",
|
|
50029
|
+
params.payeeDetails,
|
|
50030
|
+
{
|
|
50031
|
+
accountId: params.accountId,
|
|
50032
|
+
authorizationCode: params.authorizationCode,
|
|
50033
|
+
redirectUri: params.redirectUri
|
|
50034
|
+
},
|
|
50035
|
+
baseApiUrl,
|
|
50036
|
+
{
|
|
50037
|
+
apiKey: this.apiKey,
|
|
50038
|
+
authToken: this.authorizationToken,
|
|
50039
|
+
timeoutMs
|
|
50040
|
+
}
|
|
50041
|
+
);
|
|
50042
|
+
}
|
|
49979
50043
|
/**
|
|
49980
50044
|
* Status is a coarse curator-owned signal (`active` / `inactive` / `missing`) and intentionally
|
|
49981
50045
|
* omits low-level diagnostics. Curator may still re-probe stale credentials during verify, so callers
|
|
@@ -50497,6 +50561,7 @@ exports.apiGetPayeeDetails = apiGetPayeeDetails;
|
|
|
50497
50561
|
exports.apiGetQuotesBestByPlatform = apiGetQuotesBestByPlatform;
|
|
50498
50562
|
exports.apiGetTakerTier = apiGetTakerTier;
|
|
50499
50563
|
exports.apiPostDepositDetails = apiPostDepositDetails;
|
|
50564
|
+
exports.apiUploadGoogleOAuthSellerCredential = apiUploadGoogleOAuthSellerCredential;
|
|
50500
50565
|
exports.apiValidatePayeeDetails = apiValidatePayeeDetails;
|
|
50501
50566
|
exports.appendAttributionToCalldata = appendAttributionToCalldata;
|
|
50502
50567
|
exports.asciiToBytes32 = asciiToBytes32;
|