@unifold/core 0.1.82 → 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 +629 -19
- package/dist/index.d.ts +629 -19
- package/dist/index.js +361 -4
- package/dist/index.mjs +335 -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() {
|
|
@@ -625,11 +651,13 @@ async function getBankTransferProviders(publishableKey, options = {}) {
|
|
|
625
651
|
}
|
|
626
652
|
const queryString = params.toString();
|
|
627
653
|
const url = `${API_BASE_URL}/v1/public/onramps/bank_transfer/providers${queryString ? `?${queryString}` : ""}`;
|
|
654
|
+
const LATEST_API_VERSION = "2026-08-15";
|
|
628
655
|
const response = await apiFetch(url, {
|
|
629
656
|
method: "GET",
|
|
630
657
|
headers: {
|
|
631
658
|
accept: "application/json",
|
|
632
|
-
"x-publishable-key": pk
|
|
659
|
+
"x-publishable-key": pk,
|
|
660
|
+
"x-unifold-version": LATEST_API_VERSION
|
|
633
661
|
}
|
|
634
662
|
});
|
|
635
663
|
if (!response.ok) {
|
|
@@ -1454,6 +1482,173 @@ async function getCashAppSessionStatus(externalId, publishableKey) {
|
|
|
1454
1482
|
}
|
|
1455
1483
|
return response.json();
|
|
1456
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
|
+
}
|
|
1457
1652
|
async function stripeGetDefaultToken(params, publishableKey) {
|
|
1458
1653
|
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
1459
1654
|
validatePublishableKey(pk);
|
|
@@ -1823,7 +2018,142 @@ async function jsonOrThrow(response, label) {
|
|
|
1823
2018
|
}
|
|
1824
2019
|
return response.json();
|
|
1825
2020
|
}
|
|
1826
|
-
|
|
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) {
|
|
1827
2157
|
const pk = publishableKey || DEFAULT_PUBLISHABLE_KEY;
|
|
1828
2158
|
validatePublishableKey(pk);
|
|
1829
2159
|
const response = await apiFetch(`${API_BASE_URL}${VERIFICATION_BASE}`, {
|
|
@@ -1831,7 +2161,8 @@ async function createOnrampVerificationSession(request, publishableKey) {
|
|
|
1831
2161
|
headers: {
|
|
1832
2162
|
accept: "application/json",
|
|
1833
2163
|
"x-publishable-key": pk,
|
|
1834
|
-
"Content-Type": "application/json"
|
|
2164
|
+
"Content-Type": "application/json",
|
|
2165
|
+
...priorToken ? { "x-onramp-token": priorToken } : {}
|
|
1835
2166
|
},
|
|
1836
2167
|
body: JSON.stringify(request)
|
|
1837
2168
|
});
|
|
@@ -4051,6 +4382,8 @@ var i18n = en_default;
|
|
|
4051
4382
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4052
4383
|
0 && (module.exports = {
|
|
4053
4384
|
ActionType,
|
|
4385
|
+
BankTransferCapabilityStatus,
|
|
4386
|
+
BankTransferSessionStatus,
|
|
4054
4387
|
CheckoutEventType,
|
|
4055
4388
|
DETECTION_ARM_DELAY_MS,
|
|
4056
4389
|
DETECTION_POLL_INTERVAL_MS,
|
|
@@ -4064,6 +4397,7 @@ var i18n = en_default;
|
|
|
4064
4397
|
IneligibilityReason,
|
|
4065
4398
|
IntegrationProvider,
|
|
4066
4399
|
IntegrationTransferError,
|
|
4400
|
+
InteracApiResponseError,
|
|
4067
4401
|
LOOKBACK_MS,
|
|
4068
4402
|
OnrampSession,
|
|
4069
4403
|
OnrampSessionEventType,
|
|
@@ -4074,19 +4408,27 @@ var i18n = en_default;
|
|
|
4074
4408
|
StripeApiResponseError,
|
|
4075
4409
|
UnifoldClient,
|
|
4076
4410
|
WithdrawEventType,
|
|
4411
|
+
acceptOnrampTos,
|
|
4077
4412
|
authenticateIntegrationOAuth,
|
|
4078
4413
|
buildHypercoreTransaction,
|
|
4079
4414
|
buildSolanaTransaction,
|
|
4415
|
+
cancelInteracSession,
|
|
4080
4416
|
checkHypercoreActivation,
|
|
4081
4417
|
confirmIntegrationTransfer,
|
|
4418
|
+
createBankTransferCapability,
|
|
4419
|
+
createBankTransferSession,
|
|
4420
|
+
createBankTransferVirtualAccount,
|
|
4082
4421
|
createCashAppSession,
|
|
4083
4422
|
createCoinbaseApplePaySession,
|
|
4084
4423
|
createCoinbaseGooglePaySession,
|
|
4085
4424
|
createCoinbaseWalletPaySession,
|
|
4086
4425
|
createDepositAddress,
|
|
4087
4426
|
createExchangeSession,
|
|
4427
|
+
createIdentityVerificationSession,
|
|
4088
4428
|
createIntegrationExchangeSession,
|
|
4089
4429
|
createIntegrationTransfer,
|
|
4430
|
+
createInteracSession,
|
|
4431
|
+
createInteracUser,
|
|
4090
4432
|
createOnrampSession,
|
|
4091
4433
|
createOnrampVerificationSession,
|
|
4092
4434
|
createUnifoldClient,
|
|
@@ -4100,6 +4442,8 @@ var i18n = en_default;
|
|
|
4100
4442
|
getApplePayLimitUpgradeStatus,
|
|
4101
4443
|
getApplePayProviders,
|
|
4102
4444
|
getBankTransferProviders,
|
|
4445
|
+
getBankTransferSession,
|
|
4446
|
+
getBankTransferVirtualAccount,
|
|
4103
4447
|
getCashAppLimits,
|
|
4104
4448
|
getCashAppSessionStatus,
|
|
4105
4449
|
getChainName,
|
|
@@ -4122,10 +4466,16 @@ var i18n = en_default;
|
|
|
4122
4466
|
getIntegrationExchanges,
|
|
4123
4467
|
getIntegrationHoldings,
|
|
4124
4468
|
getIntegrationTransferDefaultToken,
|
|
4469
|
+
getInteracKycUrl,
|
|
4470
|
+
getInteracLimits,
|
|
4471
|
+
getInteracQuote,
|
|
4472
|
+
getInteracSession,
|
|
4473
|
+
getInteracStatus,
|
|
4125
4474
|
getIpAddress,
|
|
4126
4475
|
getOnrampQuotes,
|
|
4127
4476
|
getOnrampSessionStartUrl,
|
|
4128
4477
|
getOnrampSessionStatus,
|
|
4478
|
+
getOnrampTos,
|
|
4129
4479
|
getOnrampVerificationSession,
|
|
4130
4480
|
getPreferredIconUrl,
|
|
4131
4481
|
getProjectConfig,
|
|
@@ -4149,18 +4499,22 @@ var i18n = en_default;
|
|
|
4149
4499
|
mapDirectExecution,
|
|
4150
4500
|
mapOnrampQuote,
|
|
4151
4501
|
mapWalletToDepositAddress,
|
|
4502
|
+
patchIdentityInformation,
|
|
4152
4503
|
pollDirectExecutions,
|
|
4153
4504
|
queryExecutions,
|
|
4154
4505
|
refreshIntegrationToken,
|
|
4155
4506
|
requestCoinbaseApplePayLimitUpgrade,
|
|
4156
4507
|
requestCoinbaseWalletPayLimitUpgrade,
|
|
4508
|
+
requestInteracOtp,
|
|
4157
4509
|
retrievePaymentIntent,
|
|
4158
4510
|
revokeIntegrationToken,
|
|
4159
4511
|
sendHypercoreTransaction,
|
|
4512
|
+
sendInteracPhoneVerification,
|
|
4160
4513
|
sendOnrampVerificationOtp,
|
|
4161
4514
|
sendSolanaTransaction,
|
|
4162
4515
|
setApiConfig,
|
|
4163
4516
|
startIntegrationOAuth,
|
|
4517
|
+
startInterac,
|
|
4164
4518
|
stripeConfirmSession,
|
|
4165
4519
|
stripeCreateAuthIntent,
|
|
4166
4520
|
stripeCreateSession,
|
|
@@ -4175,7 +4529,10 @@ var i18n = en_default;
|
|
|
4175
4529
|
stripeListWallets,
|
|
4176
4530
|
stripeRefreshQuote,
|
|
4177
4531
|
stripeRefreshToken,
|
|
4532
|
+
updateInteracUser,
|
|
4178
4533
|
useUserIp,
|
|
4534
|
+
verifyInteracOtp,
|
|
4535
|
+
verifyInteracPhone,
|
|
4179
4536
|
verifyOnrampVerificationOtp,
|
|
4180
4537
|
verifyRecipientAddress
|
|
4181
4538
|
});
|