@oasisprotocol/privana-sdk 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-ACLJPC75.cjs → chunk-UHXVYWTF.cjs} +936 -20
- package/dist/chunk-UHXVYWTF.cjs.map +1 -0
- package/dist/{chunk-54FC6TO3.js → chunk-ZVUMV4NR.js} +907 -23
- package/dist/chunk-ZVUMV4NR.js.map +1 -0
- package/dist/index.cjs +823 -538
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +58 -341
- package/dist/index.d.ts +58 -341
- package/dist/index.js +532 -334
- package/dist/index.js.map +1 -1
- package/dist/on-ramp.cjs +3 -3
- package/dist/on-ramp.d.cts +40 -4
- package/dist/on-ramp.d.ts +40 -4
- package/dist/on-ramp.js +1 -1
- package/dist/pending-lock-BdkuMjmY.d.cts +600 -0
- package/dist/pending-lock-BdkuMjmY.d.ts +600 -0
- package/package.json +1 -1
- package/dist/chunk-54FC6TO3.js.map +0 -1
- package/dist/chunk-ACLJPC75.cjs.map +0 -1
- package/dist/on-ramp-XLXsy0aI.d.cts +0 -130
- package/dist/on-ramp-XLXsy0aI.d.ts +0 -130
package/dist/on-ramp.cjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkUHXVYWTF_cjs = require('./chunk-UHXVYWTF.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "FiatOnRampForm", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkUHXVYWTF_cjs.FiatOnRampForm; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "useFiatOnRamp", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkUHXVYWTF_cjs.useFiatOnRamp; }
|
|
15
15
|
});
|
|
16
16
|
//# sourceMappingURL=on-ramp.cjs.map
|
|
17
17
|
//# sourceMappingURL=on-ramp.cjs.map
|
package/dist/on-ramp.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { MoonPayBuyWidget } from '@moonpay/moonpay-react';
|
|
2
|
-
import { B as Bytes32,
|
|
3
|
-
export { C as CreateOnRampIntentRequest,
|
|
2
|
+
import { B as Bytes32, _ as OnRampPostDepositLockConfig, d as TransactionSubmissionResponse, e as PostDepositLockError, $ as OnRampRecord, T as TokenConfig } from './pending-lock-BdkuMjmY.cjs';
|
|
3
|
+
export { C as CreateOnRampIntentRequest, m as CreateOnRampIntentResponse, a0 as OnRampStatus, a3 as PendingOnRampsResponse, a7 as SignOnRampUrlRequest, a8 as SignOnRampUrlResponse, al as UpdateOnRampRequest, am as UpdateOnRampResponse } from './pending-lock-BdkuMjmY.cjs';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
+
import 'viem';
|
|
5
6
|
|
|
6
7
|
type MoonPayBuyProps = Parameters<typeof MoonPayBuyWidget>[0];
|
|
7
8
|
type OnTransactionCompletedProps = Parameters<NonNullable<MoonPayBuyProps['onTransactionCompleted']>>[0];
|
|
@@ -24,8 +25,22 @@ interface FiatOnRampDebugEvent {
|
|
|
24
25
|
interface UseFiatOnRampOptions {
|
|
25
26
|
/** Privana token the on-ramp will deposit into. */
|
|
26
27
|
tokenId: Bytes32;
|
|
28
|
+
/**
|
|
29
|
+
* Pre-sign a `Lock` for the buffered quote amount when the intent is
|
|
30
|
+
* created; the SDK submits it once the delivered deposit credits. Requires
|
|
31
|
+
* `prepareOnRampIntent` to be called with `quoteCurrencyAmount`.
|
|
32
|
+
*/
|
|
33
|
+
postDepositLock?: OnRampPostDepositLockConfig;
|
|
27
34
|
/** Fired when the deposit is credited inside the Privana accounting module. */
|
|
28
35
|
onCredited?: (txHash: string) => void;
|
|
36
|
+
/** Fired when the pre-signed post-deposit lock is accepted by the API. */
|
|
37
|
+
onLockSubmitted?: (response: TransactionSubmissionResponse) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Fired when the deposit credited but the pre-signed lock could not be
|
|
40
|
+
* submitted. The funds sit in the user's available balance — re-prompt a
|
|
41
|
+
* fresh lock signature at the credited amount. Falls back to `onError`.
|
|
42
|
+
*/
|
|
43
|
+
onLockFailed?: (error: PostDepositLockError) => void;
|
|
29
44
|
onError?: (error: Error) => void;
|
|
30
45
|
/** Optional diagnostic event stream for previews/tests. No auth tokens or signatures are emitted. */
|
|
31
46
|
onDebugEvent?: (event: FiatOnRampDebugEvent) => void;
|
|
@@ -84,6 +99,12 @@ interface UseFiatOnRampResult {
|
|
|
84
99
|
currencyCode: string;
|
|
85
100
|
baseCurrencyCode?: string;
|
|
86
101
|
baseCurrencyAmount?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Exact crypto amount (human units) the purchase targets — the same value
|
|
104
|
+
* passed to the widget as `quoteCurrencyAmount`. Required when
|
|
105
|
+
* `postDepositLock` is set: the signed lock amount derives from it.
|
|
106
|
+
*/
|
|
107
|
+
quoteCurrencyAmount?: string;
|
|
87
108
|
}) => Promise<OnRampRecord>;
|
|
88
109
|
/** Wire to `<MoonPayBuyWidget onUrlSignatureRequested>`. */
|
|
89
110
|
signUrl: (url: string) => Promise<string>;
|
|
@@ -136,6 +157,12 @@ interface FiatOnRampFormProps {
|
|
|
136
157
|
baseCurrencyCode?: string;
|
|
137
158
|
/** Pre-filled fiat amount the user can still edit in MoonPay (default: '100'). */
|
|
138
159
|
defaultBaseCurrencyAmount?: string;
|
|
160
|
+
/**
|
|
161
|
+
* Exact crypto amount (human units) the purchase should deliver. Takes
|
|
162
|
+
* precedence over `defaultBaseCurrencyAmount` inside MoonPay. Required when
|
|
163
|
+
* `postDepositLock` is set.
|
|
164
|
+
*/
|
|
165
|
+
quoteCurrencyAmount?: string;
|
|
139
166
|
/** Override the display symbol. Defaults to the resolved token's symbol, then `currencyCode`. */
|
|
140
167
|
tokenSymbol?: string;
|
|
141
168
|
/** Enable dark mode or light mode as the default appearance for the widget. Possible values are dark, light. */
|
|
@@ -163,12 +190,21 @@ interface FiatOnRampFormProps {
|
|
|
163
190
|
lockAmount?: boolean;
|
|
164
191
|
/** Pre-selects a payment method tab in MoonPay */
|
|
165
192
|
paymentMethod?: string;
|
|
193
|
+
/**
|
|
194
|
+
* Pre-sign a `Lock` for the buffered `quoteCurrencyAmount` before the
|
|
195
|
+
* purchase; the SDK submits it once the delivered deposit credits.
|
|
196
|
+
*/
|
|
197
|
+
postDepositLock?: OnRampPostDepositLockConfig;
|
|
166
198
|
/** Fired when the resulting Privana deposit is credited. */
|
|
167
199
|
onCredited?: (depositTxHash: string) => void;
|
|
200
|
+
/** Fired when the pre-signed post-deposit lock is accepted by the API. */
|
|
201
|
+
onLockSubmitted?: (response: TransactionSubmissionResponse) => void;
|
|
202
|
+
/** Fired when the deposit credited but the pre-signed lock failed — re-prompt. */
|
|
203
|
+
onLockFailed?: (error: PostDepositLockError) => void;
|
|
168
204
|
onError?: (error: Error) => void;
|
|
169
205
|
/** Optional diagnostic event stream for previews/tests. */
|
|
170
206
|
onDebugEvent?: (event: FiatOnRampDebugEvent) => void;
|
|
171
207
|
}
|
|
172
|
-
declare function FiatOnRampForm({ tokenId, currencyCode, baseCurrencyCode, defaultBaseCurrencyAmount, tokenSymbol, theme, themeId, colorCode, variant, autoStart, lockAmount, paymentMethod, onCredited, onError, onDebugEvent, }: FiatOnRampFormProps): react_jsx_runtime.JSX.Element;
|
|
208
|
+
declare function FiatOnRampForm({ tokenId, currencyCode, baseCurrencyCode, defaultBaseCurrencyAmount, quoteCurrencyAmount, tokenSymbol, theme, themeId, colorCode, variant, autoStart, lockAmount, paymentMethod, postDepositLock, onCredited, onLockSubmitted, onLockFailed, onError, onDebugEvent, }: FiatOnRampFormProps): react_jsx_runtime.JSX.Element;
|
|
173
209
|
|
|
174
|
-
export { type FiatOnRampDebugEvent, FiatOnRampForm, type FiatOnRampFormProps, type FiatOnRampStatus, OnRampRecord, type UseFiatOnRampOptions, type UseFiatOnRampResult, useFiatOnRamp };
|
|
210
|
+
export { type FiatOnRampDebugEvent, FiatOnRampForm, type FiatOnRampFormProps, type FiatOnRampStatus, OnRampPostDepositLockConfig, OnRampRecord, type UseFiatOnRampOptions, type UseFiatOnRampResult, useFiatOnRamp };
|
package/dist/on-ramp.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { MoonPayBuyWidget } from '@moonpay/moonpay-react';
|
|
2
|
-
import { B as Bytes32,
|
|
3
|
-
export { C as CreateOnRampIntentRequest,
|
|
2
|
+
import { B as Bytes32, _ as OnRampPostDepositLockConfig, d as TransactionSubmissionResponse, e as PostDepositLockError, $ as OnRampRecord, T as TokenConfig } from './pending-lock-BdkuMjmY.js';
|
|
3
|
+
export { C as CreateOnRampIntentRequest, m as CreateOnRampIntentResponse, a0 as OnRampStatus, a3 as PendingOnRampsResponse, a7 as SignOnRampUrlRequest, a8 as SignOnRampUrlResponse, al as UpdateOnRampRequest, am as UpdateOnRampResponse } from './pending-lock-BdkuMjmY.js';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
+
import 'viem';
|
|
5
6
|
|
|
6
7
|
type MoonPayBuyProps = Parameters<typeof MoonPayBuyWidget>[0];
|
|
7
8
|
type OnTransactionCompletedProps = Parameters<NonNullable<MoonPayBuyProps['onTransactionCompleted']>>[0];
|
|
@@ -24,8 +25,22 @@ interface FiatOnRampDebugEvent {
|
|
|
24
25
|
interface UseFiatOnRampOptions {
|
|
25
26
|
/** Privana token the on-ramp will deposit into. */
|
|
26
27
|
tokenId: Bytes32;
|
|
28
|
+
/**
|
|
29
|
+
* Pre-sign a `Lock` for the buffered quote amount when the intent is
|
|
30
|
+
* created; the SDK submits it once the delivered deposit credits. Requires
|
|
31
|
+
* `prepareOnRampIntent` to be called with `quoteCurrencyAmount`.
|
|
32
|
+
*/
|
|
33
|
+
postDepositLock?: OnRampPostDepositLockConfig;
|
|
27
34
|
/** Fired when the deposit is credited inside the Privana accounting module. */
|
|
28
35
|
onCredited?: (txHash: string) => void;
|
|
36
|
+
/** Fired when the pre-signed post-deposit lock is accepted by the API. */
|
|
37
|
+
onLockSubmitted?: (response: TransactionSubmissionResponse) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Fired when the deposit credited but the pre-signed lock could not be
|
|
40
|
+
* submitted. The funds sit in the user's available balance — re-prompt a
|
|
41
|
+
* fresh lock signature at the credited amount. Falls back to `onError`.
|
|
42
|
+
*/
|
|
43
|
+
onLockFailed?: (error: PostDepositLockError) => void;
|
|
29
44
|
onError?: (error: Error) => void;
|
|
30
45
|
/** Optional diagnostic event stream for previews/tests. No auth tokens or signatures are emitted. */
|
|
31
46
|
onDebugEvent?: (event: FiatOnRampDebugEvent) => void;
|
|
@@ -84,6 +99,12 @@ interface UseFiatOnRampResult {
|
|
|
84
99
|
currencyCode: string;
|
|
85
100
|
baseCurrencyCode?: string;
|
|
86
101
|
baseCurrencyAmount?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Exact crypto amount (human units) the purchase targets — the same value
|
|
104
|
+
* passed to the widget as `quoteCurrencyAmount`. Required when
|
|
105
|
+
* `postDepositLock` is set: the signed lock amount derives from it.
|
|
106
|
+
*/
|
|
107
|
+
quoteCurrencyAmount?: string;
|
|
87
108
|
}) => Promise<OnRampRecord>;
|
|
88
109
|
/** Wire to `<MoonPayBuyWidget onUrlSignatureRequested>`. */
|
|
89
110
|
signUrl: (url: string) => Promise<string>;
|
|
@@ -136,6 +157,12 @@ interface FiatOnRampFormProps {
|
|
|
136
157
|
baseCurrencyCode?: string;
|
|
137
158
|
/** Pre-filled fiat amount the user can still edit in MoonPay (default: '100'). */
|
|
138
159
|
defaultBaseCurrencyAmount?: string;
|
|
160
|
+
/**
|
|
161
|
+
* Exact crypto amount (human units) the purchase should deliver. Takes
|
|
162
|
+
* precedence over `defaultBaseCurrencyAmount` inside MoonPay. Required when
|
|
163
|
+
* `postDepositLock` is set.
|
|
164
|
+
*/
|
|
165
|
+
quoteCurrencyAmount?: string;
|
|
139
166
|
/** Override the display symbol. Defaults to the resolved token's symbol, then `currencyCode`. */
|
|
140
167
|
tokenSymbol?: string;
|
|
141
168
|
/** Enable dark mode or light mode as the default appearance for the widget. Possible values are dark, light. */
|
|
@@ -163,12 +190,21 @@ interface FiatOnRampFormProps {
|
|
|
163
190
|
lockAmount?: boolean;
|
|
164
191
|
/** Pre-selects a payment method tab in MoonPay */
|
|
165
192
|
paymentMethod?: string;
|
|
193
|
+
/**
|
|
194
|
+
* Pre-sign a `Lock` for the buffered `quoteCurrencyAmount` before the
|
|
195
|
+
* purchase; the SDK submits it once the delivered deposit credits.
|
|
196
|
+
*/
|
|
197
|
+
postDepositLock?: OnRampPostDepositLockConfig;
|
|
166
198
|
/** Fired when the resulting Privana deposit is credited. */
|
|
167
199
|
onCredited?: (depositTxHash: string) => void;
|
|
200
|
+
/** Fired when the pre-signed post-deposit lock is accepted by the API. */
|
|
201
|
+
onLockSubmitted?: (response: TransactionSubmissionResponse) => void;
|
|
202
|
+
/** Fired when the deposit credited but the pre-signed lock failed — re-prompt. */
|
|
203
|
+
onLockFailed?: (error: PostDepositLockError) => void;
|
|
168
204
|
onError?: (error: Error) => void;
|
|
169
205
|
/** Optional diagnostic event stream for previews/tests. */
|
|
170
206
|
onDebugEvent?: (event: FiatOnRampDebugEvent) => void;
|
|
171
207
|
}
|
|
172
|
-
declare function FiatOnRampForm({ tokenId, currencyCode, baseCurrencyCode, defaultBaseCurrencyAmount, tokenSymbol, theme, themeId, colorCode, variant, autoStart, lockAmount, paymentMethod, onCredited, onError, onDebugEvent, }: FiatOnRampFormProps): react_jsx_runtime.JSX.Element;
|
|
208
|
+
declare function FiatOnRampForm({ tokenId, currencyCode, baseCurrencyCode, defaultBaseCurrencyAmount, quoteCurrencyAmount, tokenSymbol, theme, themeId, colorCode, variant, autoStart, lockAmount, paymentMethod, postDepositLock, onCredited, onLockSubmitted, onLockFailed, onError, onDebugEvent, }: FiatOnRampFormProps): react_jsx_runtime.JSX.Element;
|
|
173
209
|
|
|
174
|
-
export { type FiatOnRampDebugEvent, FiatOnRampForm, type FiatOnRampFormProps, type FiatOnRampStatus, OnRampRecord, type UseFiatOnRampOptions, type UseFiatOnRampResult, useFiatOnRamp };
|
|
210
|
+
export { type FiatOnRampDebugEvent, FiatOnRampForm, type FiatOnRampFormProps, type FiatOnRampStatus, OnRampPostDepositLockConfig, OnRampRecord, type UseFiatOnRampOptions, type UseFiatOnRampResult, useFiatOnRamp };
|
package/dist/on-ramp.js
CHANGED