@fun-xyz/fiat-contract 0.46.0 → 0.47.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/README.md +10 -0
- package/dist/{chunk-IAKK466V.mjs → chunk-JMJ45E27.mjs} +1 -1
- package/dist/chunk-LTJWGDSA.mjs +0 -0
- package/dist/{chunk-2CCO7UIS.mjs → chunk-TIQALG7X.mjs} +2 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +131 -63
- package/dist/index.mjs +131 -63
- package/dist/providers/moonpay-guest.d.ts +12 -0
- package/dist/providers/moonpay-guest.js +18 -0
- package/dist/providers/moonpay-guest.mjs +1 -0
- package/dist/providers/moonpay-guest.schemas.d.ts +36 -0
- package/dist/providers/moonpay.d.ts +45 -16
- package/dist/providers/moonpay.schemas.d.ts +5 -2
- package/dist/routing.d.ts +2 -8
- package/dist/schemas.d.ts +1 -2
- package/dist/table.js +1 -1
- package/dist/table.mjs +1 -1
- package/dist/terms.js +2 -1
- package/dist/terms.mjs +1 -1
- package/dist/types.d.ts +3 -13
- package/package.json +10 -2
|
@@ -3,10 +3,9 @@
|
|
|
3
3
|
* exported from the package root, never from `./moonpay`, so the production entry stays free of zod.
|
|
4
4
|
*/
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
import type { MoonPayCaptureDocument, MoonPayCaptureNextAction, MoonPayCaptureRequest, MoonPayCheckout, MoonPayConnectNextAction, MoonPayConnectRequest, MoonPayConsentNextAction, MoonPayConsentRequest, MoonPayDeclineRequest, MoonPayDone, MoonPayErrorBody, MoonPayFault, MoonPayGuestDeclineReason, MoonPayKycNextAction, MoonPayKycRequest, MoonPayNextRequest, MoonPayObserveRequest, MoonPayOrderNextAction, MoonPayOrderPendingNextAction, MoonPayOrderRequest, MoonPayOrderResponse,
|
|
6
|
+
import type { MoonPayCaptureDocument, MoonPayCaptureNextAction, MoonPayCaptureRequest, MoonPayCheckout, MoonPayConnectNextAction, MoonPayConnectRequest, MoonPayConsentNextAction, MoonPayConsentRequest, MoonPayDeclineRequest, MoonPayDone, MoonPayErrorBody, MoonPayFault, MoonPayGuestDeclineReason, MoonPayKycNextAction, MoonPayKycRequest, MoonPayNextRequest, MoonPayObserveRequest, MoonPayOrderNextAction, MoonPayOrderPendingNextAction, MoonPayOrderRequest, MoonPayOrderResponse, MoonPayPayNextAction, MoonPayPhoneCodeNextAction, MoonPayPhoneCodeRequest, MoonPayPhoneNextAction, MoonPayPhoneRequest, MoonPayPrepareCaptureNextAction, MoonPayPrepareCaptureRequest, MoonPayReask, MoonPayReaskReason, MoonPayReaskRequirement, MoonPayNextAction, MoonPayQuoteInput, MoonPayRequest, MoonPayRequestContext, MoonPayResponseFor, MoonPaySdkCredentials, MoonPaySessionNextAction, MoonPaySessionRequest, MoonPayStepResponse, MoonPayWaitNextAction } from './moonpay';
|
|
7
7
|
export declare const MoonPayCheckoutSchema: z.ZodType<MoonPayCheckout>;
|
|
8
8
|
export declare const MoonPaySdkCredentialsSchema: z.ZodType<MoonPaySdkCredentials>;
|
|
9
|
-
export declare const MoonPayPathSchema: z.ZodType<MoonPayPath>;
|
|
10
9
|
export declare const MoonPayRequestContextSchema: z.ZodType<MoonPayRequestContext>;
|
|
11
10
|
export declare const MoonPayQuoteInputSchema: z.ZodType<MoonPayQuoteInput>;
|
|
12
11
|
export declare const MoonPayGuestDeclineReasonSchema: z.ZodType<MoonPayGuestDeclineReason>;
|
|
@@ -14,6 +13,8 @@ export declare const MoonPayObserveRequestSchema: z.ZodType<MoonPayRequestContex
|
|
|
14
13
|
export declare const MoonPayConsentRequestSchema: z.ZodType<MoonPayRequestContext & MoonPayConsentRequest>;
|
|
15
14
|
export declare const MoonPaySessionRequestSchema: z.ZodType<MoonPayRequestContext & MoonPaySessionRequest>;
|
|
16
15
|
export declare const MoonPayConnectRequestSchema: z.ZodType<MoonPayRequestContext & MoonPayConnectRequest>;
|
|
16
|
+
export declare const MoonPayPhoneRequestSchema: z.ZodType<MoonPayRequestContext & MoonPayPhoneRequest>;
|
|
17
|
+
export declare const MoonPayPhoneCodeRequestSchema: z.ZodType<MoonPayRequestContext & MoonPayPhoneCodeRequest>;
|
|
17
18
|
export declare const MoonPayDeclineRequestSchema: z.ZodType<MoonPayRequestContext & MoonPayDeclineRequest>;
|
|
18
19
|
export declare const MoonPayKycRequestSchema: z.ZodType<MoonPayRequestContext & MoonPayKycRequest>;
|
|
19
20
|
export declare const MoonPayPrepareCaptureRequestSchema: z.ZodType<MoonPayRequestContext & MoonPayPrepareCaptureRequest>;
|
|
@@ -24,6 +25,8 @@ export declare const MoonPayNextRequestSchema: z.ZodType<MoonPayNextRequest>;
|
|
|
24
25
|
export declare const MoonPayConsentNextActionSchema: z.ZodType<MoonPayConsentNextAction>;
|
|
25
26
|
export declare const MoonPaySessionNextActionSchema: z.ZodType<MoonPaySessionNextAction>;
|
|
26
27
|
export declare const MoonPayConnectNextActionSchema: z.ZodType<MoonPayConnectNextAction>;
|
|
28
|
+
export declare const MoonPayPhoneNextActionSchema: z.ZodType<MoonPayPhoneNextAction>;
|
|
29
|
+
export declare const MoonPayPhoneCodeNextActionSchema: z.ZodType<MoonPayPhoneCodeNextAction>;
|
|
27
30
|
export declare const MoonPayPayNextActionSchema: z.ZodType<MoonPayPayNextAction>;
|
|
28
31
|
export declare const MoonPayKycNextActionSchema: z.ZodType<MoonPayKycNextAction>;
|
|
29
32
|
export declare const MoonPayPrepareCaptureNextActionSchema: z.ZodType<MoonPayPrepareCaptureNextAction>;
|
package/dist/routing.d.ts
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* an extra key or a blank string fails them, so send only the declared fields.
|
|
22
22
|
*/
|
|
23
23
|
import type { CountryCode, FiatCurrencyCode, PaymentMethodCategory } from './codes';
|
|
24
|
-
import type { FiatAmount, DestinationAsset,
|
|
24
|
+
import type { FiatAmount, DestinationAsset, FiatProvider, QuoteLimitRange } from './types';
|
|
25
25
|
export declare const ROUTING_ENDPOINTS: {
|
|
26
26
|
readonly table: "POST /fiat/routing/table";
|
|
27
27
|
/** Temporary: `POST /fiat/next` replaces it for each provider that moves there. */
|
|
@@ -81,7 +81,7 @@ export type RoutingVisibility = 'COMPLETE' | 'PARTIAL' | 'AUTH_GATED';
|
|
|
81
81
|
*/
|
|
82
82
|
export type RoutingUnavailableReason = 'USER_LIMIT' | 'KYC_REJECTED' | 'PROVIDER_OUTAGE' | 'NOT_SERVED';
|
|
83
83
|
/** The providers the backend can route and take an order through. */
|
|
84
|
-
export type RoutingProvider = Extract<FiatProvider, 'TRANSAK' | 'BANXA' | 'MOONPAY' | 'STRIPE' | 'COINBASE'>;
|
|
84
|
+
export type RoutingProvider = Extract<FiatProvider, 'TRANSAK' | 'BANXA' | 'MOONPAY' | 'MOONPAY_GUEST' | 'STRIPE' | 'COINBASE'>;
|
|
85
85
|
export interface RoutingTableProvider {
|
|
86
86
|
provider: RoutingProvider;
|
|
87
87
|
next: RoutingNextStep;
|
|
@@ -162,12 +162,6 @@ export interface FiatRoutingQuoteTerms {
|
|
|
162
162
|
* (conversion routes, fee subsidy); placing an order still requires a Fun session.
|
|
163
163
|
*/
|
|
164
164
|
depositAddress?: string;
|
|
165
|
-
/**
|
|
166
|
-
* Provider paths this client can run, each at most once. Routing considers such a path only when it is
|
|
167
|
-
* listed, and a quote that picks one carries `handoff.path`. Leave a path out of the requote after its
|
|
168
|
-
* flow answers `refused` with `REQUOTE`, so routing can still pick the provider's other paths.
|
|
169
|
-
*/
|
|
170
|
-
handoffPaths?: FiatHandoffPath[];
|
|
171
165
|
}
|
|
172
166
|
/**
|
|
173
167
|
* `POST /fiat/routing/quote`: the terms plus which providers to price, in one of two forms.
|
package/dist/schemas.d.ts
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
*/
|
|
29
29
|
import { z } from 'zod';
|
|
30
30
|
import type { UsStateCode } from './codes';
|
|
31
|
-
import type { BlockedReason, CryptoAmount, FailureReason, FeeLine, FiatAmount, FiatEndpoint,
|
|
31
|
+
import type { BlockedReason, CryptoAmount, FailureReason, FeeLine, FiatAmount, FiatEndpoint, FiatProvider, FiatAuthRefreshRequest, FiatAuthRefreshResponse, FiatAuthRevokeRequest, FiatAuthStartRequest, FiatAuthVerifyRequest, FiatSession, FiatStepResponse, FieldSpec, FlowState, FormDescriptor, FormField, FormFieldType, InstructionField, Instructions, Instrument, JsonValue, KYCProvider, KycReviewDuration, OrderRef, OrderStatus, OrderSummary, PollSpec, PreparedPayment, PaymentSurface, Quote, QuoteLimitRange, QuoteLimits, Recovery, Refund, ReportSpec, SelectOption, StatusHistoryEntry, Surface, PreferredIdentityDocument, KycFieldId, ClientExecutedDelivery, KycSdkResultReport, SurfaceKind, SurfaceProvider, TermsAcceptance, Transition, TransitionInputs, TransitionParams, Tx, DestinationAsset, FiatGeo, FiatNextRequest } from './types';
|
|
32
32
|
import type { FiatTermsErrorBody, FiatTermsRequest, FiatTermsResponse, TermsDocument, TermsDocumentAcceptance } from './terms';
|
|
33
33
|
import type { FiatRoutingQuoteErrorBody, FiatRoutingQuoteRequest, FiatRoutingQuoteTerms, FiatRoutingTableErrorBody, FiatRoutingTableRequest, FiatRoutingTableResponse } from './routing';
|
|
34
34
|
export declare const JsonSchema: z.ZodType<JsonValue>;
|
|
@@ -38,7 +38,6 @@ export declare const ENDPOINT_PATTERN: RegExp;
|
|
|
38
38
|
export declare const FiatEndpointSchema: z.ZodType<FiatEndpoint>;
|
|
39
39
|
export declare const UsStateCodeSchema: z.ZodType<UsStateCode>;
|
|
40
40
|
export declare const FiatProviderSchema: z.ZodType<FiatProvider>;
|
|
41
|
-
export declare const FiatHandoffPathSchema: z.ZodType<FiatHandoffPath>;
|
|
42
41
|
export declare const KYCProviderSchema: z.ZodType<KYCProvider>;
|
|
43
42
|
export declare const SurfaceProviderSchema: z.ZodType<SurfaceProvider>;
|
|
44
43
|
export declare const OrderStatusSchema: z.ZodType<OrderStatus>;
|
package/dist/table.js
CHANGED
package/dist/table.mjs
CHANGED
package/dist/terms.js
CHANGED
|
@@ -60,7 +60,8 @@ var MOONPAY_KYC_SHARING = {
|
|
|
60
60
|
links: [{ label: "Persona Privacy Policy", url: "https://withpersona.com/legal/privacy-policy" }]
|
|
61
61
|
};
|
|
62
62
|
var PROVIDER_CHECKOUT_DOCUMENTS = {
|
|
63
|
-
MOONPAY: [MOONPAY_TERMS]
|
|
63
|
+
MOONPAY: [MOONPAY_TERMS],
|
|
64
|
+
MOONPAY_GUEST: [MOONPAY_TERMS]
|
|
64
65
|
};
|
|
65
66
|
var PROVIDER_KYC_DOCUMENTS = {
|
|
66
67
|
MOONPAY: [MOONPAY_KYC_SHARING]
|
package/dist/terms.mjs
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export type FiatEndpoint = 'GET /fiat/payment-methods' | 'POST /fiat/quote' | 'P
|
|
|
61
61
|
* Routing metadata, not sequencing policy. Reserved values may be emitted only after their adapter
|
|
62
62
|
* and conformance fixture land.
|
|
63
63
|
*/
|
|
64
|
-
export type FiatProvider = 'TRANSAK' | 'SWAPPED' | 'BANXA' | 'MOONPAY' | 'STRIPE' | 'COINBASE' | 'CROSSMINT';
|
|
64
|
+
export type FiatProvider = 'TRANSAK' | 'SWAPPED' | 'BANXA' | 'MOONPAY' | 'MOONPAY_GUEST' | 'STRIPE' | 'COINBASE' | 'CROSSMINT';
|
|
65
65
|
/**
|
|
66
66
|
* The order status vocabulary. Monotonic ranks, no backwards moves. Terminal outcomes are
|
|
67
67
|
* OrderStatus, never FlowState kinds.
|
|
@@ -830,23 +830,13 @@ export type FiatStepResponse = (FiatStepResponseBase & {
|
|
|
830
830
|
preparedPayment?: PreparedPayment;
|
|
831
831
|
/**
|
|
832
832
|
* The provider runs its own flow from here (`POST /fiat/next`). Present
|
|
833
|
-
* only on a `QUOTE
|
|
834
|
-
* carries no transitions.
|
|
835
|
-
* (`guest_checkout` for `MOONPAY/guest_checkout`); the client sends it on every `/fiat/next` request.
|
|
833
|
+
* only on a `QUOTE` selected for a provider-owned checkout flow; the response then
|
|
834
|
+
* carries no transitions. The selected provider owns the flow on `/fiat/next`.
|
|
836
835
|
*/
|
|
837
836
|
handoff?: {
|
|
838
837
|
provider: FiatProvider;
|
|
839
|
-
path?: FiatHandoffPathName;
|
|
840
838
|
};
|
|
841
839
|
});
|
|
842
|
-
/**
|
|
843
|
-
* A provider path the client can run, offered on the quote request in `handoffPaths`. Routing considers
|
|
844
|
-
* a path listed here only when the request offers it, so leaving it out of a requote excludes that path
|
|
845
|
-
* alone and keeps its provider's other paths.
|
|
846
|
-
*/
|
|
847
|
-
export type FiatHandoffPath = 'MOONPAY/guest_checkout';
|
|
848
|
-
/** The path part of a `FiatHandoffPath`, as `handoff.path` names it. */
|
|
849
|
-
export type FiatHandoffPathName = FiatHandoffPath extends `${string}/${infer Path}` ? Path : never;
|
|
850
840
|
/**
|
|
851
841
|
* The asset the user receives at the end of the purchase. The client always sends it. The backend
|
|
852
842
|
* compares it with the partner's configured asset and adds a conversion only when they differ,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fun-xyz/fiat-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.0",
|
|
4
4
|
"description": "Published conformance contract for Fun's headless fiat onramp: FlowState/Transition types, zod schemas, the transition table as data, recorded fixtures, assertion helpers.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -48,7 +48,12 @@
|
|
|
48
48
|
"import": "./dist/routing.mjs",
|
|
49
49
|
"require": "./dist/routing.js"
|
|
50
50
|
},
|
|
51
|
-
"./package.json": "./package.json"
|
|
51
|
+
"./package.json": "./package.json",
|
|
52
|
+
"./moonpay-guest": {
|
|
53
|
+
"types": "./dist/providers/moonpay-guest.d.ts",
|
|
54
|
+
"import": "./dist/providers/moonpay-guest.mjs",
|
|
55
|
+
"require": "./dist/providers/moonpay-guest.js"
|
|
56
|
+
}
|
|
52
57
|
},
|
|
53
58
|
"files": [
|
|
54
59
|
"dist",
|
|
@@ -113,6 +118,9 @@
|
|
|
113
118
|
],
|
|
114
119
|
"routing": [
|
|
115
120
|
"./dist/routing.d.ts"
|
|
121
|
+
],
|
|
122
|
+
"moonpay-guest": [
|
|
123
|
+
"./dist/providers/moonpay-guest.d.ts"
|
|
116
124
|
]
|
|
117
125
|
}
|
|
118
126
|
}
|