@unifold/core 0.1.81 → 0.1.83
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.d.mts +630 -20
- package/dist/index.d.ts +630 -20
- package/dist/index.js +366 -4
- package/dist/index.mjs +340 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -23,6 +23,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
23
23
|
var index_exports = {};
|
|
24
24
|
__export(index_exports, {
|
|
25
25
|
ActionType: () => ActionType,
|
|
26
|
+
BankTransferCapabilityStatus: () => BankTransferCapabilityStatus,
|
|
27
|
+
BankTransferSessionStatus: () => BankTransferSessionStatus,
|
|
26
28
|
CheckoutEventType: () => CheckoutEventType,
|
|
27
29
|
DETECTION_ARM_DELAY_MS: () => DETECTION_ARM_DELAY_MS,
|
|
28
30
|
DETECTION_POLL_INTERVAL_MS: () => DETECTION_POLL_INTERVAL_MS,
|
|
@@ -36,6 +38,7 @@ __export(index_exports, {
|
|
|
36
38
|
IneligibilityReason: () => IneligibilityReason,
|
|
37
39
|
IntegrationProvider: () => IntegrationProvider,
|
|
38
40
|
IntegrationTransferError: () => IntegrationTransferError,
|
|
41
|
+
InteracApiResponseError: () => InteracApiResponseError,
|
|
39
42
|
LOOKBACK_MS: () => LOOKBACK_MS,
|
|
40
43
|
OnrampSession: () => OnrampSession,
|
|
41
44
|
OnrampSessionEventType: () => OnrampSessionEventType,
|
|
@@ -46,19 +49,27 @@ __export(index_exports, {
|
|
|
46
49
|
StripeApiResponseError: () => StripeApiResponseError,
|
|
47
50
|
UnifoldClient: () => UnifoldClient,
|
|
48
51
|
WithdrawEventType: () => WithdrawEventType,
|
|
52
|
+
acceptOnrampTos: () => acceptOnrampTos,
|
|
49
53
|
authenticateIntegrationOAuth: () => authenticateIntegrationOAuth,
|
|
50
54
|
buildHypercoreTransaction: () => buildHypercoreTransaction,
|
|
51
55
|
buildSolanaTransaction: () => buildSolanaTransaction,
|
|
56
|
+
cancelInteracSession: () => cancelInteracSession,
|
|
52
57
|
checkHypercoreActivation: () => checkHypercoreActivation,
|
|
53
58
|
confirmIntegrationTransfer: () => confirmIntegrationTransfer,
|
|
59
|
+
createBankTransferCapability: () => createBankTransferCapability,
|
|
60
|
+
createBankTransferSession: () => createBankTransferSession,
|
|
61
|
+
createBankTransferVirtualAccount: () => createBankTransferVirtualAccount,
|
|
54
62
|
createCashAppSession: () => createCashAppSession,
|
|
55
63
|
createCoinbaseApplePaySession: () => createCoinbaseApplePaySession,
|
|
56
64
|
createCoinbaseGooglePaySession: () => createCoinbaseGooglePaySession,
|
|
57
65
|
createCoinbaseWalletPaySession: () => createCoinbaseWalletPaySession,
|
|
58
66
|
createDepositAddress: () => createDepositAddress,
|
|
59
67
|
createExchangeSession: () => createExchangeSession,
|
|
68
|
+
createIdentityVerificationSession: () => createIdentityVerificationSession,
|
|
60
69
|
createIntegrationExchangeSession: () => createIntegrationExchangeSession,
|
|
61
70
|
createIntegrationTransfer: () => createIntegrationTransfer,
|
|
71
|
+
createInteracSession: () => createInteracSession,
|
|
72
|
+
createInteracUser: () => createInteracUser,
|
|
62
73
|
createOnrampSession: () => createOnrampSession,
|
|
63
74
|
createOnrampVerificationSession: () => createOnrampVerificationSession,
|
|
64
75
|
createUnifoldClient: () => createUnifoldClient,
|
|
@@ -72,6 +83,8 @@ __export(index_exports, {
|
|
|
72
83
|
getApplePayLimitUpgradeStatus: () => getApplePayLimitUpgradeStatus,
|
|
73
84
|
getApplePayProviders: () => getApplePayProviders,
|
|
74
85
|
getBankTransferProviders: () => getBankTransferProviders,
|
|
86
|
+
getBankTransferSession: () => getBankTransferSession,
|
|
87
|
+
getBankTransferVirtualAccount: () => getBankTransferVirtualAccount,
|
|
75
88
|
getCashAppLimits: () => getCashAppLimits,
|
|
76
89
|
getCashAppSessionStatus: () => getCashAppSessionStatus,
|
|
77
90
|
getChainName: () => getChainName,
|
|
@@ -94,10 +107,16 @@ __export(index_exports, {
|
|
|
94
107
|
getIntegrationExchanges: () => getIntegrationExchanges,
|
|
95
108
|
getIntegrationHoldings: () => getIntegrationHoldings,
|
|
96
109
|
getIntegrationTransferDefaultToken: () => getIntegrationTransferDefaultToken,
|
|
110
|
+
getInteracKycUrl: () => getInteracKycUrl,
|
|
111
|
+
getInteracLimits: () => getInteracLimits,
|
|
112
|
+
getInteracQuote: () => getInteracQuote,
|
|
113
|
+
getInteracSession: () => getInteracSession,
|
|
114
|
+
getInteracStatus: () => getInteracStatus,
|
|
97
115
|
getIpAddress: () => getIpAddress,
|
|
98
116
|
getOnrampQuotes: () => getOnrampQuotes,
|
|
99
117
|
getOnrampSessionStartUrl: () => getOnrampSessionStartUrl,
|
|
100
118
|
getOnrampSessionStatus: () => getOnrampSessionStatus,
|
|
119
|
+
getOnrampTos: () => getOnrampTos,
|
|
101
120
|
getOnrampVerificationSession: () => getOnrampVerificationSession,
|
|
102
121
|
getPreferredIconUrl: () => getPreferredIconUrl,
|
|
103
122
|
getProjectConfig: () => getProjectConfig,
|
|
@@ -121,18 +140,22 @@ __export(index_exports, {
|
|
|
121
140
|
mapDirectExecution: () => mapDirectExecution,
|
|
122
141
|
mapOnrampQuote: () => mapOnrampQuote,
|
|
123
142
|
mapWalletToDepositAddress: () => mapWalletToDepositAddress,
|
|
143
|
+
patchIdentityInformation: () => patchIdentityInformation,
|
|
124
144
|
pollDirectExecutions: () => pollDirectExecutions,
|
|
125
145
|
queryExecutions: () => queryExecutions,
|
|
126
146
|
refreshIntegrationToken: () => refreshIntegrationToken,
|
|
127
147
|
requestCoinbaseApplePayLimitUpgrade: () => requestCoinbaseApplePayLimitUpgrade,
|
|
128
148
|
requestCoinbaseWalletPayLimitUpgrade: () => requestCoinbaseWalletPayLimitUpgrade,
|
|
149
|
+
requestInteracOtp: () => requestInteracOtp,
|
|
129
150
|
retrievePaymentIntent: () => retrievePaymentIntent,
|
|
130
151
|
revokeIntegrationToken: () => revokeIntegrationToken,
|
|
131
152
|
sendHypercoreTransaction: () => sendHypercoreTransaction,
|
|
153
|
+
sendInteracPhoneVerification: () => sendInteracPhoneVerification,
|
|
132
154
|
sendOnrampVerificationOtp: () => sendOnrampVerificationOtp,
|
|
133
155
|
sendSolanaTransaction: () => sendSolanaTransaction,
|
|
134
156
|
setApiConfig: () => setApiConfig,
|
|
135
157
|
startIntegrationOAuth: () => startIntegrationOAuth,
|
|
158
|
+
startInterac: () => startInterac,
|
|
136
159
|
stripeConfirmSession: () => stripeConfirmSession,
|
|
137
160
|
stripeCreateAuthIntent: () => stripeCreateAuthIntent,
|
|
138
161
|
stripeCreateSession: () => stripeCreateSession,
|
|
@@ -147,7 +170,10 @@ __export(index_exports, {
|
|
|
147
170
|
stripeListWallets: () => stripeListWallets,
|
|
148
171
|
stripeRefreshQuote: () => stripeRefreshQuote,
|
|
149
172
|
stripeRefreshToken: () => stripeRefreshToken,
|
|
173
|
+
updateInteracUser: () => updateInteracUser,
|
|
150
174
|
useUserIp: () => useUserIp,
|
|
175
|
+
verifyInteracOtp: () => verifyInteracOtp,
|
|
176
|
+
verifyInteracPhone: () => verifyInteracPhone,
|
|
151
177
|
verifyOnrampVerificationOtp: () => verifyOnrampVerificationOtp,
|
|
152
178
|
verifyRecipientAddress: () => verifyRecipientAddress
|
|
153
179
|
});
|
|
@@ -192,7 +218,7 @@ function generatePrefixedKSUID(prefix) {
|
|
|
192
218
|
}
|
|
193
219
|
|
|
194
220
|
// src/lib/client-headers.ts
|
|
195
|
-
var SDK_VERSION = true ? "0.1.
|
|
221
|
+
var SDK_VERSION = true ? "0.1.83" : "0.0.0-dev";
|
|
196
222
|
var CLIENT_VERSION_HEADER = "x-unifold-client-version";
|
|
197
223
|
var CLIENT_USER_AGENT_HEADER = "x-unifold-client-user-agent";
|
|
198
224
|
function detectRuntime() {
|
|
@@ -355,6 +381,11 @@ async function createDepositAddress(overrides, publishableKey) {
|
|
|
355
381
|
const firstError = Array.isArray(body.details?.errors) ? body.details?.errors[0] : void 0;
|
|
356
382
|
throw new DepositAddressValidationError(firstError ?? "Invalid recipient address");
|
|
357
383
|
}
|
|
384
|
+
if (body?.error_type === "xrpl_destination_tag_required") {
|
|
385
|
+
throw new DepositAddressValidationError(
|
|
386
|
+
body.message ?? "Recipient address requires a destination tag"
|
|
387
|
+
);
|
|
388
|
+
}
|
|
358
389
|
}
|
|
359
390
|
throw new Error(`Failed to create EOA: ${response.statusText}`);
|
|
360
391
|
}
|
|
@@ -620,11 +651,13 @@ async function getBankTransferProviders(publishableKey, options = {}) {
|
|
|
620
651
|
}
|
|
621
652
|
const queryString = params.toString();
|
|
622
653
|
const url = `${API_BASE_URL}/v1/public/onramps/bank_transfer/providers${queryString ? `?${queryString}` : ""}`;
|
|
654
|
+
const LATEST_API_VERSION = "2026-08-15";
|
|
623
655
|
const response = await apiFetch(url, {
|
|
624
656
|
method: "GET",
|
|
625
657
|
headers: {
|
|
626
658
|
accept: "application/json",
|
|
627
|
-
"x-publishable-key": pk
|
|
659
|
+
"x-publishable-key": pk,
|
|
660
|
+
"x-unifold-version": LATEST_API_VERSION
|
|
628
661
|
}
|
|
629
662
|
});
|
|
630
663
|
if (!response.ok) {
|
|
@@ -1449,6 +1482,173 @@ async function getCashAppSessionStatus(externalId, publishableKey) {
|
|
|
1449
1482
|
}
|
|
1450
1483
|
return response.json();
|
|
1451
1484
|
}
|
|
1485
|
+
var HEADLESS_INTERAC_BASE = "/v1/public/onramps/headless/interac";
|
|
1486
|
+
var InteracApiResponseError = class extends Error {
|
|
1487
|
+
constructor(message, statusCode, errorType, providerMessage) {
|
|
1488
|
+
super(message);
|
|
1489
|
+
this.statusCode = statusCode;
|
|
1490
|
+
this.errorType = errorType;
|
|
1491
|
+
this.providerMessage = providerMessage;
|
|
1492
|
+
this.name = "InteracApiResponseError";
|
|
1493
|
+
}
|
|
1494
|
+
};
|
|
1495
|
+
function throwInteracError(prefix, response, error) {
|
|
1496
|
+
const providerMessage = error.details?.paytrie_error?.message;
|
|
1497
|
+
const detailMessage = providerMessage || error.message || response.statusText;
|
|
1498
|
+
throw new InteracApiResponseError(
|
|
1499
|
+
`${prefix}: ${detailMessage}`,
|
|
1500
|
+
response.status,
|
|
1501
|
+
error.error_type,
|
|
1502
|
+
providerMessage
|
|
1503
|
+
);
|
|
1504
|
+
}
|
|
1505
|
+
async function interacFetch(prefix, path, publishableKey, init = {}, accessToken) {
|
|
1506
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
1507
|
+
validatePublishableKey(pk);
|
|
1508
|
+
const response = await apiFetch(`${API_BASE_URL}${HEADLESS_INTERAC_BASE}${path}`, {
|
|
1509
|
+
...init,
|
|
1510
|
+
headers: {
|
|
1511
|
+
accept: "application/json",
|
|
1512
|
+
"x-publishable-key": pk,
|
|
1513
|
+
...init.body ? { "Content-Type": "application/json" } : {},
|
|
1514
|
+
...accessToken ? { "x-interac-token": accessToken } : {},
|
|
1515
|
+
...init.headers
|
|
1516
|
+
}
|
|
1517
|
+
});
|
|
1518
|
+
if (!response.ok) {
|
|
1519
|
+
const error = await response.json().catch(() => ({ message: response.statusText }));
|
|
1520
|
+
throwInteracError(prefix, response, error);
|
|
1521
|
+
}
|
|
1522
|
+
return response;
|
|
1523
|
+
}
|
|
1524
|
+
async function startInterac(email, publishableKey) {
|
|
1525
|
+
const response = await interacFetch("Failed to start Interac flow", "/start", publishableKey, {
|
|
1526
|
+
method: "POST",
|
|
1527
|
+
body: JSON.stringify({ email })
|
|
1528
|
+
});
|
|
1529
|
+
return response.json();
|
|
1530
|
+
}
|
|
1531
|
+
async function getInteracStatus(email, publishableKey, accessToken) {
|
|
1532
|
+
const response = await interacFetch(
|
|
1533
|
+
"Failed to resolve Interac status",
|
|
1534
|
+
"/status",
|
|
1535
|
+
publishableKey,
|
|
1536
|
+
// With a token, the token itself identifies the account — no email.
|
|
1537
|
+
{ method: "POST", body: JSON.stringify(email ? { email } : {}) },
|
|
1538
|
+
accessToken
|
|
1539
|
+
);
|
|
1540
|
+
return response.json();
|
|
1541
|
+
}
|
|
1542
|
+
async function createInteracUser(request, publishableKey) {
|
|
1543
|
+
const response = await interacFetch("Failed to create Interac user", "/users", publishableKey, {
|
|
1544
|
+
method: "POST",
|
|
1545
|
+
body: JSON.stringify(request)
|
|
1546
|
+
});
|
|
1547
|
+
return response.json();
|
|
1548
|
+
}
|
|
1549
|
+
async function requestInteracOtp(email, publishableKey) {
|
|
1550
|
+
await interacFetch("Failed to request Interac login code", "/otp", publishableKey, {
|
|
1551
|
+
method: "POST",
|
|
1552
|
+
body: JSON.stringify({ email })
|
|
1553
|
+
});
|
|
1554
|
+
}
|
|
1555
|
+
async function verifyInteracOtp(email, code, publishableKey) {
|
|
1556
|
+
const response = await interacFetch(
|
|
1557
|
+
"Failed to verify Interac login code",
|
|
1558
|
+
"/otp/verify",
|
|
1559
|
+
publishableKey,
|
|
1560
|
+
{ method: "POST", body: JSON.stringify({ email, code }) }
|
|
1561
|
+
);
|
|
1562
|
+
return response.json();
|
|
1563
|
+
}
|
|
1564
|
+
async function updateInteracUser(request, publishableKey, accessToken) {
|
|
1565
|
+
const response = await interacFetch(
|
|
1566
|
+
"Failed to update Interac user",
|
|
1567
|
+
"/users",
|
|
1568
|
+
publishableKey,
|
|
1569
|
+
{ method: "PUT", body: JSON.stringify(request) },
|
|
1570
|
+
accessToken
|
|
1571
|
+
);
|
|
1572
|
+
return response.json();
|
|
1573
|
+
}
|
|
1574
|
+
async function sendInteracPhoneVerification(phone, publishableKey, accessToken) {
|
|
1575
|
+
await interacFetch(
|
|
1576
|
+
"Failed to send phone verification code",
|
|
1577
|
+
"/phone",
|
|
1578
|
+
publishableKey,
|
|
1579
|
+
{ method: "POST", body: JSON.stringify({ phone }) },
|
|
1580
|
+
accessToken
|
|
1581
|
+
);
|
|
1582
|
+
}
|
|
1583
|
+
async function verifyInteracPhone(email, code, publishableKey, accessToken) {
|
|
1584
|
+
const response = await interacFetch(
|
|
1585
|
+
"Failed to verify phone code",
|
|
1586
|
+
"/phone/verify",
|
|
1587
|
+
publishableKey,
|
|
1588
|
+
{ method: "POST", body: JSON.stringify(email ? { email, code } : { code }) },
|
|
1589
|
+
accessToken
|
|
1590
|
+
);
|
|
1591
|
+
return response.json();
|
|
1592
|
+
}
|
|
1593
|
+
async function getInteracKycUrl(email, publishableKey, accessToken) {
|
|
1594
|
+
const response = await interacFetch(
|
|
1595
|
+
"Failed to get verification link",
|
|
1596
|
+
"/kyc_url",
|
|
1597
|
+
publishableKey,
|
|
1598
|
+
{ method: "POST", body: JSON.stringify(email ? { email } : {}) },
|
|
1599
|
+
accessToken
|
|
1600
|
+
);
|
|
1601
|
+
return response.json();
|
|
1602
|
+
}
|
|
1603
|
+
async function getInteracQuote(sourceAmount, destinationNetwork, publishableKey) {
|
|
1604
|
+
const query = new URLSearchParams({
|
|
1605
|
+
source_amount: String(sourceAmount),
|
|
1606
|
+
destination_network: destinationNetwork
|
|
1607
|
+
});
|
|
1608
|
+
const response = await interacFetch(
|
|
1609
|
+
"Failed to get Interac quote",
|
|
1610
|
+
`/quotes?${query.toString()}`,
|
|
1611
|
+
publishableKey,
|
|
1612
|
+
{ method: "GET" }
|
|
1613
|
+
);
|
|
1614
|
+
return response.json();
|
|
1615
|
+
}
|
|
1616
|
+
async function getInteracLimits(publishableKey) {
|
|
1617
|
+
const response = await interacFetch("Failed to get Interac limits", "/limits", publishableKey, {
|
|
1618
|
+
method: "GET"
|
|
1619
|
+
});
|
|
1620
|
+
return response.json();
|
|
1621
|
+
}
|
|
1622
|
+
async function createInteracSession(request, publishableKey, accessToken) {
|
|
1623
|
+
const response = await interacFetch(
|
|
1624
|
+
"Failed to create Interac session",
|
|
1625
|
+
"/sessions",
|
|
1626
|
+
publishableKey,
|
|
1627
|
+
{ method: "POST", body: JSON.stringify(request) },
|
|
1628
|
+
accessToken
|
|
1629
|
+
);
|
|
1630
|
+
return response.json();
|
|
1631
|
+
}
|
|
1632
|
+
async function cancelInteracSession(sessionId, publishableKey, accessToken) {
|
|
1633
|
+
const response = await interacFetch(
|
|
1634
|
+
"Failed to cancel Interac session",
|
|
1635
|
+
`/sessions/${encodeURIComponent(sessionId)}/cancel`,
|
|
1636
|
+
publishableKey,
|
|
1637
|
+
{ method: "POST" },
|
|
1638
|
+
accessToken
|
|
1639
|
+
);
|
|
1640
|
+
return response.json();
|
|
1641
|
+
}
|
|
1642
|
+
async function getInteracSession(sessionId, publishableKey, accessToken) {
|
|
1643
|
+
const response = await interacFetch(
|
|
1644
|
+
"Failed to get Interac session",
|
|
1645
|
+
`/sessions/${encodeURIComponent(sessionId)}`,
|
|
1646
|
+
publishableKey,
|
|
1647
|
+
{ method: "GET" },
|
|
1648
|
+
accessToken
|
|
1649
|
+
);
|
|
1650
|
+
return response.json();
|
|
1651
|
+
}
|
|
1452
1652
|
async function stripeGetDefaultToken(params, publishableKey) {
|
|
1453
1653
|
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
1454
1654
|
validatePublishableKey(pk);
|
|
@@ -1818,7 +2018,142 @@ async function jsonOrThrow(response, label) {
|
|
|
1818
2018
|
}
|
|
1819
2019
|
return response.json();
|
|
1820
2020
|
}
|
|
1821
|
-
|
|
2021
|
+
var IDENTITY_BASE = "/v1/public/identity";
|
|
2022
|
+
var BANK_TRANSFER_BASE = "/v1/public/onramps/bank_transfer";
|
|
2023
|
+
var ONRAMP_TOS_BASE = "/v1/public/onramps/terms_of_service";
|
|
2024
|
+
function identityHeaders(pk, json = false, onrampToken) {
|
|
2025
|
+
return {
|
|
2026
|
+
accept: "application/json",
|
|
2027
|
+
"x-publishable-key": pk,
|
|
2028
|
+
...json ? { "Content-Type": "application/json" } : {},
|
|
2029
|
+
...onrampToken ? { "x-onramp-token": onrampToken } : {}
|
|
2030
|
+
};
|
|
2031
|
+
}
|
|
2032
|
+
async function patchIdentityInformation(request, publishableKey, onrampToken) {
|
|
2033
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
2034
|
+
validatePublishableKey(pk);
|
|
2035
|
+
const response = await apiFetch(`${API_BASE_URL}${IDENTITY_BASE}/information`, {
|
|
2036
|
+
method: "PATCH",
|
|
2037
|
+
headers: identityHeaders(pk, true, onrampToken),
|
|
2038
|
+
body: JSON.stringify(request)
|
|
2039
|
+
});
|
|
2040
|
+
return jsonOrThrow(response, "Failed to submit identity information");
|
|
2041
|
+
}
|
|
2042
|
+
async function createIdentityVerificationSession(ctx, publishableKey, onrampToken) {
|
|
2043
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
2044
|
+
validatePublishableKey(pk);
|
|
2045
|
+
const response = await apiFetch(`${API_BASE_URL}${IDENTITY_BASE}/verification_sessions`, {
|
|
2046
|
+
method: "POST",
|
|
2047
|
+
headers: identityHeaders(pk, true, onrampToken),
|
|
2048
|
+
body: JSON.stringify(ctx)
|
|
2049
|
+
});
|
|
2050
|
+
return jsonOrThrow(
|
|
2051
|
+
response,
|
|
2052
|
+
"Failed to create identity verification session"
|
|
2053
|
+
);
|
|
2054
|
+
}
|
|
2055
|
+
var BankTransferCapabilityStatus = /* @__PURE__ */ ((BankTransferCapabilityStatus2) => {
|
|
2056
|
+
BankTransferCapabilityStatus2["IDENTITY_REQUIRED"] = "identity_required";
|
|
2057
|
+
BankTransferCapabilityStatus2["TOS_REQUIRED"] = "tos_required";
|
|
2058
|
+
BankTransferCapabilityStatus2["UNDER_REVIEW"] = "under_review";
|
|
2059
|
+
BankTransferCapabilityStatus2["AWAITING_QUESTIONNAIRE"] = "awaiting_questionnaire";
|
|
2060
|
+
BankTransferCapabilityStatus2["INCOMPLETE"] = "incomplete";
|
|
2061
|
+
BankTransferCapabilityStatus2["PREPARING"] = "preparing";
|
|
2062
|
+
BankTransferCapabilityStatus2["ACTIVE"] = "active";
|
|
2063
|
+
BankTransferCapabilityStatus2["REJECTED"] = "rejected";
|
|
2064
|
+
return BankTransferCapabilityStatus2;
|
|
2065
|
+
})(BankTransferCapabilityStatus || {});
|
|
2066
|
+
var BankTransferSessionStatus = /* @__PURE__ */ ((BankTransferSessionStatus2) => {
|
|
2067
|
+
BankTransferSessionStatus2["AWAITING_FUNDS"] = "awaiting_funds";
|
|
2068
|
+
BankTransferSessionStatus2["PROCESSING"] = "processing";
|
|
2069
|
+
BankTransferSessionStatus2["COMPLETED"] = "completed";
|
|
2070
|
+
BankTransferSessionStatus2["FAILED"] = "failed";
|
|
2071
|
+
BankTransferSessionStatus2["EXPIRED"] = "expired";
|
|
2072
|
+
return BankTransferSessionStatus2;
|
|
2073
|
+
})(BankTransferSessionStatus || {});
|
|
2074
|
+
async function createBankTransferCapability(request, publishableKey, onrampToken) {
|
|
2075
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
2076
|
+
validatePublishableKey(pk);
|
|
2077
|
+
const response = await apiFetch(`${API_BASE_URL}${BANK_TRANSFER_BASE}/capabilities`, {
|
|
2078
|
+
method: "POST",
|
|
2079
|
+
headers: identityHeaders(pk, true, onrampToken),
|
|
2080
|
+
body: JSON.stringify(request)
|
|
2081
|
+
});
|
|
2082
|
+
return jsonOrThrow(
|
|
2083
|
+
response,
|
|
2084
|
+
"Failed to resolve bank-transfer capability"
|
|
2085
|
+
);
|
|
2086
|
+
}
|
|
2087
|
+
async function createBankTransferVirtualAccount(request, publishableKey, onrampToken) {
|
|
2088
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
2089
|
+
validatePublishableKey(pk);
|
|
2090
|
+
const response = await apiFetch(`${API_BASE_URL}${BANK_TRANSFER_BASE}/virtual_accounts`, {
|
|
2091
|
+
method: "POST",
|
|
2092
|
+
headers: identityHeaders(pk, true, onrampToken),
|
|
2093
|
+
body: JSON.stringify(request)
|
|
2094
|
+
});
|
|
2095
|
+
return jsonOrThrow(
|
|
2096
|
+
response,
|
|
2097
|
+
"Failed to open bank-transfer virtual account"
|
|
2098
|
+
);
|
|
2099
|
+
}
|
|
2100
|
+
async function getBankTransferVirtualAccount(id, publishableKey, onrampToken) {
|
|
2101
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
2102
|
+
validatePublishableKey(pk);
|
|
2103
|
+
const response = await apiFetch(
|
|
2104
|
+
`${API_BASE_URL}${BANK_TRANSFER_BASE}/virtual_accounts/${encodeURIComponent(id)}`,
|
|
2105
|
+
{
|
|
2106
|
+
method: "GET",
|
|
2107
|
+
headers: identityHeaders(pk, false, onrampToken)
|
|
2108
|
+
}
|
|
2109
|
+
);
|
|
2110
|
+
return jsonOrThrow(
|
|
2111
|
+
response,
|
|
2112
|
+
"Failed to fetch bank-transfer virtual account"
|
|
2113
|
+
);
|
|
2114
|
+
}
|
|
2115
|
+
async function createBankTransferSession(request, publishableKey, onrampToken) {
|
|
2116
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
2117
|
+
validatePublishableKey(pk);
|
|
2118
|
+
const response = await apiFetch(`${API_BASE_URL}${BANK_TRANSFER_BASE}/sessions`, {
|
|
2119
|
+
method: "POST",
|
|
2120
|
+
headers: identityHeaders(pk, true, onrampToken),
|
|
2121
|
+
body: JSON.stringify(request)
|
|
2122
|
+
});
|
|
2123
|
+
return jsonOrThrow(response, "Failed to create bank-transfer session");
|
|
2124
|
+
}
|
|
2125
|
+
async function getBankTransferSession(id, publishableKey, onrampToken) {
|
|
2126
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
2127
|
+
validatePublishableKey(pk);
|
|
2128
|
+
const response = await apiFetch(
|
|
2129
|
+
`${API_BASE_URL}${BANK_TRANSFER_BASE}/sessions/${encodeURIComponent(id)}`,
|
|
2130
|
+
{
|
|
2131
|
+
method: "GET",
|
|
2132
|
+
headers: identityHeaders(pk, false, onrampToken)
|
|
2133
|
+
}
|
|
2134
|
+
);
|
|
2135
|
+
return jsonOrThrow(response, "Failed to fetch bank-transfer session");
|
|
2136
|
+
}
|
|
2137
|
+
async function getOnrampTos(publishableKey) {
|
|
2138
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
2139
|
+
validatePublishableKey(pk);
|
|
2140
|
+
const response = await apiFetch(`${API_BASE_URL}${ONRAMP_TOS_BASE}`, {
|
|
2141
|
+
method: "GET",
|
|
2142
|
+
headers: identityHeaders(pk)
|
|
2143
|
+
});
|
|
2144
|
+
return jsonOrThrow(response, "Failed to fetch terms of service");
|
|
2145
|
+
}
|
|
2146
|
+
async function acceptOnrampTos(request, publishableKey, onrampToken) {
|
|
2147
|
+
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
2148
|
+
validatePublishableKey(pk);
|
|
2149
|
+
const response = await apiFetch(`${API_BASE_URL}${ONRAMP_TOS_BASE}`, {
|
|
2150
|
+
method: "POST",
|
|
2151
|
+
headers: identityHeaders(pk, true, onrampToken),
|
|
2152
|
+
body: JSON.stringify(request)
|
|
2153
|
+
});
|
|
2154
|
+
return jsonOrThrow(response, "Failed to accept terms of service");
|
|
2155
|
+
}
|
|
2156
|
+
async function createOnrampVerificationSession(request, publishableKey, priorToken) {
|
|
1822
2157
|
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
1823
2158
|
validatePublishableKey(pk);
|
|
1824
2159
|
const response = await apiFetch(`${API_BASE_URL}${VERIFICATION_BASE}`, {
|
|
@@ -1826,7 +2161,8 @@ async function createOnrampVerificationSession(request, publishableKey) {
|
|
|
1826
2161
|
headers: {
|
|
1827
2162
|
accept: "application/json",
|
|
1828
2163
|
"x-publishable-key": pk,
|
|
1829
|
-
"Content-Type": "application/json"
|
|
2164
|
+
"Content-Type": "application/json",
|
|
2165
|
+
...priorToken ? { "x-onramp-token": priorToken } : {}
|
|
1830
2166
|
},
|
|
1831
2167
|
body: JSON.stringify(request)
|
|
1832
2168
|
});
|
|
@@ -4046,6 +4382,8 @@ var i18n = en_default;
|
|
|
4046
4382
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4047
4383
|
0 && (module.exports = {
|
|
4048
4384
|
ActionType,
|
|
4385
|
+
BankTransferCapabilityStatus,
|
|
4386
|
+
BankTransferSessionStatus,
|
|
4049
4387
|
CheckoutEventType,
|
|
4050
4388
|
DETECTION_ARM_DELAY_MS,
|
|
4051
4389
|
DETECTION_POLL_INTERVAL_MS,
|
|
@@ -4059,6 +4397,7 @@ var i18n = en_default;
|
|
|
4059
4397
|
IneligibilityReason,
|
|
4060
4398
|
IntegrationProvider,
|
|
4061
4399
|
IntegrationTransferError,
|
|
4400
|
+
InteracApiResponseError,
|
|
4062
4401
|
LOOKBACK_MS,
|
|
4063
4402
|
OnrampSession,
|
|
4064
4403
|
OnrampSessionEventType,
|
|
@@ -4069,19 +4408,27 @@ var i18n = en_default;
|
|
|
4069
4408
|
StripeApiResponseError,
|
|
4070
4409
|
UnifoldClient,
|
|
4071
4410
|
WithdrawEventType,
|
|
4411
|
+
acceptOnrampTos,
|
|
4072
4412
|
authenticateIntegrationOAuth,
|
|
4073
4413
|
buildHypercoreTransaction,
|
|
4074
4414
|
buildSolanaTransaction,
|
|
4415
|
+
cancelInteracSession,
|
|
4075
4416
|
checkHypercoreActivation,
|
|
4076
4417
|
confirmIntegrationTransfer,
|
|
4418
|
+
createBankTransferCapability,
|
|
4419
|
+
createBankTransferSession,
|
|
4420
|
+
createBankTransferVirtualAccount,
|
|
4077
4421
|
createCashAppSession,
|
|
4078
4422
|
createCoinbaseApplePaySession,
|
|
4079
4423
|
createCoinbaseGooglePaySession,
|
|
4080
4424
|
createCoinbaseWalletPaySession,
|
|
4081
4425
|
createDepositAddress,
|
|
4082
4426
|
createExchangeSession,
|
|
4427
|
+
createIdentityVerificationSession,
|
|
4083
4428
|
createIntegrationExchangeSession,
|
|
4084
4429
|
createIntegrationTransfer,
|
|
4430
|
+
createInteracSession,
|
|
4431
|
+
createInteracUser,
|
|
4085
4432
|
createOnrampSession,
|
|
4086
4433
|
createOnrampVerificationSession,
|
|
4087
4434
|
createUnifoldClient,
|
|
@@ -4095,6 +4442,8 @@ var i18n = en_default;
|
|
|
4095
4442
|
getApplePayLimitUpgradeStatus,
|
|
4096
4443
|
getApplePayProviders,
|
|
4097
4444
|
getBankTransferProviders,
|
|
4445
|
+
getBankTransferSession,
|
|
4446
|
+
getBankTransferVirtualAccount,
|
|
4098
4447
|
getCashAppLimits,
|
|
4099
4448
|
getCashAppSessionStatus,
|
|
4100
4449
|
getChainName,
|
|
@@ -4117,10 +4466,16 @@ var i18n = en_default;
|
|
|
4117
4466
|
getIntegrationExchanges,
|
|
4118
4467
|
getIntegrationHoldings,
|
|
4119
4468
|
getIntegrationTransferDefaultToken,
|
|
4469
|
+
getInteracKycUrl,
|
|
4470
|
+
getInteracLimits,
|
|
4471
|
+
getInteracQuote,
|
|
4472
|
+
getInteracSession,
|
|
4473
|
+
getInteracStatus,
|
|
4120
4474
|
getIpAddress,
|
|
4121
4475
|
getOnrampQuotes,
|
|
4122
4476
|
getOnrampSessionStartUrl,
|
|
4123
4477
|
getOnrampSessionStatus,
|
|
4478
|
+
getOnrampTos,
|
|
4124
4479
|
getOnrampVerificationSession,
|
|
4125
4480
|
getPreferredIconUrl,
|
|
4126
4481
|
getProjectConfig,
|
|
@@ -4144,18 +4499,22 @@ var i18n = en_default;
|
|
|
4144
4499
|
mapDirectExecution,
|
|
4145
4500
|
mapOnrampQuote,
|
|
4146
4501
|
mapWalletToDepositAddress,
|
|
4502
|
+
patchIdentityInformation,
|
|
4147
4503
|
pollDirectExecutions,
|
|
4148
4504
|
queryExecutions,
|
|
4149
4505
|
refreshIntegrationToken,
|
|
4150
4506
|
requestCoinbaseApplePayLimitUpgrade,
|
|
4151
4507
|
requestCoinbaseWalletPayLimitUpgrade,
|
|
4508
|
+
requestInteracOtp,
|
|
4152
4509
|
retrievePaymentIntent,
|
|
4153
4510
|
revokeIntegrationToken,
|
|
4154
4511
|
sendHypercoreTransaction,
|
|
4512
|
+
sendInteracPhoneVerification,
|
|
4155
4513
|
sendOnrampVerificationOtp,
|
|
4156
4514
|
sendSolanaTransaction,
|
|
4157
4515
|
setApiConfig,
|
|
4158
4516
|
startIntegrationOAuth,
|
|
4517
|
+
startInterac,
|
|
4159
4518
|
stripeConfirmSession,
|
|
4160
4519
|
stripeCreateAuthIntent,
|
|
4161
4520
|
stripeCreateSession,
|
|
@@ -4170,7 +4529,10 @@ var i18n = en_default;
|
|
|
4170
4529
|
stripeListWallets,
|
|
4171
4530
|
stripeRefreshQuote,
|
|
4172
4531
|
stripeRefreshToken,
|
|
4532
|
+
updateInteracUser,
|
|
4173
4533
|
useUserIp,
|
|
4534
|
+
verifyInteracOtp,
|
|
4535
|
+
verifyInteracPhone,
|
|
4174
4536
|
verifyOnrampVerificationOtp,
|
|
4175
4537
|
verifyRecipientAddress
|
|
4176
4538
|
});
|