@lydianpay/sdk-web 3.7.0 → 3.7.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-DJHqzaLI.js → index-BBPxP59-.js} +44 -38
- package/dist/chunks/{index-Du8LmTIv.js → index-DYVfFYby.js} +1 -1
- package/dist/chunks/{metamask-sdk-DekYRxAk.js → metamask-sdk-DVrLlEpt.js} +1 -1
- package/dist/chunks/{mountEngine-uNB2ytN4.js → mountEngine-7GpOY00I.js} +4778 -4575
- package/dist/lydian.js +1 -1
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/ui/networkListHelpers.d.ts +35 -0
- package/dist/types/ui/react/AssetSelectScreen/AssetListEmptyState.d.ts +13 -0
- package/dist/types/ui/react/AssetSelectScreen/AssetSelectList.d.ts +12 -0
- package/dist/types/ui/react/{AssetSelectOption.d.ts → AssetSelectScreen/AssetSelectOption.d.ts} +4 -3
- package/dist/types/ui/react/AssetSelectScreen/AssetSelectionHeader.d.ts +4 -0
- package/dist/types/ui/react/AssetSelectScreen/AssetSelectionSummary.d.ts +5 -0
- package/dist/types/ui/react/AssetSelectScreen/useAssetSelectionState.d.ts +9 -0
- package/package.json +1 -1
- /package/dist/types/ui/react/{AssetSelectScreen.d.ts → AssetSelectScreen/AssetSelectScreen.d.ts} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AllowedWalletConfig, Asset, GetSessionResponse, SessionAllowedAsset } from '../types';
|
|
2
2
|
import { type AssetAffordability } from '../chains/balanceReads';
|
|
3
|
+
import type { WalletBalances } from './react/checkoutStore';
|
|
3
4
|
export declare function resolveAllowedAssets(allowedAssets: SessionAllowedAsset[] | null | undefined): Asset[];
|
|
4
5
|
export declare function collectNetworksFromAssets(allowedAssets: Asset[]): string[];
|
|
5
6
|
export declare function hoistRecommendedNetwork({ networks, recommendedNetwork, }: {
|
|
@@ -9,12 +10,46 @@ export declare function hoistRecommendedNetwork({ networks, recommendedNetwork,
|
|
|
9
10
|
export declare function filterAssetsByNetwork(allowedAssets: Asset[], networkCode: string): Asset[];
|
|
10
11
|
export declare function filterNetworksByAsset(allowedAssets: Asset[], assetCode: string): string[];
|
|
11
12
|
export declare function offeredAssetCodes(session: Pick<GetSessionResponse, 'allowedAssets'> | null | undefined, networkCode: string | null): string[];
|
|
13
|
+
export declare function offeredAssetCodesForFlow({ session, assetFirst, selectedNetwork, }: {
|
|
14
|
+
session: Pick<GetSessionResponse, 'allowedAssets'> | null | undefined;
|
|
15
|
+
assetFirst: boolean;
|
|
16
|
+
selectedNetwork: string | null;
|
|
17
|
+
}): string[];
|
|
18
|
+
export declare function getOfferableAssetCodes({ assetFirst, sessionAssetCodes, resolvedAssets, approvedChains, }: {
|
|
19
|
+
assetFirst: boolean;
|
|
20
|
+
sessionAssetCodes: string[];
|
|
21
|
+
resolvedAssets: Asset[];
|
|
22
|
+
approvedChains: readonly string[] | undefined;
|
|
23
|
+
}): string[];
|
|
24
|
+
export type AssetListEmptyReason = 'noSupportedCoins' | 'walletChainsUnapproved' | 'noneOnNetwork';
|
|
25
|
+
export declare function getAssetListEmptyReason({ hasSession, assetFirst, selectedNetwork, sessionAssetCodeCount, offerableAssetCodeCount, }: {
|
|
26
|
+
hasSession: boolean;
|
|
27
|
+
assetFirst: boolean;
|
|
28
|
+
selectedNetwork: string | null;
|
|
29
|
+
sessionAssetCodeCount: number;
|
|
30
|
+
offerableAssetCodeCount: number;
|
|
31
|
+
}): AssetListEmptyReason | null;
|
|
32
|
+
export type BalanceWarning = 'zero' | 'insufficient';
|
|
33
|
+
export declare function getBalanceWarning(affordability: AssetAffordability | undefined): BalanceWarning | undefined;
|
|
34
|
+
export declare function getBalancesInScope({ assetFirst, selectedNetwork, walletBalances, }: {
|
|
35
|
+
assetFirst: boolean;
|
|
36
|
+
selectedNetwork: string | null;
|
|
37
|
+
walletBalances: WalletBalances | null;
|
|
38
|
+
}): Record<string, bigint> | null;
|
|
12
39
|
export declare function getAssetAffordabilityByCode({ assetCodes, balances, session, network, }: {
|
|
13
40
|
assetCodes: string[];
|
|
14
41
|
balances: Record<string, bigint> | null;
|
|
15
42
|
session: Pick<GetSessionResponse, 'calculatedCryptoTotals' | 'calculatedCryptoTotalsPerNetwork'> | undefined;
|
|
16
43
|
network: string | null;
|
|
17
44
|
}): Map<string, AssetAffordability>;
|
|
45
|
+
export declare function getShortfallAssetCodes({ assetCodes, affordabilityByCode, }: {
|
|
46
|
+
assetCodes: string[];
|
|
47
|
+
affordabilityByCode: Map<string, AssetAffordability>;
|
|
48
|
+
}): string[];
|
|
49
|
+
export declare function areAllAssetBalancesZero({ assetCodes, affordabilityByCode, }: {
|
|
50
|
+
assetCodes: string[];
|
|
51
|
+
affordabilityByCode: Map<string, AssetAffordability>;
|
|
52
|
+
}): boolean;
|
|
18
53
|
type NetworkFeeSource = Pick<GetSessionResponse, 'customFlatFeePerNetwork' | 'customFeePercentagePerNetwork'>;
|
|
19
54
|
type CryptoTotalSource = Pick<GetSessionResponse, 'calculatedCryptoTotals' | 'calculatedCryptoTotalsPerNetwork'>;
|
|
20
55
|
export declare function getNetworkFeeLabel(session: NetworkFeeSource | undefined, networkName: string): string | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { AssetListEmptyReason } from '../../networkListHelpers';
|
|
3
|
+
import type { NetworkDisplayEntry } from '../../../constants';
|
|
4
|
+
export default function AssetListEmptyState({ reason, allBalancesZero, assetCodes, networkMeta, }: {
|
|
5
|
+
reason: AssetListEmptyReason | null;
|
|
6
|
+
allBalancesZero: boolean;
|
|
7
|
+
assetCodes: string[];
|
|
8
|
+
networkMeta: NetworkDisplayEntry | null | undefined;
|
|
9
|
+
}): React.JSX.Element | null;
|
|
10
|
+
export declare function getHasAssetListEmptyState({ reason, allBalancesZero, }: {
|
|
11
|
+
reason: AssetListEmptyReason | null;
|
|
12
|
+
allBalancesZero: boolean;
|
|
13
|
+
}): boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type AssetListEmptyReason } from '../../networkListHelpers';
|
|
3
|
+
import type { AssetAffordability } from '../../../chains/balanceReads';
|
|
4
|
+
import type { NetworkDisplayEntry } from '../../../constants';
|
|
5
|
+
export default function AssetSelectList({ assetCodes, affordabilityByCode, emptyReason, allBalancesZero, priceNetwork, networkMeta, }: {
|
|
6
|
+
assetCodes: string[];
|
|
7
|
+
affordabilityByCode: Map<string, AssetAffordability>;
|
|
8
|
+
emptyReason: AssetListEmptyReason | null;
|
|
9
|
+
allBalancesZero: boolean;
|
|
10
|
+
priceNetwork: string | null;
|
|
11
|
+
networkMeta: NetworkDisplayEntry | null | undefined;
|
|
12
|
+
}): React.JSX.Element;
|
package/dist/types/ui/react/{AssetSelectOption.d.ts → AssetSelectScreen/AssetSelectOption.d.ts}
RENAMED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type
|
|
3
|
-
|
|
2
|
+
import { type BalanceWarning } from '../../networkListHelpers';
|
|
3
|
+
import type { GetSessionResponse } from '../../../types';
|
|
4
|
+
export default function AssetSelectOption({ assetCode, session, priceNetwork, balanceWarning, onSelect, }: {
|
|
4
5
|
assetCode: string;
|
|
5
6
|
session: GetSessionResponse | undefined;
|
|
6
7
|
priceNetwork: string | null;
|
|
7
|
-
|
|
8
|
+
balanceWarning?: BalanceWarning;
|
|
8
9
|
onSelect: (assetCode: string) => void;
|
|
9
10
|
}): React.JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function useAssetSelectionState(): {
|
|
2
|
+
offerableAssetCodes: string[];
|
|
3
|
+
affordabilityByCode: Map<string, import("../../../chains/balanceReads").AssetAffordability>;
|
|
4
|
+
allBalancesZero: boolean;
|
|
5
|
+
shortfallCodesToWarn: string[];
|
|
6
|
+
emptyReason: import("../../networkListHelpers").AssetListEmptyReason | null;
|
|
7
|
+
priceNetwork: string | null;
|
|
8
|
+
networkMeta: import("../../../constants").NetworkDisplayEntry | null | undefined;
|
|
9
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lydianpay/sdk-web",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.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": {
|
/package/dist/types/ui/react/{AssetSelectScreen.d.ts → AssetSelectScreen/AssetSelectScreen.d.ts}
RENAMED
|
File without changes
|