@getpara/shared 1.25.0 → 1.27.0
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/cjs/types/assets.js +18 -2
- package/dist/cjs/types/headlessOnRamp.js +9 -0
- package/dist/cjs/types/index.js +2 -0
- package/dist/cjs/types/sdkCapabilities.js +45 -0
- package/dist/esm/types/assets.js +17 -1
- package/dist/esm/types/headlessOnRamp.js +8 -0
- package/dist/esm/types/index.js +2 -0
- package/dist/esm/types/sdkCapabilities.js +40 -0
- package/dist/types/types/assets.d.ts +69 -2
- package/dist/types/types/assets.d.ts.map +1 -1
- package/dist/types/types/authState.d.ts +84 -1
- package/dist/types/types/authState.d.ts.map +1 -1
- package/dist/types/types/headlessOnRamp.d.ts +41 -0
- package/dist/types/types/headlessOnRamp.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/types/partner.d.ts +3 -1
- package/dist/types/types/partner.d.ts.map +1 -1
- package/dist/types/types/sdkCapabilities.d.ts +13 -0
- package/dist/types/types/sdkCapabilities.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/cjs/types/assets.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OnRampMethod = exports.OnRampPurchaseStatus = exports.OnRampPurchaseType = exports.ON_RAMP_ASSETS = exports.OnRampAsset = exports.ON_RAMP_PROVIDERS = exports.OnRampProvider = void 0;
|
|
3
|
+
exports.OnRampMethod = exports.OnRampPurchaseStatus = exports.OnRampPurchaseType = exports.ON_RAMP_ASSETS = exports.OnRampAsset = exports.PROVIDER_PAYMENT_METHODS = exports.ON_RAMP_PAYMENT_METHODS = exports.ON_RAMP_PROVIDERS = exports.OnRampProvider = void 0;
|
|
4
4
|
/** @deprecated use `OnRampProvider` string union instead */
|
|
5
5
|
var OnRampProvider;
|
|
6
6
|
(function (OnRampProvider) {
|
|
@@ -9,8 +9,24 @@ var OnRampProvider;
|
|
|
9
9
|
OnRampProvider["MOONPAY"] = "MOONPAY";
|
|
10
10
|
OnRampProvider["CDP"] = "CDP";
|
|
11
11
|
OnRampProvider["MERCURYO"] = "MERCURYO";
|
|
12
|
+
OnRampProvider["BRALE"] = "BRALE";
|
|
12
13
|
})(OnRampProvider || (exports.OnRampProvider = OnRampProvider = {}));
|
|
13
|
-
exports.ON_RAMP_PROVIDERS = ['RAMP', 'STRIPE', 'MOONPAY', 'CDP', 'MERCURYO'];
|
|
14
|
+
exports.ON_RAMP_PROVIDERS = ['RAMP', 'STRIPE', 'MOONPAY', 'CDP', 'MERCURYO', 'BRALE'];
|
|
15
|
+
// Payment flows a provider can offer for an implementation in the request's region. Drives which
|
|
16
|
+
// call-to-action the AddFunds modal renders. WIDGET = the hosted redirect flow (provider selection +
|
|
17
|
+
// Continue) that every widget provider supports; APPLE_PAY / CARD / BANK are headless flows enabled
|
|
18
|
+
// per integration.
|
|
19
|
+
exports.ON_RAMP_PAYMENT_METHODS = ['APPLE_PAY', 'CARD', 'BANK', 'WIDGET'];
|
|
20
|
+
// Provider -> the payment flows it can offer, independent of geo. The catalog resolver intersects this
|
|
21
|
+
// with per-region provider availability so a provider only appears (with its methods) where it's buyable.
|
|
22
|
+
exports.PROVIDER_PAYMENT_METHODS = {
|
|
23
|
+
RAMP: ['WIDGET'],
|
|
24
|
+
STRIPE: ['WIDGET'],
|
|
25
|
+
MOONPAY: ['WIDGET', 'CARD'],
|
|
26
|
+
CDP: ['WIDGET', 'APPLE_PAY'],
|
|
27
|
+
MERCURYO: ['WIDGET', 'APPLE_PAY'],
|
|
28
|
+
BRALE: ['BANK'],
|
|
29
|
+
};
|
|
14
30
|
/** @deprecated use `TOnRampAsset` string union instead */
|
|
15
31
|
var OnRampAsset;
|
|
16
32
|
(function (OnRampAsset) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Headless on-ramp types, shared between the server and the web-sdk client so request/response shapes
|
|
3
|
+
// aren't duplicated across the server and the user-management-client.
|
|
4
|
+
//
|
|
5
|
+
// Each headless (native Apple Pay / Platform SDK) provider has its own router and route per action —
|
|
6
|
+
// POST /users/:userId/onramp/<provider>/<action> — with its param/result types defined below. CDP
|
|
7
|
+
// (Coinbase) is the only provider defined + wired today; Mercuryo and MoonPay add their types here when
|
|
8
|
+
// they land on their own branches.
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -16,12 +16,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./assets.js"), exports);
|
|
18
18
|
__exportStar(require("./auth.js"), exports);
|
|
19
|
+
__exportStar(require("./headlessOnRamp.js"), exports);
|
|
19
20
|
__exportStar(require("./authFactor.js"), exports);
|
|
20
21
|
__exportStar(require("./authState.js"), exports);
|
|
21
22
|
__exportStar(require("./modal.js"), exports);
|
|
22
23
|
__exportStar(require("./otp.js"), exports);
|
|
23
24
|
__exportStar(require("./params.js"), exports);
|
|
24
25
|
__exportStar(require("./partner.js"), exports);
|
|
26
|
+
__exportStar(require("./sdkCapabilities.js"), exports);
|
|
25
27
|
__exportStar(require("./partnerAppConfig.js"), exports);
|
|
26
28
|
__exportStar(require("./pending-transaction.js"), exports);
|
|
27
29
|
__exportStar(require("./permissions.js"), exports);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Client → server capability negotiation.
|
|
3
|
+
//
|
|
4
|
+
// The SDK advertises which features THIS build supports via a single request header, and the server gates
|
|
5
|
+
// behavior on the presence of a token rather than on an SDK version number. This keeps a capability coupled
|
|
6
|
+
// to the build that implements it (no cross-repo version guessing) and, unlike a header-per-feature, needs
|
|
7
|
+
// only ONE CORS `allowedHeaders` + `Vary` entry no matter how many capabilities are added.
|
|
8
|
+
//
|
|
9
|
+
// To add a capability: add a token below, send it from the SDK build that implements it
|
|
10
|
+
// (`serializeCapabilities`), and check for it on the server (`parseCapabilities(...).has(...)`).
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SdkCapability = exports.SDK_CAPABILITIES_HEADER = void 0;
|
|
13
|
+
exports.serializeCapabilities = serializeCapabilities;
|
|
14
|
+
exports.parseCapabilities = parseCapabilities;
|
|
15
|
+
exports.SDK_CAPABILITIES_HEADER = 'x-para-capabilities';
|
|
16
|
+
var SdkCapability;
|
|
17
|
+
(function (SdkCapability) {
|
|
18
|
+
// The build ships the on-ramp catalog picker, so it wants the OnRampConfigV2 (DB-reference) config shape
|
|
19
|
+
// from GET /on-ramp-config instead of the legacy assetInfo config. Checked server-side in onRampConfig.ts.
|
|
20
|
+
SdkCapability["OnRampCatalog"] = "onramp-catalog";
|
|
21
|
+
// The build can drive the Coinbase (CDP) headless on-ramp order flow. Advertised by the SDK now, but NOT
|
|
22
|
+
// yet gated server-side — the CDP order route serves everyone; wire a parseCapabilities(...).has(...) check
|
|
23
|
+
// here when the flow needs to condition on client support.
|
|
24
|
+
SdkCapability["CdpHeadless"] = "cdp-headless";
|
|
25
|
+
})(SdkCapability || (exports.SdkCapability = SdkCapability = {}));
|
|
26
|
+
const KNOWN_CAPABILITIES = new Set(Object.values(SdkCapability));
|
|
27
|
+
/** Serialize a build's supported capabilities into the header value (comma-separated tokens). */
|
|
28
|
+
function serializeCapabilities(capabilities) {
|
|
29
|
+
return [...new Set(capabilities)].join(',');
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Parse the capabilities header into the set of KNOWN capabilities the client advertised. Unknown tokens
|
|
33
|
+
* (e.g. a newer SDK advertising a capability this server doesn't understand yet) are ignored.
|
|
34
|
+
*/
|
|
35
|
+
function parseCapabilities(header) {
|
|
36
|
+
const result = new Set();
|
|
37
|
+
if (!header)
|
|
38
|
+
return result;
|
|
39
|
+
for (const raw of header.split(',')) {
|
|
40
|
+
const token = raw.trim();
|
|
41
|
+
if (KNOWN_CAPABILITIES.has(token))
|
|
42
|
+
result.add(token);
|
|
43
|
+
}
|
|
44
|
+
return result;
|
|
45
|
+
}
|
package/dist/esm/types/assets.js
CHANGED
|
@@ -6,8 +6,24 @@ export var OnRampProvider;
|
|
|
6
6
|
OnRampProvider["MOONPAY"] = "MOONPAY";
|
|
7
7
|
OnRampProvider["CDP"] = "CDP";
|
|
8
8
|
OnRampProvider["MERCURYO"] = "MERCURYO";
|
|
9
|
+
OnRampProvider["BRALE"] = "BRALE";
|
|
9
10
|
})(OnRampProvider || (OnRampProvider = {}));
|
|
10
|
-
export const ON_RAMP_PROVIDERS = ['RAMP', 'STRIPE', 'MOONPAY', 'CDP', 'MERCURYO'];
|
|
11
|
+
export const ON_RAMP_PROVIDERS = ['RAMP', 'STRIPE', 'MOONPAY', 'CDP', 'MERCURYO', 'BRALE'];
|
|
12
|
+
// Payment flows a provider can offer for an implementation in the request's region. Drives which
|
|
13
|
+
// call-to-action the AddFunds modal renders. WIDGET = the hosted redirect flow (provider selection +
|
|
14
|
+
// Continue) that every widget provider supports; APPLE_PAY / CARD / BANK are headless flows enabled
|
|
15
|
+
// per integration.
|
|
16
|
+
export const ON_RAMP_PAYMENT_METHODS = ['APPLE_PAY', 'CARD', 'BANK', 'WIDGET'];
|
|
17
|
+
// Provider -> the payment flows it can offer, independent of geo. The catalog resolver intersects this
|
|
18
|
+
// with per-region provider availability so a provider only appears (with its methods) where it's buyable.
|
|
19
|
+
export const PROVIDER_PAYMENT_METHODS = {
|
|
20
|
+
RAMP: ['WIDGET'],
|
|
21
|
+
STRIPE: ['WIDGET'],
|
|
22
|
+
MOONPAY: ['WIDGET', 'CARD'],
|
|
23
|
+
CDP: ['WIDGET', 'APPLE_PAY'],
|
|
24
|
+
MERCURYO: ['WIDGET', 'APPLE_PAY'],
|
|
25
|
+
BRALE: ['BANK'],
|
|
26
|
+
};
|
|
11
27
|
/** @deprecated use `TOnRampAsset` string union instead */
|
|
12
28
|
export var OnRampAsset;
|
|
13
29
|
(function (OnRampAsset) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// Headless on-ramp types, shared between the server and the web-sdk client so request/response shapes
|
|
2
|
+
// aren't duplicated across the server and the user-management-client.
|
|
3
|
+
//
|
|
4
|
+
// Each headless (native Apple Pay / Platform SDK) provider has its own router and route per action —
|
|
5
|
+
// POST /users/:userId/onramp/<provider>/<action> — with its param/result types defined below. CDP
|
|
6
|
+
// (Coinbase) is the only provider defined + wired today; Mercuryo and MoonPay add their types here when
|
|
7
|
+
// they land on their own branches.
|
|
8
|
+
export {};
|
package/dist/esm/types/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export * from './assets.js';
|
|
2
2
|
export * from './auth.js';
|
|
3
|
+
export * from './headlessOnRamp.js';
|
|
3
4
|
export * from './authFactor.js';
|
|
4
5
|
export * from './authState.js';
|
|
5
6
|
export * from './modal.js';
|
|
6
7
|
export * from './otp.js';
|
|
7
8
|
export * from './params.js';
|
|
8
9
|
export * from './partner.js';
|
|
10
|
+
export * from './sdkCapabilities.js';
|
|
9
11
|
export * from './partnerAppConfig.js';
|
|
10
12
|
export * from './pending-transaction.js';
|
|
11
13
|
export * from './permissions.js';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Client → server capability negotiation.
|
|
2
|
+
//
|
|
3
|
+
// The SDK advertises which features THIS build supports via a single request header, and the server gates
|
|
4
|
+
// behavior on the presence of a token rather than on an SDK version number. This keeps a capability coupled
|
|
5
|
+
// to the build that implements it (no cross-repo version guessing) and, unlike a header-per-feature, needs
|
|
6
|
+
// only ONE CORS `allowedHeaders` + `Vary` entry no matter how many capabilities are added.
|
|
7
|
+
//
|
|
8
|
+
// To add a capability: add a token below, send it from the SDK build that implements it
|
|
9
|
+
// (`serializeCapabilities`), and check for it on the server (`parseCapabilities(...).has(...)`).
|
|
10
|
+
export const SDK_CAPABILITIES_HEADER = 'x-para-capabilities';
|
|
11
|
+
export var SdkCapability;
|
|
12
|
+
(function (SdkCapability) {
|
|
13
|
+
// The build ships the on-ramp catalog picker, so it wants the OnRampConfigV2 (DB-reference) config shape
|
|
14
|
+
// from GET /on-ramp-config instead of the legacy assetInfo config. Checked server-side in onRampConfig.ts.
|
|
15
|
+
SdkCapability["OnRampCatalog"] = "onramp-catalog";
|
|
16
|
+
// The build can drive the Coinbase (CDP) headless on-ramp order flow. Advertised by the SDK now, but NOT
|
|
17
|
+
// yet gated server-side — the CDP order route serves everyone; wire a parseCapabilities(...).has(...) check
|
|
18
|
+
// here when the flow needs to condition on client support.
|
|
19
|
+
SdkCapability["CdpHeadless"] = "cdp-headless";
|
|
20
|
+
})(SdkCapability || (SdkCapability = {}));
|
|
21
|
+
const KNOWN_CAPABILITIES = new Set(Object.values(SdkCapability));
|
|
22
|
+
/** Serialize a build's supported capabilities into the header value (comma-separated tokens). */
|
|
23
|
+
export function serializeCapabilities(capabilities) {
|
|
24
|
+
return [...new Set(capabilities)].join(',');
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Parse the capabilities header into the set of KNOWN capabilities the client advertised. Unknown tokens
|
|
28
|
+
* (e.g. a newer SDK advertising a capability this server doesn't understand yet) are ignored.
|
|
29
|
+
*/
|
|
30
|
+
export function parseCapabilities(header) {
|
|
31
|
+
const result = new Set();
|
|
32
|
+
if (!header)
|
|
33
|
+
return result;
|
|
34
|
+
for (const raw of header.split(',')) {
|
|
35
|
+
const token = raw.trim();
|
|
36
|
+
if (KNOWN_CAPABILITIES.has(token))
|
|
37
|
+
result.add(token);
|
|
38
|
+
}
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
@@ -5,11 +5,64 @@ export declare enum OnRampProvider {
|
|
|
5
5
|
STRIPE = "STRIPE",
|
|
6
6
|
MOONPAY = "MOONPAY",
|
|
7
7
|
CDP = "CDP",
|
|
8
|
-
MERCURYO = "MERCURYO"
|
|
8
|
+
MERCURYO = "MERCURYO",
|
|
9
|
+
BRALE = "BRALE"
|
|
9
10
|
}
|
|
10
|
-
export declare const ON_RAMP_PROVIDERS: readonly ["RAMP", "STRIPE", "MOONPAY", "CDP", "MERCURYO"];
|
|
11
|
+
export declare const ON_RAMP_PROVIDERS: readonly ["RAMP", "STRIPE", "MOONPAY", "CDP", "MERCURYO", "BRALE"];
|
|
11
12
|
export type TOnRampProvider = (typeof ON_RAMP_PROVIDERS)[number];
|
|
13
|
+
export declare const ON_RAMP_PAYMENT_METHODS: readonly ["APPLE_PAY", "CARD", "BANK", "WIDGET"];
|
|
14
|
+
export type OnRampPaymentMethod = (typeof ON_RAMP_PAYMENT_METHODS)[number];
|
|
15
|
+
export declare const PROVIDER_PAYMENT_METHODS: Record<TOnRampProvider, OnRampPaymentMethod[]>;
|
|
12
16
|
export type OnRampSelectionMode = 'ALL' | 'CUSTOM';
|
|
17
|
+
export type OnRampProviderSupport = {
|
|
18
|
+
provider: TOnRampProvider;
|
|
19
|
+
isBuy: boolean;
|
|
20
|
+
isSell: boolean;
|
|
21
|
+
paymentMethods: OnRampPaymentMethod[];
|
|
22
|
+
minAmount?: number;
|
|
23
|
+
maxAmount?: number;
|
|
24
|
+
};
|
|
25
|
+
export type OnRampAssetImplementation = {
|
|
26
|
+
assetImplementationId: string;
|
|
27
|
+
assetId: string;
|
|
28
|
+
symbol: string;
|
|
29
|
+
name: string;
|
|
30
|
+
logoUrl?: string;
|
|
31
|
+
marketCapRank: number;
|
|
32
|
+
networkId: string;
|
|
33
|
+
chainId?: string;
|
|
34
|
+
networkName: string;
|
|
35
|
+
networkLogoUrl?: string;
|
|
36
|
+
walletType: TWalletType;
|
|
37
|
+
isTestnet: boolean;
|
|
38
|
+
contractAddress: string | null;
|
|
39
|
+
decimals: number | null;
|
|
40
|
+
providers: OnRampProviderSupport[];
|
|
41
|
+
};
|
|
42
|
+
export type OnRampNetworkRef = {
|
|
43
|
+
networkId: string;
|
|
44
|
+
chainId?: string;
|
|
45
|
+
networkName: string;
|
|
46
|
+
walletType: TWalletType;
|
|
47
|
+
};
|
|
48
|
+
export type OnRampCatalogResponse = {
|
|
49
|
+
items: OnRampAssetImplementation[];
|
|
50
|
+
total: number;
|
|
51
|
+
limit: number;
|
|
52
|
+
offset: number;
|
|
53
|
+
};
|
|
54
|
+
export type PartnerOnRampRefsView = {
|
|
55
|
+
selectionMode: OnRampSelectionMode;
|
|
56
|
+
networks: OnRampNetworkRef[];
|
|
57
|
+
assetImplementations: OnRampAssetImplementation[];
|
|
58
|
+
defaultAssetImplementationId?: string;
|
|
59
|
+
};
|
|
60
|
+
export type SetOnRampRefsBody = {
|
|
61
|
+
selectionMode: OnRampSelectionMode;
|
|
62
|
+
networkIds: string[];
|
|
63
|
+
assetImplementationIds: string[];
|
|
64
|
+
defaultAssetImplementationId?: string | null;
|
|
65
|
+
};
|
|
13
66
|
/** @deprecated use `TOnRampAsset` string union instead */
|
|
14
67
|
export declare enum OnRampAsset {
|
|
15
68
|
ETHEREUM = "ETHEREUM",
|
|
@@ -51,6 +104,9 @@ export interface IOnRampPurchase {
|
|
|
51
104
|
asset?: TOnRampAsset;
|
|
52
105
|
assetQuantity?: string | null;
|
|
53
106
|
network?: TNetwork | null;
|
|
107
|
+
providerAssetCode?: string | null;
|
|
108
|
+
assetImplementationId?: string;
|
|
109
|
+
paymentMethod?: OnRampPaymentMethod;
|
|
54
110
|
testMode?: boolean;
|
|
55
111
|
}
|
|
56
112
|
export type OnRampPurchase = IOnRampPurchase;
|
|
@@ -59,6 +115,7 @@ export type OnRampPurchaseCreateParams = Omit<IOnRampPurchase, 'id' | 'userId'>
|
|
|
59
115
|
assets?: TOnRampAsset[] | 'all';
|
|
60
116
|
defaultNetwork?: TNetwork;
|
|
61
117
|
defaultAsset?: TOnRampAsset;
|
|
118
|
+
assetImplementationId?: string;
|
|
62
119
|
};
|
|
63
120
|
export type OnRampPurchaseUpdateParams = Omit<IOnRampPurchase, 'id' | 'userId'>;
|
|
64
121
|
export type OfframpDepositRequest = OnRampPurchaseUpdateParams & {
|
|
@@ -89,6 +146,16 @@ export type OnRampConfig = {
|
|
|
89
146
|
defaultOnRampNetwork?: TNetwork;
|
|
90
147
|
defaultBuyAmount?: [string, string];
|
|
91
148
|
};
|
|
149
|
+
export type OnRampConfigV2 = {
|
|
150
|
+
isBuyEnabled: boolean;
|
|
151
|
+
isReceiveEnabled: boolean;
|
|
152
|
+
isWithdrawEnabled: boolean;
|
|
153
|
+
isSendEnabled: boolean;
|
|
154
|
+
onRampSelectionMode: OnRampSelectionMode;
|
|
155
|
+
defaultOnRampAssetImplementation?: OnRampAssetImplementation;
|
|
156
|
+
defaultBuyAmount?: AssetValue;
|
|
157
|
+
rampApiKey?: string;
|
|
158
|
+
};
|
|
92
159
|
export type AssetValue<Currency extends string = 'USD'> = {
|
|
93
160
|
/**
|
|
94
161
|
* The value of the asset(s) in the chosen currency.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../../src/types/assets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEnE,4DAA4D;AAC5D,oBAAY,cAAc;IACxB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,GAAG,QAAQ;IACX,QAAQ,aAAa;
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../../src/types/assets.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEnE,4DAA4D;AAC5D,oBAAY,cAAc;IACxB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,GAAG,QAAQ;IACX,QAAQ,aAAa;IACrB,KAAK,UAAU;CAChB;AAED,eAAO,MAAM,iBAAiB,oEAAqE,CAAC;AAEpG,MAAM,MAAM,eAAe,GA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;;;;;OAMG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,GAAG,CACA;IACE,WAAW,EAAE,YAAY,CAAC;IAC1B;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACH,gBAAgB,CAAC,EAAE,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC;CAC5C,GACD;IACE,WAAW,EAAE,cAAc,CAAC;IAC5B;;;;;;;;;;;;;;OAcG;IACH,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;CAC9B,CACJ,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,cAAc,CAAC"}
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
* This is the canonical auth contract — new SDKs consume it directly instead of
|
|
9
9
|
* a parallel client mirror. (ENG-6910)
|
|
10
10
|
*/
|
|
11
|
-
import type { MfaChallenge, TOAuthMethod } from './auth.js';
|
|
11
|
+
import type { MfaChallenge, TAuthMethod, TOAuthMethod } from './auth.js';
|
|
12
|
+
import type { DeliveryChannel } from './otp.js';
|
|
13
|
+
import type { TWalletType } from './wallet.js';
|
|
12
14
|
/**
|
|
13
15
|
* Flow statuses. Only `needs_verification` and `authenticated` are emitted today;
|
|
14
16
|
* the rest are reserved so the contract is forward-stable and added to as the
|
|
@@ -53,6 +55,26 @@ export type AuthState = {
|
|
|
53
55
|
accountId?: string | null;
|
|
54
56
|
/** Whether this auth created the account (signup) vs logged into an existing one. Present on `authenticated`. */
|
|
55
57
|
isNewUser?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Present on `authenticated`: whether the account's MPC user-share is enclave-custodied (basic-login)
|
|
60
|
+
* vs credential-protected. The authoritative key-share-path signal — the backend asserts it so the SDK
|
|
61
|
+
* doesn't have to re-encode the "`BASIC_LOGIN` ⇒ enclave" rule. (ENG-7075)
|
|
62
|
+
*/
|
|
63
|
+
isEnclaveUser?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Present on `authenticated`: the account's enrolled auth methods. The SDK reads this for the
|
|
66
|
+
* credential-unlock UI (`PASSKEY`/`PASSWORD`/`PIN`); the enclave decision itself comes from
|
|
67
|
+
* `isEnclaveUser` above. Mirrors the legacy `done` stage's `authMethods`. Safe to expose here
|
|
68
|
+
* (post-auth): the user has proven ownership, so revealing their own methods isn't an enumeration
|
|
69
|
+
* leak — unlike the legacy pre-auth `login` stage. (ENG-7075)
|
|
70
|
+
*/
|
|
71
|
+
authMethods?: TAuthMethod[];
|
|
72
|
+
/**
|
|
73
|
+
* Present on `authenticated`: whether the account has a real (non-PIN) password. `authMethods` reports
|
|
74
|
+
* `PASSWORD` even for a PIN-only account (legacy-SDK compat), so the SDK needs this to tell a password
|
|
75
|
+
* from a PIN — mirrors the legacy `login` stage's `hasPasswordWithoutPIN`. (ENG-7075)
|
|
76
|
+
*/
|
|
77
|
+
hasPasswordWithoutPIN?: boolean;
|
|
56
78
|
verification?: AuthVerification;
|
|
57
79
|
/** The login-time MFA challenge in flight (present while `needs_second_factor`). (ENG-6906) */
|
|
58
80
|
secondFactor?: MfaChallenge;
|
|
@@ -97,4 +119,65 @@ export type AuthState = {
|
|
|
97
119
|
label?: string;
|
|
98
120
|
};
|
|
99
121
|
};
|
|
122
|
+
/**
|
|
123
|
+
* Request bodies for the method-agnostic `/v2/auth` surface — the counterpart to the `AuthState`
|
|
124
|
+
* response, kept here so the request+response contract is single-source across the backend handlers
|
|
125
|
+
* (which validate `req.body` against these) and the SDK client (which constructs them). The backend
|
|
126
|
+
* still runtime-validates every field; these types are the compile-time contract, not the trust
|
|
127
|
+
* boundary. (ENG-6910 / ENG-6911)
|
|
128
|
+
*/
|
|
129
|
+
/** `start` body — discriminated by `method`. Each method carries only the fields its flow needs. */
|
|
130
|
+
export type AuthStartBody = {
|
|
131
|
+
method: 'EMAIL';
|
|
132
|
+
email: string;
|
|
133
|
+
} | {
|
|
134
|
+
method: 'PHONE';
|
|
135
|
+
phone: string;
|
|
136
|
+
countryCode?: string;
|
|
137
|
+
} | {
|
|
138
|
+
method: 'EXTERNAL_WALLET';
|
|
139
|
+
address: string;
|
|
140
|
+
chainType: TWalletType;
|
|
141
|
+
uri: string;
|
|
142
|
+
chainId?: string;
|
|
143
|
+
} | {
|
|
144
|
+
method: 'PASSKEY';
|
|
145
|
+
} | {
|
|
146
|
+
method: 'OAUTH';
|
|
147
|
+
provider: TOAuthMethod;
|
|
148
|
+
returnUrl?: string;
|
|
149
|
+
providerConfigHandle?: string;
|
|
150
|
+
};
|
|
151
|
+
/** How a `needs_link` collision is resolved: step up to the existing account, or fork a separate one. */
|
|
152
|
+
export type AuthLinkAction = 'link' | 'create_separate';
|
|
153
|
+
/**
|
|
154
|
+
* `continue` body — always the `flowId` plus the per-state proof. The endpoint is overloaded by the
|
|
155
|
+
* flow's server-side state rather than a body discriminant, so each proof field is optional and the
|
|
156
|
+
* relevant one is sent for the state the flow is in.
|
|
157
|
+
*/
|
|
158
|
+
export type AuthContinueBody = {
|
|
159
|
+
flowId: string;
|
|
160
|
+
/** Email/phone: the one-time code. */
|
|
161
|
+
code?: string;
|
|
162
|
+
/** External wallet: the SIWE signature (+ optional Cosmos signer material). */
|
|
163
|
+
signature?: string;
|
|
164
|
+
cosmosSigner?: string;
|
|
165
|
+
cosmosPublicKeyHex?: string;
|
|
166
|
+
/** Passkey: the WebAuthn assertion. */
|
|
167
|
+
credentialId?: string;
|
|
168
|
+
clientDataJSON?: string;
|
|
169
|
+
authenticatorData?: string;
|
|
170
|
+
/** Cross-method linking: resolve a `needs_link` collision. */
|
|
171
|
+
link?: {
|
|
172
|
+
action: AuthLinkAction;
|
|
173
|
+
method?: TOAuthMethod;
|
|
174
|
+
};
|
|
175
|
+
/** OAuth step-up (during linking): where the provider callback returns to. */
|
|
176
|
+
returnUrl?: string;
|
|
177
|
+
};
|
|
178
|
+
/** `resend` body — re-send the OTP for a pending email/phone flow, optionally escalating the channel. */
|
|
179
|
+
export type AuthResendBody = {
|
|
180
|
+
flowId: string;
|
|
181
|
+
channelOverride?: DeliveryChannel;
|
|
182
|
+
};
|
|
100
183
|
//# sourceMappingURL=authState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authState.d.ts","sourceRoot":"","sources":["../../../src/types/authState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"authState.d.ts","sourceRoot":"","sources":["../../../src/types/authState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,aAAa,2GAMhB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,oEAAqE,CAAC;AAEpG,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE,iFAAiF;AACjF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,eAAe,CAAC;IACxB,sEAAsE;IACtE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8FAA8F;IAC9F,YAAY,CAAC,E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oinbaseHeadlessOrderParams = {
|
|
2
|
+
isQuote?: boolean;
|
|
3
|
+
paymentAmount?: string;
|
|
4
|
+
purchaseAmount?: string;
|
|
5
|
+
assetImplementationId?: string;
|
|
6
|
+
purchaseCurrency?: string;
|
|
7
|
+
destinationAddress: string;
|
|
8
|
+
destinationNetwork?: string;
|
|
9
|
+
phoneNumber: string;
|
|
10
|
+
phoneNumberVerifiedAt?: string;
|
|
11
|
+
email: string;
|
|
12
|
+
agreementAcceptedAt?: string;
|
|
13
|
+
testMode?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type CoinbaseHeadlessFee = {
|
|
16
|
+
type?: string;
|
|
17
|
+
amount?: string;
|
|
18
|
+
currency?: string;
|
|
19
|
+
};
|
|
20
|
+
export type CoinbaseHeadlessOrderResult = {
|
|
21
|
+
purchaseId?: string;
|
|
22
|
+
order?: {
|
|
23
|
+
orderId?: string;
|
|
24
|
+
paymentTotal?: string;
|
|
25
|
+
paymentSubtotal?: string;
|
|
26
|
+
paymentCurrency?: string;
|
|
27
|
+
purchaseAmount?: string;
|
|
28
|
+
purchaseCurrency?: string;
|
|
29
|
+
fees?: CoinbaseHeadlessFee[];
|
|
30
|
+
exchangeRate?: string;
|
|
31
|
+
destinationAddress?: string;
|
|
32
|
+
destinationNetwork?: string;
|
|
33
|
+
status?: string;
|
|
34
|
+
txHash?: string;
|
|
35
|
+
};
|
|
36
|
+
paymentLink?: {
|
|
37
|
+
url?: string;
|
|
38
|
+
paymentLinkType?: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=headlessOnRamp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headlessOnRamp.d.ts","sourceRoot":"","sources":["../../../src/types/headlessOnRamp.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,2BAA2B,GAAG;IAExC,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cA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|
|
1
1
|
export * from './assets.js';
|
|
2
2
|
export * from './auth.js';
|
|
3
|
+
export * from './headlessOnRamp.js';
|
|
3
4
|
export * from './authFactor.js';
|
|
4
5
|
export * from './authState.js';
|
|
5
6
|
export * from './modal.js';
|
|
6
7
|
export * from './otp.js';
|
|
7
8
|
export * from './params.js';
|
|
8
9
|
export * from './partner.js';
|
|
10
|
+
export * from './sdkCapabilities.js';
|
|
9
11
|
export * from './partnerAppConfig.js';
|
|
10
12
|
export * from './pending-transaction.js';
|
|
11
13
|
export * from './permissions.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BalancesConfig, OnRampAssets, OnRampProvider } from './assets';
|
|
1
|
+
import { BalancesConfig, OnRampAssets, OnRampProvider, OnRampSelectionMode } from './assets';
|
|
2
2
|
import { AuthMethod, SupportedAccountLinks } from './auth';
|
|
3
3
|
import { DeliveryChannel } from './otp';
|
|
4
4
|
import { SupportedWalletTypes } from './wallet';
|
|
@@ -49,6 +49,8 @@ export interface IPartnerEntity {
|
|
|
49
49
|
supportedAccountLinks?: SupportedAccountLinks;
|
|
50
50
|
onRampAssets?: OnRampAssets | null;
|
|
51
51
|
onRampProviders?: OnRampProvider[];
|
|
52
|
+
onRampSelectionMode?: OnRampSelectionMode;
|
|
53
|
+
defaultOnRampAssetImplementationId?: string | null;
|
|
52
54
|
ipAllowlistCidrs?: string[];
|
|
53
55
|
balancesConfig?: BalancesConfig;
|
|
54
56
|
internationalPrimaryChannel?: DeliveryChannel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partner.d.ts","sourceRoot":"","sources":["../../../src/types/partner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"partner.d.ts","sourceRoot":"","sources":["../../../src/types/partner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAC3D,OAAO,EAAE,eAAe,E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AAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC;AAE7C,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const SDK_CAPABILITIES_HEADER = "x-para-capabilities";
|
|
2
|
+
export declare enum SdkCapability {
|
|
3
|
+
OnRampCatalog = "onramp-catalog",
|
|
4
|
+
CdpHeadless = "cdp-headless"
|
|
5
|
+
}
|
|
6
|
+
/** Serialize a build's supported capabilities into the header value (comma-separated tokens). */
|
|
7
|
+
export declare function serializeCapabilities(capabilities: SdkCapability[]): string;
|
|
8
|
+
/**
|
|
9
|
+
* Parse the capabilities header into the set of KNOWN capabilities the client advertised. Unknown tokens
|
|
10
|
+
* (e.g. a newer SDK advertising a capability this server doesn't understand yet) are ignored.
|
|
11
|
+
*/
|
|
12
|
+
export declare function parseCapabilities(header?: string | null): Set<SdkCapability>;
|
|
13
|
+
//# sourceMappingURL=sdkCapabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdkCapabilities.d.ts","sourceRoot":"","sources":["../../../src/types/sdkCapabilities.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,uBAAuB,wBAAwB,CAAC;AAE7D,oBAAY,aAAa;IAGvB,aAAa,mBAAmB;IAIhC,WAAW,iBAAiB;CAC7B;AAID,iGAAiG;AACjG,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,aAAa,EAAE,GAAG,MAAM,CAE3E;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,GAAG,CAAC,aAAa,CAAC,CAQ5E"}
|