@zkp2p/sdk 0.14.2-rc.1 → 0.14.2-rc.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 +18 -11
- package/dist/build-metadata.json +2 -2
- package/dist/{chunk-DOZJKZTL.mjs → chunk-DPMEQLSY.mjs} +3 -3
- package/dist/{chunk-DOZJKZTL.mjs.map → chunk-DPMEQLSY.mjs.map} +1 -1
- package/dist/{chunk-PBNUROW5.mjs → chunk-EDYYWCCJ.mjs} +3 -3
- package/dist/{chunk-PBNUROW5.mjs.map → chunk-EDYYWCCJ.mjs.map} +1 -1
- package/dist/{currency-DFRG54XQ.mjs → currency-C5E6NVSR.mjs} +3 -3
- package/dist/{currency-DFRG54XQ.mjs.map → currency-C5E6NVSR.mjs.map} +1 -1
- package/dist/index.cjs +117 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.mjs +126 -44
- package/dist/index.mjs.map +1 -1
- package/dist/protocolViewerParsers-4BJOG6JG.mjs +5 -0
- package/dist/{protocolViewerParsers-WVXVSWCY.mjs.map → protocolViewerParsers-4BJOG6JG.mjs.map} +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.mjs +1 -1
- package/dist/{timeout-7LS5AHSS.mjs → timeout-QRO3IS4N.mjs} +3 -3
- package/dist/{timeout-7LS5AHSS.mjs.map → timeout-QRO3IS4N.mjs.map} +1 -1
- package/dist/{vaultUtils-Llr7Gh2R.d.mts → vaultUtils-D3J7IDTF.d.mts} +40 -10
- package/dist/{vaultUtils-Llr7Gh2R.d.ts → vaultUtils-D3J7IDTF.d.ts} +40 -10
- package/package.json +1 -1
- package/dist/protocolViewerParsers-WVXVSWCY.mjs +0 -5
|
@@ -5,8 +5,8 @@ var __export = (target, all) => {
|
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
// <define:__ZKP2P_SDK_BUILD_METADATA__>
|
|
8
|
-
var define_ZKP2P_SDK_BUILD_METADATA_default = { schemaVersion: 2, source: { repository: "zkp2p/zkp2p-clients", commitSha: "
|
|
8
|
+
var define_ZKP2P_SDK_BUILD_METADATA_default = { schemaVersion: 2, source: { repository: "zkp2p/zkp2p-clients", commitSha: "d6dc13e55393ed8758b7ba6e3d50d0a52b434011", kind: "github", distributable: true }, sdkPackageVersion: "0.14.2-rc.2", contractsPackageVersion: "0.4.2-rc.2", indexerSchemaPackageVersion: "0.22.0", activeDisputeStack: { base: { version: 2, selectionHash: "ba40c2954b408d0c658881a8d28e5bfcc9bade5cc3d953fd17eae1eca69d841c" }, baseStaging: { version: 2, selectionHash: "6c49c1ce51eec594a22385c4efcab08aa9926b6b63a725e14a0027ec5d2f4fc9" } } };
|
|
9
9
|
|
|
10
10
|
export { __export, define_ZKP2P_SDK_BUILD_METADATA_default };
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
12
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-EDYYWCCJ.mjs.map
|
|
12
|
+
//# sourceMappingURL=chunk-EDYYWCCJ.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["%3Cdefine:__ZKP2P_SDK_BUILD_METADATA__%3E"],"names":[],"mappings":";;;;;;;AAAA,IAAA,uCAAA,GAAA,EAAC,aAAA,EAAgB,CAAA,EAAE,MAAA,EAAS,EAAC,YAAa,qBAAA,EAAsB,SAAA,EAAY,0CAAA,EAA2C,IAAA,EAAO,UAAS,aAAA,EAAgB,IAAA,EAAI,EAAE,iBAAA,EAAoB,eAAc,uBAAA,EAA0B,YAAA,EAAa,2BAAA,EAA8B,QAAA,EAAS,oBAAqB,EAAC,IAAA,EAAO,EAAC,OAAA,EAAU,GAAE,aAAA,EAAgB,kEAAA,EAAkE,EAAE,WAAA,EAAc,EAAC,OAAA,EAAU,CAAA,EAAE,aAAA,EAAgB,kEAAA,IAAmE","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["%3Cdefine:__ZKP2P_SDK_BUILD_METADATA__%3E"],"names":[],"mappings":";;;;;;;AAAA,IAAA,uCAAA,GAAA,EAAC,aAAA,EAAgB,CAAA,EAAE,MAAA,EAAS,EAAC,YAAa,qBAAA,EAAsB,SAAA,EAAY,0CAAA,EAA2C,IAAA,EAAO,UAAS,aAAA,EAAgB,IAAA,EAAI,EAAE,iBAAA,EAAoB,eAAc,uBAAA,EAA0B,YAAA,EAAa,2BAAA,EAA8B,QAAA,EAAS,oBAAqB,EAAC,IAAA,EAAO,EAAC,OAAA,EAAU,GAAE,aAAA,EAAgB,kEAAA,EAAkE,EAAE,WAAA,EAAc,EAAC,OAAA,EAAU,CAAA,EAAE,aAAA,EAAgB,kEAAA,IAAmE","file":"chunk-EDYYWCCJ.mjs","sourcesContent":["{\"schemaVersion\":2,\"source\":{\"repository\":\"zkp2p/zkp2p-clients\",\"commitSha\":\"d6dc13e55393ed8758b7ba6e3d50d0a52b434011\",\"kind\":\"github\",\"distributable\":true},\"sdkPackageVersion\":\"0.14.2-rc.2\",\"contractsPackageVersion\":\"0.4.2-rc.2\",\"indexerSchemaPackageVersion\":\"0.22.0\",\"activeDisputeStack\":{\"base\":{\"version\":2,\"selectionHash\":\"ba40c2954b408d0c658881a8d28e5bfcc9bade5cc3d953fd17eae1eca69d841c\"},\"baseStaging\":{\"version\":2,\"selectionHash\":\"6c49c1ce51eec594a22385c4efcab08aa9926b6b63a725e14a0027ec5d2f4fc9\"}}}"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { Currency, currencyInfo, getCurrencyCodeFromHash, getCurrencyInfoFromCountryCode, getCurrencyInfoFromHash, isSupportedCurrencyHash, mapConversionRatesToOnchain, mapConversionRatesToOnchainMinRate } from './chunk-ZB22BZLZ.mjs';
|
|
2
|
-
import './chunk-
|
|
3
|
-
//# sourceMappingURL=currency-
|
|
4
|
-
//# sourceMappingURL=currency-
|
|
2
|
+
import './chunk-EDYYWCCJ.mjs';
|
|
3
|
+
//# sourceMappingURL=currency-C5E6NVSR.mjs.map
|
|
4
|
+
//# sourceMappingURL=currency-C5E6NVSR.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"currency-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"currency-C5E6NVSR.mjs"}
|
package/dist/index.cjs
CHANGED
|
@@ -21,7 +21,7 @@ var __export = (target, all) => {
|
|
|
21
21
|
var define_ZKP2P_SDK_BUILD_METADATA_default;
|
|
22
22
|
var init_define_ZKP2P_SDK_BUILD_METADATA = __esm({
|
|
23
23
|
"<define:__ZKP2P_SDK_BUILD_METADATA__>"() {
|
|
24
|
-
define_ZKP2P_SDK_BUILD_METADATA_default = { schemaVersion: 2, source: { repository: "zkp2p/zkp2p-clients", commitSha: "
|
|
24
|
+
define_ZKP2P_SDK_BUILD_METADATA_default = { schemaVersion: 2, source: { repository: "zkp2p/zkp2p-clients", commitSha: "d6dc13e55393ed8758b7ba6e3d50d0a52b434011", kind: "github", distributable: true }, sdkPackageVersion: "0.14.2-rc.2", contractsPackageVersion: "0.4.2-rc.2", indexerSchemaPackageVersion: "0.22.0", activeDisputeStack: { base: { version: 2, selectionHash: "ba40c2954b408d0c658881a8d28e5bfcc9bade5cc3d953fd17eae1eca69d841c" }, baseStaging: { version: 2, selectionHash: "6c49c1ce51eec594a22385c4efcab08aa9926b6b63a725e14a0027ec5d2f4fc9" } } };
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
|
|
@@ -99565,6 +99565,24 @@ async function createEncryptedSellerCredentialUploadForPlatform({
|
|
|
99565
99565
|
timeoutMs
|
|
99566
99566
|
}) {
|
|
99567
99567
|
try {
|
|
99568
|
+
if (platform === "upi") {
|
|
99569
|
+
const material = payload.sessionMaterial;
|
|
99570
|
+
if (!payload.callerAddress || !("userAgent" in material) || !("sessionCookie" in material) || "payeeId" in payload) {
|
|
99571
|
+
throw new Error(
|
|
99572
|
+
"Amazon Pay requires callerAddress, sessionCookie and userAgent without a claimed payeeId"
|
|
99573
|
+
);
|
|
99574
|
+
}
|
|
99575
|
+
return await zkp2pAttestation.createEncryptedSellerCredentialUpload({
|
|
99576
|
+
attestationServiceUrl,
|
|
99577
|
+
platform: "upi",
|
|
99578
|
+
callerAddress: payload.callerAddress,
|
|
99579
|
+
sessionMaterial: { sessionCookie: material.sessionCookie, userAgent: material.userAgent },
|
|
99580
|
+
...typeof timeoutMs === "number" ? { timeoutMs } : {},
|
|
99581
|
+
fetch: attestationTransport.fetch,
|
|
99582
|
+
...cryptoRuntime?.subtle ? { subtle: cryptoRuntime.subtle } : {},
|
|
99583
|
+
...cryptoRuntime?.getRandomValues ? { getRandomValues: cryptoRuntime.getRandomValues } : {}
|
|
99584
|
+
});
|
|
99585
|
+
}
|
|
99568
99586
|
if (platform === "wise") {
|
|
99569
99587
|
if (!isWiseCredentialUploadInput(payload)) {
|
|
99570
99588
|
throw new Error("apiToken is required for wise seller credential uploads");
|
|
@@ -102727,12 +102745,12 @@ var STAKE_LOCKS_QUERY = (
|
|
|
102727
102745
|
var STAKE_ACTIVITY_QUERY = (
|
|
102728
102746
|
/* GraphQL */
|
|
102729
102747
|
`
|
|
102730
|
-
query StakeActivityPage(
|
|
102731
|
-
|
|
102732
|
-
|
|
102733
|
-
|
|
102734
|
-
|
|
102735
|
-
) {
|
|
102748
|
+
query StakeActivityPage(
|
|
102749
|
+
$where: StakeActivity_bool_exp!
|
|
102750
|
+
$limit: Int!
|
|
102751
|
+
$orderBy: [StakeActivity_order_by!]!
|
|
102752
|
+
) {
|
|
102753
|
+
StakeActivity(where: $where, order_by: $orderBy, limit: $limit) {
|
|
102736
102754
|
id
|
|
102737
102755
|
chainId
|
|
102738
102756
|
vaultAddress
|
|
@@ -104035,22 +104053,26 @@ async function apiFetch({
|
|
|
104035
104053
|
headers: extraHeaders,
|
|
104036
104054
|
timeoutMs,
|
|
104037
104055
|
retryCount = 3,
|
|
104038
|
-
retryDelayMs = 1e3
|
|
104056
|
+
retryDelayMs = 1e3,
|
|
104057
|
+
signal
|
|
104039
104058
|
}) {
|
|
104040
104059
|
const endpoint = url.replace(/^[^/]*\/\/[^/]*/, "");
|
|
104041
104060
|
return withRetry(
|
|
104042
104061
|
async () => {
|
|
104062
|
+
if (signal?.aborted) throw new Error("API request cancelled.");
|
|
104043
104063
|
let res;
|
|
104044
104064
|
try {
|
|
104045
104065
|
const options = {
|
|
104046
104066
|
method,
|
|
104047
|
-
headers: createHeaders(apiKey, authorizationToken, extraHeaders)
|
|
104067
|
+
headers: createHeaders(apiKey, authorizationToken, extraHeaders),
|
|
104068
|
+
...signal ? { signal } : {}
|
|
104048
104069
|
};
|
|
104049
104070
|
if (body && method !== "GET") {
|
|
104050
104071
|
options.body = JSON.stringify(body);
|
|
104051
104072
|
}
|
|
104052
104073
|
res = await fetch(url, options);
|
|
104053
104074
|
} catch (error) {
|
|
104075
|
+
if (signal?.aborted) throw new Error("API request cancelled.");
|
|
104054
104076
|
throw new exports.NetworkError("Failed to connect to API server", { endpoint, error });
|
|
104055
104077
|
}
|
|
104056
104078
|
if (!res.ok) {
|
|
@@ -104468,7 +104490,7 @@ async function apiUploadSellerCredential(processorName, payeeDetails, bundle, ba
|
|
|
104468
104490
|
});
|
|
104469
104491
|
}
|
|
104470
104492
|
async function apiUploadGoogleOAuthSellerCredential(processorName, payeeDetails, body, baseApiUrl, opts) {
|
|
104471
|
-
if (processorName !== "paypal") {
|
|
104493
|
+
if (processorName !== "paypal" && processorName !== "venmo") {
|
|
104472
104494
|
throw new exports.ValidationError(
|
|
104473
104495
|
`Unsupported Google OAuth seller credential platform: ${String(processorName)}`,
|
|
104474
104496
|
"processorName"
|
|
@@ -104477,13 +104499,30 @@ async function apiUploadGoogleOAuthSellerCredential(processorName, payeeDetails,
|
|
|
104477
104499
|
const endpoint = `/v2/makers/${encodeURIComponent(processorName)}/${encodeURIComponent(
|
|
104478
104500
|
payeeDetails
|
|
104479
104501
|
)}/seller-credential/google-oauth`;
|
|
104480
|
-
|
|
104481
|
-
|
|
104482
|
-
|
|
104483
|
-
|
|
104484
|
-
|
|
104485
|
-
|
|
104486
|
-
|
|
104502
|
+
if (opts?.signal?.aborted) throw new Error("Google OAuth upload cancelled.");
|
|
104503
|
+
const controller = new AbortController();
|
|
104504
|
+
const abort = () => controller.abort();
|
|
104505
|
+
opts?.signal?.addEventListener("abort", abort, { once: true });
|
|
104506
|
+
let timedOut = false;
|
|
104507
|
+
const timeout = opts?.timeoutMs ? setTimeout(() => {
|
|
104508
|
+
timedOut = true;
|
|
104509
|
+
controller.abort();
|
|
104510
|
+
}, opts.timeoutMs) : void 0;
|
|
104511
|
+
try {
|
|
104512
|
+
return await apiFetch({
|
|
104513
|
+
url: `${withApiBase(baseApiUrl)}${endpoint}`,
|
|
104514
|
+
method: "POST",
|
|
104515
|
+
body,
|
|
104516
|
+
authorizationToken: opts?.authorizationToken,
|
|
104517
|
+
signal: controller.signal
|
|
104518
|
+
});
|
|
104519
|
+
} catch (error) {
|
|
104520
|
+
if (timedOut) throw new Error("Google OAuth upload timed out.");
|
|
104521
|
+
throw error;
|
|
104522
|
+
} finally {
|
|
104523
|
+
opts?.signal?.removeEventListener("abort", abort);
|
|
104524
|
+
if (timeout !== void 0) clearTimeout(timeout);
|
|
104525
|
+
}
|
|
104487
104526
|
}
|
|
104488
104527
|
async function apiGetSellerCredentialStatus(processorName, payeeDetails, baseApiUrl, timeoutMs) {
|
|
104489
104528
|
const endpoint = `/v2/makers/${encodeURIComponent(processorName)}/${encodeURIComponent(
|
|
@@ -106347,21 +106386,22 @@ function compareEventCursor(left, right) {
|
|
|
106347
106386
|
if (leftLog !== rightLog) return leftLog < rightLog ? -1 : 1;
|
|
106348
106387
|
return left.id === right.id ? 0 : left.id < right.id ? -1 : 1;
|
|
106349
106388
|
}
|
|
106350
|
-
function eventKeysetPredicate(cursor, blockField, logField) {
|
|
106389
|
+
function eventKeysetPredicate(cursor, blockField, logField, direction = "asc") {
|
|
106390
|
+
const operator = direction === "desc" ? "_lt" : "_gt";
|
|
106351
106391
|
return {
|
|
106352
106392
|
_or: [
|
|
106353
|
-
{ [blockField]: {
|
|
106393
|
+
{ [blockField]: { [operator]: cursor.blockNumber } },
|
|
106354
106394
|
{
|
|
106355
106395
|
_and: [
|
|
106356
106396
|
{ [blockField]: { _eq: cursor.blockNumber } },
|
|
106357
|
-
{ [logField]: {
|
|
106397
|
+
{ [logField]: { [operator]: cursor.logIndex } }
|
|
106358
106398
|
]
|
|
106359
106399
|
},
|
|
106360
106400
|
{
|
|
106361
106401
|
_and: [
|
|
106362
106402
|
{ [blockField]: { _eq: cursor.blockNumber } },
|
|
106363
106403
|
{ [logField]: { _eq: cursor.logIndex } },
|
|
106364
|
-
{ id: {
|
|
106404
|
+
{ id: { [operator]: cursor.id } }
|
|
106365
106405
|
]
|
|
106366
106406
|
}
|
|
106367
106407
|
]
|
|
@@ -106721,7 +106761,12 @@ var IndexerStakingService = class {
|
|
|
106721
106761
|
const vaultAddress = normalizeAddress4(params.vaultAddress, "vaultAddress");
|
|
106722
106762
|
const merchant = normalizeAddress4(params.merchant, "merchant");
|
|
106723
106763
|
const kind = params.kind ? normalizeActivityKind(params.kind, "kind") : void 0;
|
|
106724
|
-
const
|
|
106764
|
+
const direction = params.orderDirection ?? "asc";
|
|
106765
|
+
if (direction !== "asc" && direction !== "desc") {
|
|
106766
|
+
throw new exports.ValidationError("orderDirection must be asc or desc", "orderDirection");
|
|
106767
|
+
}
|
|
106768
|
+
const cursorKind = direction === "desc" ? "zkp2p-activity-desc-v1" : "zkp2p-activity-v1";
|
|
106769
|
+
const after = params.cursor ? decodeEventCursor(params.cursor, cursorKind) : void 0;
|
|
106725
106770
|
const filters = [
|
|
106726
106771
|
{ chainId: { _eq: params.chainId } },
|
|
106727
106772
|
{ vaultAddress: { _eq: vaultAddress } },
|
|
@@ -106730,11 +106775,15 @@ var IndexerStakingService = class {
|
|
|
106730
106775
|
}
|
|
106731
106776
|
];
|
|
106732
106777
|
if (kind) filters.push({ kind: { _eq: kind } });
|
|
106733
|
-
if (after) filters.push(eventKeysetPredicate(after, "blockNumber", "logIndex"));
|
|
106778
|
+
if (after) filters.push(eventKeysetPredicate(after, "blockNumber", "logIndex", direction));
|
|
106734
106779
|
const data144 = await this.client.query(
|
|
106735
106780
|
{
|
|
106736
106781
|
query: STAKE_ACTIVITY_QUERY,
|
|
106737
|
-
variables: {
|
|
106782
|
+
variables: {
|
|
106783
|
+
limit: limit + 1,
|
|
106784
|
+
where: { _and: filters },
|
|
106785
|
+
orderBy: [{ blockNumber: direction }, { logIndex: direction }, { id: direction }]
|
|
106786
|
+
}
|
|
106738
106787
|
},
|
|
106739
106788
|
init
|
|
106740
106789
|
);
|
|
@@ -106746,7 +106795,7 @@ var IndexerStakingService = class {
|
|
|
106746
106795
|
merchant,
|
|
106747
106796
|
kind
|
|
106748
106797
|
});
|
|
106749
|
-
if (previous && compareEventCursor(result.cursor, previous) <= 0) {
|
|
106798
|
+
if (previous && compareEventCursor(result.cursor, previous) * (direction === "desc" ? -1 : 1) <= 0) {
|
|
106750
106799
|
throw new Error("StakeActivity cursor did not advance");
|
|
106751
106800
|
}
|
|
106752
106801
|
previous = result.cursor;
|
|
@@ -106754,10 +106803,11 @@ var IndexerStakingService = class {
|
|
|
106754
106803
|
});
|
|
106755
106804
|
const visible = normalized.slice(0, limit);
|
|
106756
106805
|
const last = visible[visible.length - 1];
|
|
106806
|
+
const latest = direction === "desc" ? visible[0] : last;
|
|
106757
106807
|
return {
|
|
106758
106808
|
items: visible.map(({ item }) => item),
|
|
106759
|
-
nextCursor: normalized.length > limit && last ? encodeCursor(
|
|
106760
|
-
asOf:
|
|
106809
|
+
nextCursor: normalized.length > limit && last ? encodeCursor(cursorKind, last.cursor) : null,
|
|
106810
|
+
asOf: latest ? { blockNumber: latest.item.blockNumber, timestamp: latest.item.timestamp } : null
|
|
106761
106811
|
};
|
|
106762
106812
|
}
|
|
106763
106813
|
async fetchDisputeProtectionIntents(params, init) {
|
|
@@ -108068,6 +108118,13 @@ async function apiUploadSellerCredentialBundle(params, baseApiUrl, timeoutMs, au
|
|
|
108068
108118
|
authorizationToken
|
|
108069
108119
|
);
|
|
108070
108120
|
}
|
|
108121
|
+
function getAmazonPaySellerIdentity(bundle) {
|
|
108122
|
+
const attestation = bundle.identityAttestation;
|
|
108123
|
+
if (bundle.platform !== "upi" || attestation?.platform !== "upi" || attestation.actionType !== "register_upi_amazonpay" || attestation.identity.platform !== "upi" || attestation.identity.actionType !== "register_upi_amazonpay" || !attestation.identity.payeeId?.trim()) {
|
|
108124
|
+
throw new Error("Amazon Pay credential bundle is missing its receiving UPI identity");
|
|
108125
|
+
}
|
|
108126
|
+
return attestation.identity.payeeId;
|
|
108127
|
+
}
|
|
108071
108128
|
|
|
108072
108129
|
// src/client/Zkp2pClient.ts
|
|
108073
108130
|
init_contracts2();
|
|
@@ -111090,6 +111147,9 @@ var Zkp2pClient = class {
|
|
|
111090
111147
|
* from the submitted Personal API Token.
|
|
111091
111148
|
*/
|
|
111092
111149
|
async uploadSellerCredential(params, opts) {
|
|
111150
|
+
if (!["cashapp", "wise", "upi"].includes(params.platform)) {
|
|
111151
|
+
throw new Error("Use uploadGoogleOAuthSellerCredential to connect Venmo or PayPal Gmail.");
|
|
111152
|
+
}
|
|
111093
111153
|
const baseApiUrl = this.stripTrailingSlash(
|
|
111094
111154
|
opts?.baseApiUrl ?? this.baseApiUrl ?? DEFAULT_BASE_API_URL
|
|
111095
111155
|
);
|
|
@@ -111105,6 +111165,23 @@ var Zkp2pClient = class {
|
|
|
111105
111165
|
opts?.attestationRuntime,
|
|
111106
111166
|
opts?.attestationServiceFallbackUrls ? { fallbackUrls: opts.attestationServiceFallbackUrls } : void 0
|
|
111107
111167
|
);
|
|
111168
|
+
if (params.platform === "upi") {
|
|
111169
|
+
const bundleResponse2 = await createBundle({
|
|
111170
|
+
callerAddress: params.callerAddress,
|
|
111171
|
+
sessionMaterial: params.sessionMaterial
|
|
111172
|
+
});
|
|
111173
|
+
if (!bundleResponse2.success || !bundleResponse2.responseObject) {
|
|
111174
|
+
throw new Error(bundleResponse2.message || "Failed to create seller credential bundle");
|
|
111175
|
+
}
|
|
111176
|
+
return this.uploadSellerCredentialBundle(
|
|
111177
|
+
{
|
|
111178
|
+
bundle: bundleResponse2.responseObject,
|
|
111179
|
+
offchainId: getAmazonPaySellerIdentity(bundleResponse2.responseObject),
|
|
111180
|
+
platform: "upi"
|
|
111181
|
+
},
|
|
111182
|
+
{ baseApiUrl, timeoutMs }
|
|
111183
|
+
);
|
|
111184
|
+
}
|
|
111108
111185
|
if (params.platform === "wise") {
|
|
111109
111186
|
const bundleResponse2 = await createBundle({
|
|
111110
111187
|
...params.callerAddress ? { callerAddress: params.callerAddress } : {},
|
|
@@ -111159,8 +111236,9 @@ var Zkp2pClient = class {
|
|
|
111159
111236
|
* callers send the one-time Google code plus the stable seller identity.
|
|
111160
111237
|
*/
|
|
111161
111238
|
async uploadGoogleOAuthSellerCredential(params, opts) {
|
|
111239
|
+
if (opts?.signal?.aborted) throw new Error("Google OAuth upload cancelled.");
|
|
111162
111240
|
const platform = params.platform;
|
|
111163
|
-
if (platform !== "paypal") {
|
|
111241
|
+
if (platform !== "paypal" && platform !== "venmo") {
|
|
111164
111242
|
throw new exports.ValidationError(
|
|
111165
111243
|
`Unsupported Google OAuth seller credential platform: ${String(platform)}`,
|
|
111166
111244
|
"platform"
|
|
@@ -111179,17 +111257,18 @@ var Zkp2pClient = class {
|
|
|
111179
111257
|
}
|
|
111180
111258
|
return {
|
|
111181
111259
|
timeoutMs,
|
|
111260
|
+
...opts?.signal ? { signal: opts.signal } : {},
|
|
111182
111261
|
...authorizationToken ? { authorizationToken } : {}
|
|
111183
111262
|
};
|
|
111184
111263
|
};
|
|
111264
|
+
const body = {
|
|
111265
|
+
authorizationCode: params.authorizationCode,
|
|
111266
|
+
redirectUri: params.redirectUri
|
|
111267
|
+
};
|
|
111185
111268
|
return apiUploadGoogleOAuthSellerCredential(
|
|
111186
|
-
|
|
111269
|
+
params.platform,
|
|
111187
111270
|
params.payeeDetails,
|
|
111188
|
-
{
|
|
111189
|
-
payeeEmail: params.payeeEmail,
|
|
111190
|
-
authorizationCode: params.authorizationCode,
|
|
111191
|
-
redirectUri: params.redirectUri
|
|
111192
|
-
},
|
|
111271
|
+
params.platform === "paypal" ? { ...body, payeeEmail: params.payeeEmail } : body,
|
|
111193
111272
|
baseApiUrl,
|
|
111194
111273
|
await getUploadOptions()
|
|
111195
111274
|
);
|
|
@@ -111409,6 +111488,9 @@ var getPeerExtensionState = async (options) => {
|
|
|
111409
111488
|
}
|
|
111410
111489
|
};
|
|
111411
111490
|
var sanitizePeerAuthenticateParams = (params) => {
|
|
111491
|
+
if (params.captureMode === "sellerCredential" && params.platform !== "cashapp" && params.platform !== "upi") {
|
|
111492
|
+
throw new Error(`Seller credential capture is not supported for ${params.platform}.`);
|
|
111493
|
+
}
|
|
111412
111494
|
const sanitizedParams = { ...params };
|
|
111413
111495
|
delete sanitizedParams.providerConfig;
|
|
111414
111496
|
return sanitizedParams;
|
|
@@ -111568,6 +111650,7 @@ exports.enrichPvDepositView = enrichPvDepositView;
|
|
|
111568
111650
|
exports.enrichPvIntentView = enrichPvIntentView;
|
|
111569
111651
|
exports.ensureBytes32 = ensureBytes32;
|
|
111570
111652
|
exports.fetchIndexerFulfillmentAndPayment = fetchFulfillmentAndPayment;
|
|
111653
|
+
exports.getAmazonPaySellerIdentity = getAmazonPaySellerIdentity;
|
|
111571
111654
|
exports.getAttributionDataSuffix = getAttributionDataSuffix;
|
|
111572
111655
|
exports.getContracts = getContracts;
|
|
111573
111656
|
exports.getCurrencyCodeFromHash = getCurrencyCodeFromHash;
|