@lydianpay/sdk-web 3.11.1 → 3.12.1
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/chunks/{index-yBc__sNu.js → index--ad5-TxB.js} +1 -1
- package/dist/chunks/{index-_1SWeIak.js → index-SPRFpU-C.js} +1 -1
- package/dist/chunks/{metamask-sdk-k1-bmOi5.js → metamask-sdk-ECy5wqL0.js} +1 -1
- package/dist/chunks/{mountEngine-CKULCf3Q.js → mountEngine-D6tvuIMZ.js} +9097 -8845
- package/dist/lydian.js +1 -1
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/services/lydianConnectService.d.ts +3 -2
- package/dist/types/ui/checkoutSessionRecord.d.ts +18 -0
- package/dist/types/ui/sessionHelpers.d.ts +2 -0
- package/dist/types/ui/walletConnection.d.ts +13 -2
- package/dist/types/ui/walletHandoff.d.ts +17 -0
- package/dist/types/ui/walletPaymentInFlight.d.ts +22 -0
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type ConnectInput, type Connection } from '@lydianpay/lydianconnect';
|
|
1
|
+
import { type ConnectInput, type Connection, type RestoreInput } from '@lydianpay/lydianconnect';
|
|
2
2
|
export type WalletEventHandlers = {
|
|
3
|
-
onDisplayUri?: (uri: string, deepLink: boolean) => void;
|
|
3
|
+
onDisplayUri?: (uri: string, deepLink: boolean, walletId: string) => void;
|
|
4
4
|
onDisconnect?: (walletId: string) => void;
|
|
5
5
|
onChainChanged?: (walletId: string, chainId: string) => void;
|
|
6
6
|
onAccountsChanged?: (walletId: string, account: string) => void;
|
|
@@ -16,6 +16,7 @@ export declare class LydianConnectService {
|
|
|
16
16
|
init(walletConnectProjectId: string, handlers: WalletEventHandlers): Promise<void>;
|
|
17
17
|
private dispatch;
|
|
18
18
|
connect(input: ConnectInput): Promise<Connection>;
|
|
19
|
+
restore(input: RestoreInput): Promise<Connection[]>;
|
|
19
20
|
openWallet(walletId: string, uri?: string, via?: 'scheme' | 'universal'): boolean;
|
|
20
21
|
disconnect(walletId?: string): Promise<void>;
|
|
21
22
|
reset(): Promise<void>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type SessionId = string | null | undefined;
|
|
2
|
+
export declare function createCheckoutSessionRecord<T>({ name, isRecord, }: {
|
|
3
|
+
name: string;
|
|
4
|
+
isRecord: (value: unknown) => value is T;
|
|
5
|
+
}): {
|
|
6
|
+
parse: (raw: string | null) => T | null;
|
|
7
|
+
read({ sessionId }: {
|
|
8
|
+
sessionId: SessionId;
|
|
9
|
+
}): T | null;
|
|
10
|
+
write({ sessionId, record }: {
|
|
11
|
+
sessionId: SessionId;
|
|
12
|
+
record: T;
|
|
13
|
+
}): void;
|
|
14
|
+
clear({ sessionId }: {
|
|
15
|
+
sessionId: SessionId;
|
|
16
|
+
}): void;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CreateTransactionResponse, GetTransactionResponse } from '../types';
|
|
1
2
|
export declare function parseInstant(iso: string | undefined): number | null;
|
|
2
3
|
export declare function isFutureInstant(iso: string | undefined, now?: number): boolean;
|
|
3
4
|
export declare function isSessionPromotable(session: {
|
|
@@ -28,6 +29,7 @@ export declare function hasOutstandingPaymentRequest(payments: {
|
|
|
28
29
|
status: number;
|
|
29
30
|
expiration?: string;
|
|
30
31
|
}[], now?: number): boolean;
|
|
32
|
+
export declare function cryptoTransactionFromLinked(linked: GetTransactionResponse): CreateTransactionResponse;
|
|
31
33
|
export type RestoreContext = {
|
|
32
34
|
customerUUID: string;
|
|
33
35
|
country: string;
|
|
@@ -7,8 +7,19 @@ import type { PaymentFlow } from './paymentFlow';
|
|
|
7
7
|
import type { ScreenNavigator } from './screenNavigator';
|
|
8
8
|
import type { CheckoutEventName, CheckoutInitOptions, PaymentFailureReason } from '../types';
|
|
9
9
|
export interface WalletConnection {
|
|
10
|
-
/**
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Off by default: only a walletConnect-flow merchant with a project id gets a
|
|
12
|
+
* service. A promoted session never resumes a wallet handoff.
|
|
13
|
+
*/
|
|
14
|
+
initialize(input: {
|
|
15
|
+
promoted: boolean;
|
|
16
|
+
}): Promise<void>;
|
|
17
|
+
/** Whether this load found a wallet handoff to recover. */
|
|
18
|
+
hasHandoffToResume(): boolean;
|
|
19
|
+
/** Reconnects the handed-off wallet behind the connecting screen. */
|
|
20
|
+
resumeHandoff(): void;
|
|
21
|
+
/** Drops this checkout's record of a wallet handoff. */
|
|
22
|
+
forgetHandoff(): void;
|
|
12
23
|
choose(wallet: CheckoutWallet): void;
|
|
13
24
|
/** Whether the picked wallet is one checkout can actually connect to. */
|
|
14
25
|
hasConnectable(): boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare const HANDOFF_VERSION = 1;
|
|
2
|
+
export type WalletHandoff = {
|
|
3
|
+
v: typeof HANDOFF_VERSION;
|
|
4
|
+
walletId: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const readWalletHandoff: ({ sessionId }: {
|
|
7
|
+
sessionId: string | null | undefined;
|
|
8
|
+
}) => WalletHandoff | null;
|
|
9
|
+
export declare const clearWalletHandoff: ({ sessionId }: {
|
|
10
|
+
sessionId: string | null | undefined;
|
|
11
|
+
}) => void;
|
|
12
|
+
export declare const parseWalletHandoff: (raw: string | null) => WalletHandoff | null;
|
|
13
|
+
export declare function writeWalletHandoff({ sessionId, walletId, }: {
|
|
14
|
+
sessionId: string | null | undefined;
|
|
15
|
+
walletId: string;
|
|
16
|
+
}): void;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare const RECORD_VERSION = 1;
|
|
2
|
+
export type WalletPaymentInFlight = {
|
|
3
|
+
v: typeof RECORD_VERSION;
|
|
4
|
+
transactionId: string;
|
|
5
|
+
};
|
|
6
|
+
type SessionId = string | null | undefined;
|
|
7
|
+
export declare const readWalletPaymentInFlight: ({ sessionId }: {
|
|
8
|
+
sessionId: string | null | undefined;
|
|
9
|
+
}) => WalletPaymentInFlight | null;
|
|
10
|
+
export declare const clearWalletPaymentInFlight: ({ sessionId }: {
|
|
11
|
+
sessionId: string | null | undefined;
|
|
12
|
+
}) => void;
|
|
13
|
+
export declare const parseWalletPaymentInFlight: (raw: string | null) => WalletPaymentInFlight | null;
|
|
14
|
+
export declare function writeWalletPaymentInFlight({ sessionId, transactionId, }: {
|
|
15
|
+
sessionId: SessionId;
|
|
16
|
+
transactionId: string;
|
|
17
|
+
}): void;
|
|
18
|
+
export declare function hasWalletPaymentInFlight({ sessionId, transactionId, }: {
|
|
19
|
+
sessionId: SessionId;
|
|
20
|
+
transactionId: string;
|
|
21
|
+
}): boolean;
|
|
22
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lydianpay/sdk-web",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.12.1",
|
|
4
4
|
"description": "Drop-in crypto payment checkout for the web — a <lydian-checkout> web component and window.Lydian API across 20+ chains and major stablecoins.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
85
|
"@lydianpay/frontend-shared-helpers": "1.2.0",
|
|
86
|
-
"@lydianpay/lydianconnect": "^1.
|
|
86
|
+
"@lydianpay/lydianconnect": "^1.7.1",
|
|
87
87
|
"@lydianpay/lydianconnect-catalog": "^1.4.0",
|
|
88
88
|
"@solana/qr-code-styling": "^1.6.0",
|
|
89
89
|
"dompurify": "^3.4.12",
|