@mezo-org/passport 0.4.0-dev.82 → 0.4.0-dev.84
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/src/components/Dropdown/Content.d.ts +0 -15
- package/dist/src/components/Dropdown/Content.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Content.js +3 -3
- package/dist/src/components/Dropdown/Content.js.map +1 -1
- package/dist/src/components/Dropdown/Dropdown.d.ts +0 -4
- package/dist/src/components/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Dropdown.js +10 -36
- package/dist/src/components/Dropdown/Dropdown.js.map +1 -1
- package/dist/src/components/Dropdown/ListingItem.d.ts +8 -7
- package/dist/src/components/Dropdown/ListingItem.d.ts.map +1 -1
- package/dist/src/components/Dropdown/ListingItem.js +36 -28
- package/dist/src/components/Dropdown/ListingItem.js.map +1 -1
- package/dist/src/components/Dropdown/NestedViewLayout.d.ts +2 -1
- package/dist/src/components/Dropdown/NestedViewLayout.d.ts.map +1 -1
- package/dist/src/components/Dropdown/NestedViewLayout.js +13 -15
- package/dist/src/components/Dropdown/NestedViewLayout.js.map +1 -1
- package/dist/src/components/Dropdown/Receive/Receive.d.ts +1 -4
- package/dist/src/components/Dropdown/Receive/Receive.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Receive/Receive.js +30 -19
- package/dist/src/components/Dropdown/Receive/Receive.js.map +1 -1
- package/dist/src/components/Dropdown/Root/AccountAddressActions.d.ts +2 -5
- package/dist/src/components/Dropdown/Root/AccountAddressActions.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Root/AccountAddressActions.js +13 -12
- package/dist/src/components/Dropdown/Root/AccountAddressActions.js.map +1 -1
- package/dist/src/components/Dropdown/Root/AccountBalance.d.ts +2 -4
- package/dist/src/components/Dropdown/Root/AccountBalance.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Root/AccountBalance.js +24 -8
- package/dist/src/components/Dropdown/Root/AccountBalance.js.map +1 -1
- package/dist/src/components/Dropdown/Root/AccountBtcListing.d.ts +6 -0
- package/dist/src/components/Dropdown/Root/AccountBtcListing.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountBtcListing.js +27 -0
- package/dist/src/components/Dropdown/Root/AccountBtcListing.js.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountError.d.ts +8 -0
- package/dist/src/components/Dropdown/Root/AccountError.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountError.js +17 -0
- package/dist/src/components/Dropdown/Root/AccountError.js.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountMusdListing.d.ts +4 -0
- package/dist/src/components/Dropdown/Root/AccountMusdListing.d.ts.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountMusdListing.js +21 -0
- package/dist/src/components/Dropdown/Root/AccountMusdListing.js.map +1 -0
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.d.ts +2 -3
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.js +34 -39
- package/dist/src/components/Dropdown/Root/AccountOtherAssets.js.map +1 -1
- package/dist/src/components/Dropdown/Root/Root.d.ts +0 -15
- package/dist/src/components/Dropdown/Root/Root.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Root/Root.js +22 -34
- package/dist/src/components/Dropdown/Root/Root.js.map +1 -1
- package/dist/src/components/Dropdown/Root/WalletAddress.d.ts +2 -6
- package/dist/src/components/Dropdown/Root/WalletAddress.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Root/WalletAddress.js +37 -34
- package/dist/src/components/Dropdown/Root/WalletAddress.js.map +1 -1
- package/dist/src/components/Dropdown/Root/WelcomeBlock.d.ts +2 -4
- package/dist/src/components/Dropdown/Root/WelcomeBlock.d.ts.map +1 -1
- package/dist/src/components/Dropdown/Root/WelcomeBlock.js +60 -16
- package/dist/src/components/Dropdown/Root/WelcomeBlock.js.map +1 -1
- package/dist/src/components/Dropdown/SlotNumber.d.ts +19 -0
- package/dist/src/components/Dropdown/SlotNumber.d.ts.map +1 -0
- package/dist/src/components/Dropdown/SlotNumber.js +67 -0
- package/dist/src/components/Dropdown/SlotNumber.js.map +1 -0
- package/dist/src/config.d.ts +0 -1
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +1 -9
- package/dist/src/config.js.map +1 -1
- package/dist/src/hooks/useAssetsConversionRates.d.ts +8 -13
- package/dist/src/hooks/useAssetsConversionRates.d.ts.map +1 -1
- package/dist/src/hooks/useAssetsConversionRates.js +44 -67
- package/dist/src/hooks/useAssetsConversionRates.js.map +1 -1
- package/dist/src/hooks/useAuthenticateWithWallet.d.ts.map +1 -1
- package/dist/src/hooks/useAuthenticateWithWallet.js +1 -1
- package/dist/src/hooks/useAuthenticateWithWallet.js.map +1 -1
- package/dist/src/hooks/useBorrowData.d.ts +30 -4
- package/dist/src/hooks/useBorrowData.d.ts.map +1 -1
- package/dist/src/hooks/useBorrowData.js +53 -11
- package/dist/src/hooks/useBorrowData.js.map +1 -1
- package/dist/src/hooks/useCreateAccount.d.ts.map +1 -1
- package/dist/src/hooks/useCreateAccount.js +3 -3
- package/dist/src/hooks/useCreateAccount.js.map +1 -1
- package/dist/src/hooks/useGetCurrentAccount.d.ts.map +1 -1
- package/dist/src/hooks/useGetCurrentAccount.js +4 -6
- package/dist/src/hooks/useGetCurrentAccount.js.map +1 -1
- package/dist/src/hooks/useLinkAccount.d.ts.map +1 -1
- package/dist/src/hooks/useLinkAccount.js +3 -3
- package/dist/src/hooks/useLinkAccount.js.map +1 -1
- package/dist/src/hooks/useTokensBalances.d.ts +36 -35
- package/dist/src/hooks/useTokensBalances.d.ts.map +1 -1
- package/dist/src/hooks/useTokensBalances.js +93 -52
- package/dist/src/hooks/useTokensBalances.js.map +1 -1
- package/dist/src/hooks/useWalletAccount.d.ts +8 -6
- package/dist/src/hooks/useWalletAccount.d.ts.map +1 -1
- package/dist/src/hooks/useWalletAccount.js +9 -6
- package/dist/src/hooks/useWalletAccount.js.map +1 -1
- package/dist/src/lib/contracts/index.d.ts +1 -1
- package/dist/src/lib/contracts/index.d.ts.map +1 -1
- package/dist/src/lib/contracts/index.js +4 -0
- package/dist/src/lib/contracts/index.js.map +1 -1
- package/dist/src/provider.d.ts +7 -1
- package/dist/src/provider.d.ts.map +1 -1
- package/dist/src/provider.js +4 -1
- package/dist/src/provider.js.map +1 -1
- package/dist/src/utils/assets.d.ts +145 -0
- package/dist/src/utils/assets.d.ts.map +1 -0
- package/dist/src/utils/assets.js +100 -0
- package/dist/src/utils/assets.js.map +1 -0
- package/dist/src/utils/assets.test.d.ts +2 -0
- package/dist/src/utils/assets.test.d.ts.map +1 -0
- package/dist/src/utils/assets.test.js +46 -0
- package/dist/src/utils/assets.test.js.map +1 -0
- package/dist/src/utils/currency.d.ts +6 -3
- package/dist/src/utils/currency.d.ts.map +1 -1
- package/dist/src/utils/currency.js +13 -10
- package/dist/src/utils/currency.js.map +1 -1
- package/dist/src/utils/currency.test.js +44 -2
- package/dist/src/utils/currency.test.js.map +1 -1
- package/dist/src/utils/numbers.d.ts +13 -53
- package/dist/src/utils/numbers.d.ts.map +1 -1
- package/dist/src/utils/numbers.js +16 -118
- package/dist/src/utils/numbers.js.map +1 -1
- package/dist/src/utils/numbers.test.js +24 -142
- package/dist/src/utils/numbers.test.js.map +1 -1
- package/package.json +2 -1
- package/src/components/Dropdown/Content.tsx +3 -48
- package/src/components/Dropdown/Dropdown.tsx +7 -58
- package/src/components/Dropdown/ListingItem.tsx +155 -59
- package/src/components/Dropdown/NestedViewLayout.tsx +32 -20
- package/src/components/Dropdown/Receive/Receive.tsx +57 -32
- package/src/components/Dropdown/Root/AccountAddressActions.tsx +33 -35
- package/src/components/Dropdown/Root/AccountBalance.tsx +54 -16
- package/src/components/Dropdown/Root/AccountBtcListing.tsx +52 -0
- package/src/components/Dropdown/Root/AccountError.tsx +34 -0
- package/src/components/Dropdown/Root/AccountMusdListing.tsx +45 -0
- package/src/components/Dropdown/Root/AccountOtherAssets.tsx +63 -46
- package/src/components/Dropdown/Root/Root.tsx +28 -98
- package/src/components/Dropdown/Root/WalletAddress.tsx +87 -89
- package/src/components/Dropdown/Root/WelcomeBlock.tsx +112 -30
- package/src/components/Dropdown/SlotNumber.tsx +131 -0
- package/src/config.ts +1 -11
- package/src/hooks/useAssetsConversionRates.ts +49 -67
- package/src/hooks/useAuthenticateWithWallet.ts +7 -5
- package/src/hooks/useBorrowData.ts +71 -12
- package/src/hooks/useCreateAccount.ts +5 -4
- package/src/hooks/useGetCurrentAccount.ts +5 -7
- package/src/hooks/useLinkAccount.ts +5 -4
- package/src/hooks/useTokensBalances.ts +152 -74
- package/src/hooks/useWalletAccount.ts +19 -13
- package/src/lib/contracts/index.ts +8 -1
- package/src/provider.ts +11 -3
- package/src/utils/assets.test.ts +57 -0
- package/src/utils/assets.ts +103 -0
- package/src/utils/currency.test.ts +76 -2
- package/src/utils/currency.ts +20 -15
- package/src/utils/numbers.test.ts +29 -180
- package/src/utils/numbers.ts +22 -171
- package/dist/src/components/Dropdown/Root/AccountAssetItem.d.ts +0 -11
- package/dist/src/components/Dropdown/Root/AccountAssetItem.d.ts.map +0 -1
- package/dist/src/components/Dropdown/Root/AccountAssetItem.js +0 -9
- package/dist/src/components/Dropdown/Root/AccountAssetItem.js.map +0 -1
- package/dist/src/hooks/useDropdownData.d.ts +0 -47
- package/dist/src/hooks/useDropdownData.d.ts.map +0 -1
- package/dist/src/hooks/useDropdownData.js +0 -97
- package/dist/src/hooks/useDropdownData.js.map +0 -1
- package/dist/src/utils/cryptoAssets.d.ts +0 -44
- package/dist/src/utils/cryptoAssets.d.ts.map +0 -1
- package/dist/src/utils/cryptoAssets.js +0 -129
- package/dist/src/utils/cryptoAssets.js.map +0 -1
- package/dist/src/utils/cryptoAssets.test.d.ts +0 -2
- package/dist/src/utils/cryptoAssets.test.d.ts.map +0 -1
- package/dist/src/utils/cryptoAssets.test.js +0 -67
- package/dist/src/utils/cryptoAssets.test.js.map +0 -1
- package/src/components/Dropdown/Root/AccountAssetItem.tsx +0 -26
- package/src/hooks/useDropdownData.ts +0 -152
- package/src/utils/cryptoAssets.test.ts +0 -79
- package/src/utils/cryptoAssets.ts +0 -171
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useQuery } from "@tanstack/react-query";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import { useAccount } from "wagmi";
|
|
4
|
+
// TODO: Invesitgate race conditions and refactor
|
|
4
5
|
export default function useWalletAccount() {
|
|
5
6
|
const { address: evmAddress, connector, chainId } = useAccount();
|
|
6
7
|
const networkFamily = useMemo(() => (connector?.type !== "orangekit" ? "evm" : "bitcoin"), [connector]);
|
|
@@ -18,12 +19,14 @@ export default function useWalletAccount() {
|
|
|
18
19
|
});
|
|
19
20
|
const { address: btcAddress } = btcData || {};
|
|
20
21
|
return {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
data: {
|
|
23
|
+
accountAddress: evmAddress,
|
|
24
|
+
walletAddress: btcAddress ?? evmAddress,
|
|
25
|
+
isConnected: networkFamily === "bitcoin" ? !!btcAddress : !!evmAddress,
|
|
26
|
+
networkFamily,
|
|
27
|
+
connector,
|
|
28
|
+
chainId,
|
|
29
|
+
},
|
|
27
30
|
};
|
|
28
31
|
}
|
|
29
32
|
//# sourceMappingURL=useWalletAccount.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWalletAccount.js","sourceRoot":"","sources":["../../../src/hooks/useWalletAccount.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAE/B,OAAO,EAAa,UAAU,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"useWalletAccount.js","sourceRoot":"","sources":["../../../src/hooks/useWalletAccount.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@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Abi, Address } from "viem";
|
|
2
2
|
export type MezoChainToken = "mcbBTC" | "mDAI" | "mFBTC" | "mSolvBTC" | "mswBTC" | "mT" | "mUSDC" | "mUSDe" | "mUSDT" | "mxSolvBTC" | "MUSD";
|
|
3
|
-
export type MezoBorrowContract = "TroveManager" | "BorrowerOperations";
|
|
3
|
+
export type MezoBorrowContract = "TroveManager" | "BorrowerOperations" | "PriceFeed";
|
|
4
4
|
type ContractsMap<K extends string> = Record<K, {
|
|
5
5
|
address: Address;
|
|
6
6
|
abi: Abi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/contracts/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/contracts/index.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAEnC,MAAM,MAAM,cAAc,GACtB,QAAQ,GACR,MAAM,GACN,OAAO,GACP,UAAU,GACV,QAAQ,GACR,IAAI,GACJ,OAAO,GACP,OAAO,GACP,OAAO,GACP,WAAW,GACX,MAAM,CAAA;AAEV,MAAM,MAAM,kBAAkB,GAC1B,cAAc,GACd,oBAAoB,GACpB,WAAW,CAAA;AAEf,KAAK,YAAY,CAAC,CAAC,SAAS,MAAM,IAAI,MAAM,CAC1C,CAAC,EACD;IACE,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,EAAE,GAAG,CAAA;CACT,CACF,CAAA;AAED,eAAO,MAAM,qBAAqB,EAYlB,YAAY,CAAC,cAAc,CAAC,CAAA;AAE5C,eAAO,MAAM,qBAAqB,EAYlB,YAAY,CAAC,cAAc,CAAC,CAAA;AAE5C,eAAO,MAAM,sBAAsB,EAInB,YAAY,CAAC,kBAAkB,CAAC,CAAA;AAEhD,eAAO,MAAM,sBAAsB,EAInB,YAAY,CAAC,kBAAkB,CAAC,CAAA;AAEhD,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -24,6 +24,8 @@ import xsolvbtcTestnet from "@mezo-org/mezod-contracts/deployments/testnet/mxSol
|
|
|
24
24
|
import musdTestnet from "@mezo-org/musd-contracts/deployments/matsnet/MUSD.json";
|
|
25
25
|
import troveManagerTestnet from "@mezo-org/musd-contracts/deployments/matsnet/TroveManager.json";
|
|
26
26
|
import borrowerOperationsTestnet from "@mezo-org/musd-contracts/deployments/matsnet/BorrowerOperations.json";
|
|
27
|
+
import priceFeed from "@mezo-org/musd-contracts/deployments/mainnet/PriceFeed.json";
|
|
28
|
+
import priceFeedTestnet from "@mezo-org/musd-contracts/deployments/matsnet/PriceFeed.json";
|
|
27
29
|
export const testnetTokenContracts = {
|
|
28
30
|
mcbBTC: cbbtcTestnet,
|
|
29
31
|
mDAI: daiTestnet,
|
|
@@ -53,10 +55,12 @@ export const mainnetTokenContracts = {
|
|
|
53
55
|
export const mainnetBorrowContracts = {
|
|
54
56
|
TroveManager: troveManagerMainnet,
|
|
55
57
|
BorrowerOperations: borrowerOperationsMainnet,
|
|
58
|
+
PriceFeed: priceFeed,
|
|
56
59
|
};
|
|
57
60
|
export const testnetBorrowContracts = {
|
|
58
61
|
TroveManager: troveManagerTestnet,
|
|
59
62
|
BorrowerOperations: borrowerOperationsTestnet,
|
|
63
|
+
PriceFeed: priceFeedTestnet,
|
|
60
64
|
};
|
|
61
65
|
export { default as priceOracleContract } from "./priceOracle";
|
|
62
66
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/contracts/index.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,2DAA2D,CAAA;AACpF,OAAO,UAAU,MAAM,yDAAyD,CAAA;AAChF,OAAO,WAAW,MAAM,0DAA0D,CAAA;AAClF,OAAO,cAAc,M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AAE,UAAU;IAChB,KAAK,EAAE,WAAW;IAClB,QAAQ,EAAE,cAAc;IACxB,MAAM,EAAE,YAAY;IACpB,EAAE,EAAE,QAAQ;IACZ,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,eAAe;IAC1B,IAAI,EAAE,WAAW;CACyB,CAAA;AAE5C,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,YAAY,EAAE,mBAAmB;IACjC,kBAAkB,EAAE,yBAAyB;IAC7C,SAAS,EAAE,SAAS;CAC0B,CAAA;AAEhD,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,YAAY,EAAE,mBAAmB;IACjC,kBAAkB,EAAE,yBAAyB;IAC7C,SAAS,EAAE,gBAAgB;CACmB,CAAA;AAEhD,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,eAAe,CAAA"}
|
package/dist/src/provider.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export interface PassportContextValue {
|
|
|
3
3
|
authApiClient: AuthApiClient;
|
|
4
4
|
portalApiClient: PortalApiClient;
|
|
5
5
|
environment?: Environment;
|
|
6
|
+
accountDataRefetchInterval: number;
|
|
7
|
+
nativeBalanceRefetchInterval: number;
|
|
6
8
|
}
|
|
7
9
|
export declare const PassportContext: import("react").Context<PassportContextValue | undefined>;
|
|
8
10
|
type Environment = "mainnet" | "testnet";
|
|
@@ -11,7 +13,11 @@ type PassportProviderProps = {
|
|
|
11
13
|
environment?: Environment;
|
|
12
14
|
authApiUrl?: string;
|
|
13
15
|
portalApiUrl?: string;
|
|
16
|
+
/** Time in milliseconds after which account data (like mats or mezo id) in dropdown should be re-fetched. Default is 90000 (90 secs) */
|
|
17
|
+
accountDataRefetchInterval?: number;
|
|
18
|
+
/** Time in milliseconds after which native balance in dropdown should be re-fetched. Default is 90000 (90 secs) */
|
|
19
|
+
nativeBalanceRefetchInterval?: number;
|
|
14
20
|
};
|
|
15
|
-
export declare function PassportProvider({ environment, authApiUrl, portalApiUrl, children, }: PassportProviderProps): import("react").FunctionComponentElement<import("react").ProviderProps<PassportContextValue | undefined>>;
|
|
21
|
+
export declare function PassportProvider({ environment, authApiUrl, portalApiUrl, children, accountDataRefetchInterval, nativeBalanceRefetchInterval, }: PassportProviderProps): import("react").FunctionComponentElement<import("react").ProviderProps<PassportContextValue | undefined>>;
|
|
16
22
|
export {};
|
|
17
23
|
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/provider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,OAAO,CAAA;AAGtD,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,aAAa,CAAA;IAC5B,eAAe,EAAE,eAAe,CAAA;IAChC,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,0BAA0B,EAAE,MAAM,CAAA;IAClC,4BAA4B,EAAE,MAAM,CAAA;CACrC;AAED,eAAO,MAAM,eAAe,2DAE3B,CAAA;AAED,KAAK,WAAW,GAAG,SAAS,GAAG,SAAS,CAAA;AAExC,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,wIAAwI;IACxI,0BAA0B,CAAC,EAAE,MAAM,CAAA;IACnC,mHAAmH;IACnH,4BAA4B,CAAC,EAAE,MAAM,CAAA;CACtC,CAAA;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,WAAW,EACX,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,0BAA+C,EAC/C,4BAAiD,GAClD,EAAE,qBAAqB,6GAqBvB"}
|
package/dist/src/provider.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { createContext, createElement } from "react";
|
|
2
2
|
import { AuthApiClient, PortalApiClient } from "./api";
|
|
3
|
+
import { ONE_SECOND_MS } from "./utils/time";
|
|
3
4
|
export const PassportContext = createContext(undefined);
|
|
4
|
-
export function PassportProvider({ environment, authApiUrl, portalApiUrl, children, }) {
|
|
5
|
+
export function PassportProvider({ environment, authApiUrl, portalApiUrl, children, accountDataRefetchInterval = 90 * ONE_SECOND_MS, nativeBalanceRefetchInterval = 90 * ONE_SECOND_MS, }) {
|
|
5
6
|
if (environment && !["mainnet", "testnet"].includes(environment)) {
|
|
6
7
|
throw new Error("Wrong environment passed to PassportProvider.");
|
|
7
8
|
}
|
|
@@ -10,6 +11,8 @@ export function PassportProvider({ environment, authApiUrl, portalApiUrl, childr
|
|
|
10
11
|
authApiClient: new AuthApiClient(environment ?? "mainnet", authApiUrl),
|
|
11
12
|
portalApiClient: new PortalApiClient(environment ?? "mainnet", portalApiUrl),
|
|
12
13
|
environment,
|
|
14
|
+
accountDataRefetchInterval,
|
|
15
|
+
nativeBalanceRefetchInterval,
|
|
13
16
|
},
|
|
14
17
|
}, children);
|
|
15
18
|
}
|
package/dist/src/provider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"provider.js","sourceRoot":"","sources":["../../src/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAU5C,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAC1C,SAAS,CACV,CAAA;AAeD,MAAM,UAAU,gBAAgB,CAAC,EAC/B,WAAW,EACX,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,0BAA0B,GAAG,EAAE,GAAG,aAAa,EAC/C,4BAA4B,GAAG,EAAE,GAAG,aAAa,GAC3B;IACtB,IAAI,WAAW,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QACjE,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAA;IAClE,CAAC;IAED,OAAO,aAAa,CAClB,eAAe,CAAC,QAAQ,EACxB;QACE,KAAK,EAAE;YACL,aAAa,EAAE,IAAI,aAAa,CAAC,WAAW,IAAI,SAAS,EAAE,UAAU,CAAC;YACtE,eAAe,EAAE,IAAI,eAAe,CAClC,WAAW,IAAI,SAAS,EACxB,YAAY,CACb;YACD,WAAW;YACX,0BAA0B;YAC1B,4BAA4B;SAC7B;KACF,EACD,QAAQ,CACT,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
declare const ASSETS: {
|
|
2
|
+
BTC: {
|
|
3
|
+
name: string;
|
|
4
|
+
symbol: string;
|
|
5
|
+
decimals: number;
|
|
6
|
+
};
|
|
7
|
+
ETH: {
|
|
8
|
+
name: string;
|
|
9
|
+
symbol: string;
|
|
10
|
+
decimals: number;
|
|
11
|
+
};
|
|
12
|
+
MUSD: {
|
|
13
|
+
name: string;
|
|
14
|
+
symbol: string;
|
|
15
|
+
decimals: number;
|
|
16
|
+
};
|
|
17
|
+
mDAI: {
|
|
18
|
+
name: string;
|
|
19
|
+
symbol: string;
|
|
20
|
+
decimals: number;
|
|
21
|
+
};
|
|
22
|
+
mFBTC: {
|
|
23
|
+
name: string;
|
|
24
|
+
symbol: string;
|
|
25
|
+
decimals: number;
|
|
26
|
+
};
|
|
27
|
+
mcbBTC: {
|
|
28
|
+
name: string;
|
|
29
|
+
symbol: string;
|
|
30
|
+
decimals: number;
|
|
31
|
+
};
|
|
32
|
+
mSolvBTC: {
|
|
33
|
+
name: string;
|
|
34
|
+
symbol: string;
|
|
35
|
+
decimals: number;
|
|
36
|
+
};
|
|
37
|
+
mswBTC: {
|
|
38
|
+
name: string;
|
|
39
|
+
symbol: string;
|
|
40
|
+
decimals: number;
|
|
41
|
+
};
|
|
42
|
+
mT: {
|
|
43
|
+
name: string;
|
|
44
|
+
symbol: string;
|
|
45
|
+
decimals: number;
|
|
46
|
+
};
|
|
47
|
+
mUSDC: {
|
|
48
|
+
name: string;
|
|
49
|
+
symbol: string;
|
|
50
|
+
decimals: number;
|
|
51
|
+
};
|
|
52
|
+
mUSDe: {
|
|
53
|
+
name: string;
|
|
54
|
+
symbol: string;
|
|
55
|
+
decimals: number;
|
|
56
|
+
};
|
|
57
|
+
mUSDT: {
|
|
58
|
+
name: string;
|
|
59
|
+
symbol: string;
|
|
60
|
+
decimals: number;
|
|
61
|
+
};
|
|
62
|
+
mxSolvBTC: {
|
|
63
|
+
name: string;
|
|
64
|
+
symbol: string;
|
|
65
|
+
decimals: number;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Gets details of given crypto asset
|
|
70
|
+
* @param key The key of crypto asset
|
|
71
|
+
* @returns The crypto asset details
|
|
72
|
+
*/
|
|
73
|
+
export declare function getAsset(key: keyof typeof ASSETS): {
|
|
74
|
+
name: string;
|
|
75
|
+
symbol: string;
|
|
76
|
+
decimals: number;
|
|
77
|
+
} | {
|
|
78
|
+
name: string;
|
|
79
|
+
symbol: string;
|
|
80
|
+
decimals: number;
|
|
81
|
+
} | {
|
|
82
|
+
name: string;
|
|
83
|
+
symbol: string;
|
|
84
|
+
decimals: number;
|
|
85
|
+
} | {
|
|
86
|
+
name: string;
|
|
87
|
+
symbol: string;
|
|
88
|
+
decimals: number;
|
|
89
|
+
} | {
|
|
90
|
+
name: string;
|
|
91
|
+
symbol: string;
|
|
92
|
+
decimals: number;
|
|
93
|
+
} | {
|
|
94
|
+
name: string;
|
|
95
|
+
symbol: string;
|
|
96
|
+
decimals: number;
|
|
97
|
+
} | {
|
|
98
|
+
name: string;
|
|
99
|
+
symbol: string;
|
|
100
|
+
decimals: number;
|
|
101
|
+
} | {
|
|
102
|
+
name: string;
|
|
103
|
+
symbol: string;
|
|
104
|
+
decimals: number;
|
|
105
|
+
} | {
|
|
106
|
+
name: string;
|
|
107
|
+
symbol: string;
|
|
108
|
+
decimals: number;
|
|
109
|
+
} | {
|
|
110
|
+
name: string;
|
|
111
|
+
symbol: string;
|
|
112
|
+
decimals: number;
|
|
113
|
+
} | {
|
|
114
|
+
name: string;
|
|
115
|
+
symbol: string;
|
|
116
|
+
decimals: number;
|
|
117
|
+
} | {
|
|
118
|
+
name: string;
|
|
119
|
+
symbol: string;
|
|
120
|
+
decimals: number;
|
|
121
|
+
} | {
|
|
122
|
+
name: string;
|
|
123
|
+
symbol: string;
|
|
124
|
+
decimals: number;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Checks if given crypto asset is Bitcoin-like
|
|
128
|
+
* @param key The key of crypto asset
|
|
129
|
+
* @returns True if crypto asset is Bitcoin-like
|
|
130
|
+
*/
|
|
131
|
+
export declare function isBitcoinLikeCryptoAsset(key: string): boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Checks if given crypto asset is USD-like
|
|
134
|
+
* @param key The key of crypto asset
|
|
135
|
+
* @returns True if crypto asset is USD-like
|
|
136
|
+
*/
|
|
137
|
+
export declare function isUsdLikeCryptoAsset(key: string): boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Checks if given crypto asset is T token
|
|
140
|
+
* @param key The key of crypto asset
|
|
141
|
+
* @returns True if crypto asset is T token
|
|
142
|
+
*/
|
|
143
|
+
export declare function isTTokenCryptoAsset(key: string): boolean;
|
|
144
|
+
export {};
|
|
145
|
+
//# sourceMappingURL=assets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../../src/utils/assets.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkEX,CAAA;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,OAAO,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEhD;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,WAEnD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,WAE/C;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,WAE9C"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
const ASSETS = {
|
|
2
|
+
BTC: {
|
|
3
|
+
name: "Bitcoin",
|
|
4
|
+
symbol: "BTC",
|
|
5
|
+
decimals: 18,
|
|
6
|
+
},
|
|
7
|
+
ETH: {
|
|
8
|
+
name: "Ethereum",
|
|
9
|
+
symbol: "ETH",
|
|
10
|
+
decimals: 18,
|
|
11
|
+
},
|
|
12
|
+
MUSD: {
|
|
13
|
+
name: "MUSD",
|
|
14
|
+
symbol: "MUSD",
|
|
15
|
+
decimals: 18,
|
|
16
|
+
},
|
|
17
|
+
mDAI: {
|
|
18
|
+
name: "Mezo Dai Stablecoin",
|
|
19
|
+
symbol: "mDAI",
|
|
20
|
+
decimals: 18,
|
|
21
|
+
},
|
|
22
|
+
mFBTC: {
|
|
23
|
+
name: "Mezo Fire Bitcoin",
|
|
24
|
+
symbol: "mFBTC",
|
|
25
|
+
decimals: 8,
|
|
26
|
+
},
|
|
27
|
+
mcbBTC: {
|
|
28
|
+
name: "Mezo Coinbase Wrapped BTC",
|
|
29
|
+
symbol: "mcbBTC",
|
|
30
|
+
decimals: 8,
|
|
31
|
+
},
|
|
32
|
+
mSolvBTC: {
|
|
33
|
+
name: "Mezo SolvBTC",
|
|
34
|
+
symbol: "mSolvBTC",
|
|
35
|
+
decimals: 18,
|
|
36
|
+
},
|
|
37
|
+
mswBTC: {
|
|
38
|
+
name: "Mezo swBTC",
|
|
39
|
+
symbol: "mswBTC",
|
|
40
|
+
decimals: 8,
|
|
41
|
+
},
|
|
42
|
+
mT: {
|
|
43
|
+
name: "Mezo Threshold Network Token",
|
|
44
|
+
symbol: "mT",
|
|
45
|
+
decimals: 18,
|
|
46
|
+
},
|
|
47
|
+
mUSDC: {
|
|
48
|
+
name: "Mezo Circle USDC",
|
|
49
|
+
symbol: "mUSDC",
|
|
50
|
+
decimals: 6,
|
|
51
|
+
},
|
|
52
|
+
mUSDe: {
|
|
53
|
+
name: "Mezo Ethena USDe",
|
|
54
|
+
symbol: "mUSDe",
|
|
55
|
+
decimals: 18,
|
|
56
|
+
},
|
|
57
|
+
mUSDT: {
|
|
58
|
+
name: "Mezo Tether USDe",
|
|
59
|
+
symbol: "mUSDT",
|
|
60
|
+
decimals: 6,
|
|
61
|
+
},
|
|
62
|
+
mxSolvBTC: {
|
|
63
|
+
name: "Mezo xSolvBTC",
|
|
64
|
+
symbol: "mxSolvBTC",
|
|
65
|
+
decimals: 18,
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Gets details of given crypto asset
|
|
70
|
+
* @param key The key of crypto asset
|
|
71
|
+
* @returns The crypto asset details
|
|
72
|
+
*/
|
|
73
|
+
export function getAsset(key) {
|
|
74
|
+
return ASSETS[key];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Checks if given crypto asset is Bitcoin-like
|
|
78
|
+
* @param key The key of crypto asset
|
|
79
|
+
* @returns True if crypto asset is Bitcoin-like
|
|
80
|
+
*/
|
|
81
|
+
export function isBitcoinLikeCryptoAsset(key) {
|
|
82
|
+
return /(btc)/i.test(key);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Checks if given crypto asset is USD-like
|
|
86
|
+
* @param key The key of crypto asset
|
|
87
|
+
* @returns True if crypto asset is USD-like
|
|
88
|
+
*/
|
|
89
|
+
export function isUsdLikeCryptoAsset(key) {
|
|
90
|
+
return /(usd|dai)/i.test(key);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Checks if given crypto asset is T token
|
|
94
|
+
* @param key The key of crypto asset
|
|
95
|
+
* @returns True if crypto asset is T token
|
|
96
|
+
*/
|
|
97
|
+
export function isTTokenCryptoAsset(key) {
|
|
98
|
+
return /^(mt|t)$/i.test(key);
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=assets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.js","sourceRoot":"","sources":["../../../src/utils/assets.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG;IACb,GAAG,EAAE;QACH,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,EAAE;KACb;IACD,GAAG,EAAE;QACH,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,EAAE;KACb;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,EAAE;KACb;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,qBAAqB;QAC3B,MAAM,EAAE,MAAM;QACd,QAAQ,EAAE,EAAE;KACb;IACD,KAAK,EAAE;QACL,IAAI,EAAE,mBAAmB;QACzB,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,CAAC;KACZ;IACD,MAAM,EAAE;QACN,IAAI,EAAE,2BAA2B;QACjC,MAAM,EAAE,QAAQ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ets.test.d.ts","sourceRoot":"","sources":["../../../src/utils/assets.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { getAsset, isBitcoinLikeCryptoAsset, isUsdLikeCryptoAsset, isTTokenCryptoAsset, } from "./assets";
|
|
2
|
+
describe("getAsset", () => {
|
|
3
|
+
it("should return correct asset data", () => {
|
|
4
|
+
const asset = getAsset("BTC");
|
|
5
|
+
expect(asset).toEqual({
|
|
6
|
+
name: "Bitcoin",
|
|
7
|
+
symbol: "BTC",
|
|
8
|
+
decimals: 18,
|
|
9
|
+
});
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
describe("isBitcoinLikeCryptoAsset", () => {
|
|
13
|
+
it('should return true for keys containing "btc"', () => {
|
|
14
|
+
expect(isBitcoinLikeCryptoAsset("BTC")).toBe(true);
|
|
15
|
+
expect(isBitcoinLikeCryptoAsset("mFBTC")).toBe(true);
|
|
16
|
+
expect(isBitcoinLikeCryptoAsset("mcbBTC")).toBe(true);
|
|
17
|
+
expect(isBitcoinLikeCryptoAsset("mxSolvBTC")).toBe(true);
|
|
18
|
+
});
|
|
19
|
+
it("should return false for non-Bitcoin assets", () => {
|
|
20
|
+
expect(isBitcoinLikeCryptoAsset("ETH")).toBe(false);
|
|
21
|
+
expect(isBitcoinLikeCryptoAsset("mUSDC")).toBe(false);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
describe("isUsdLikeCryptoAsset", () => {
|
|
25
|
+
it('should return true for keys containing "usd" or "dai"', () => {
|
|
26
|
+
expect(isUsdLikeCryptoAsset("mUSDC")).toBe(true);
|
|
27
|
+
expect(isUsdLikeCryptoAsset("mUSDT")).toBe(true);
|
|
28
|
+
expect(isUsdLikeCryptoAsset("mUSDe")).toBe(true);
|
|
29
|
+
expect(isUsdLikeCryptoAsset("mDAI")).toBe(true);
|
|
30
|
+
});
|
|
31
|
+
it("should return false for other tokens", () => {
|
|
32
|
+
expect(isUsdLikeCryptoAsset("BTC")).toBe(false);
|
|
33
|
+
expect(isUsdLikeCryptoAsset("mT")).toBe(false);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
describe("isTTokenCryptoAsset", () => {
|
|
37
|
+
it('should return true for keys like "mT" or "t"', () => {
|
|
38
|
+
expect(isTTokenCryptoAsset("mT")).toBe(true);
|
|
39
|
+
expect(isTTokenCryptoAsset("T")).toBe(true);
|
|
40
|
+
});
|
|
41
|
+
it("should return false for other tokens", () => {
|
|
42
|
+
expect(isTTokenCryptoAsset("BTC")).toBe(false);
|
|
43
|
+
expect(isTTokenCryptoAsset("mUSDT")).toBe(false);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=assets.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.test.js","sourceRoot":"","sources":["../../../src/utils/assets.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,UAAU,CAAA;AAEjB,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;QAC1C,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;QAC7B,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;YACpB,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,KAAK;YACb,QAAQ,EAAE,EAAE;SACb,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClD,MAAM,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI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AqB,EAAE,GAAG,EAAE;IACnC,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACtD,MAAM,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC5C,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC7C,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE;QAC9C,MAAM,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC9C,MAAM,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IAClD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* @param options The options to pass to the formatter
|
|
5
5
|
* @returns The formatted currency
|
|
6
6
|
*/
|
|
7
|
-
export declare function formatCurrency(value: number, options
|
|
7
|
+
export declare function formatCurrency(value: number, options: Omit<Intl.NumberFormatOptions, "style">): string;
|
|
8
8
|
/**
|
|
9
9
|
* Formats a number as a USD currency
|
|
10
10
|
* @param value The value to format
|
|
11
11
|
* @returns The formatted currency
|
|
12
12
|
*/
|
|
13
|
-
export declare function formatUsd(value: number): string;
|
|
13
|
+
export declare function formatUsd(value: number | string): string;
|
|
14
14
|
/**
|
|
15
15
|
* Converts an asset amount to USD based on a conversion rate and decimals
|
|
16
16
|
* @param assetAmount - The amount of the asset in its smallest unit (e.g., satoshis for BTC)
|
|
@@ -18,5 +18,8 @@ export declare function formatUsd(value: number): string;
|
|
|
18
18
|
* @param decimals - The number of decimals for the asset
|
|
19
19
|
* @returns - The value in USD as a number
|
|
20
20
|
*/
|
|
21
|
-
export declare function convertToUsd(assetAmount: bigint, assetDecimals: number, conversionRate: bigint, conversionRateDecimals: number):
|
|
21
|
+
export declare function convertToUsd(assetAmount: bigint, assetDecimals: number, conversionRate: bigint, conversionRateDecimals: number): {
|
|
22
|
+
value: bigint;
|
|
23
|
+
formatted: string;
|
|
24
|
+
};
|
|
22
25
|
//# sourceMappingURL=currency.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currency.d.ts","sourceRoot":"","sources":["../../../src/utils/currency.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"currency.d.ts","sourceRoot":"","sources":["../../../src/utils/currency.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC,GAC/C,MAAM,CASR;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAExD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,sBAAsB,EAAE,MAAM;;;EAc/B"}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
style: "currency",
|
|
4
|
-
minimumFractionDigits: 2,
|
|
5
|
-
maximumFractionDigits: 2,
|
|
6
|
-
};
|
|
1
|
+
import { formatUnits } from "viem";
|
|
2
|
+
import { normalizePrecision } from "./numbers";
|
|
7
3
|
/**
|
|
8
4
|
* Formats a number as a currency
|
|
9
5
|
* @param value The value to format
|
|
10
6
|
* @param options The options to pass to the formatter
|
|
11
7
|
* @returns The formatted currency
|
|
12
8
|
*/
|
|
13
|
-
export function formatCurrency(value, options
|
|
9
|
+
export function formatCurrency(value, options) {
|
|
14
10
|
const formatter = new Intl.NumberFormat("en-US", {
|
|
15
|
-
|
|
11
|
+
style: "currency",
|
|
12
|
+
minimumFractionDigits: 2,
|
|
13
|
+
maximumFractionDigits: 2,
|
|
16
14
|
...options,
|
|
17
15
|
});
|
|
18
16
|
return formatter.format(value);
|
|
@@ -23,7 +21,7 @@ export function formatCurrency(value, options = {}) {
|
|
|
23
21
|
* @returns The formatted currency
|
|
24
22
|
*/
|
|
25
23
|
export function formatUsd(value) {
|
|
26
|
-
return formatCurrency(value, { currency: "USD" });
|
|
24
|
+
return formatCurrency(Number(value), { currency: "USD" });
|
|
27
25
|
}
|
|
28
26
|
/**
|
|
29
27
|
* Converts an asset amount to USD based on a conversion rate and decimals
|
|
@@ -33,6 +31,11 @@ export function formatUsd(value) {
|
|
|
33
31
|
* @returns - The value in USD as a number
|
|
34
32
|
*/
|
|
35
33
|
export function convertToUsd(assetAmount, assetDecimals, conversionRate, conversionRateDecimals) {
|
|
36
|
-
|
|
34
|
+
const value = normalizePrecision(assetAmount * conversionRate, assetDecimals + conversionRateDecimals, conversionRateDecimals);
|
|
35
|
+
const formatted = formatUnits(value, conversionRateDecimals);
|
|
36
|
+
return {
|
|
37
|
+
value,
|
|
38
|
+
formatted,
|
|
39
|
+
};
|
|
37
40
|
}
|
|
38
41
|
//# sourceMappingURL=currency.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currency.js","sourceRoot":"","sources":["../../../src/utils/currency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"currency.js","sourceRoot":"","sources":["../../../src/utils/currency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAE9C;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAC5B,KAAa,EACb,OAAgD;IAEhD,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE;QAC/C,KAAK,EAAE,UAAU;QACjB,qBAAqB,EAAE,CAAC;QACxB,qBAAqB,EAAE,CAAC;QACxB,GAAG,OAAO;KACX,CAAC,CAAA;IAEF,OAAO,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,KAAsB;IAC9C,OAAO,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAA;AAC3D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAC1B,WAAmB,EACnB,aAAqB,EACrB,cAAsB,EACtB,sBAA8B;IAE9B,MAAM,KAAK,GAAG,kBAAkB,CAC9B,WAAW,GAAG,cAAc,EAC5B,aAAa,GAAG,sBAAsB,EACtC,sBAAsB,CACvB,CAAA;IAED,MAAM,SAAS,GAAG,WAAW,CAAC,KAAK,EAAE,sBAAsB,CAAC,CAAA;IAE5D,OAAO;QACL,KAAK;QACL,SAAS;KACV,CAAA;AACH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { formatCurrency, formatUsd } from "./currency";
|
|
1
|
+
import { convertToUsd, formatCurrency, formatUsd } from "./currency";
|
|
2
2
|
describe("formatCurrency", () => {
|
|
3
3
|
it("formats a number as currency with default options", () => {
|
|
4
4
|
const result = formatCurrency(1234.5, { currency: "EUR" });
|
|
@@ -31,5 +31,47 @@ describe("formatUsd", () => {
|
|
|
31
31
|
expect(result).toBe("$0.00");
|
|
32
32
|
});
|
|
33
33
|
});
|
|
34
|
-
|
|
34
|
+
describe("convertToUsd", () => {
|
|
35
|
+
it("converts 1 BTC (8 decimals) with $30,000 rate (6 decimals)", () => {
|
|
36
|
+
const assetAmount = 100000000n; // 1 BTC
|
|
37
|
+
const assetDecimals = 8;
|
|
38
|
+
const conversionRate = 30000000000n; // $30,000 in 6 decimals
|
|
39
|
+
const conversionRateDecimals = 6;
|
|
40
|
+
const result = convertToUsd(assetAmount, assetDecimals, conversionRate, conversionRateDecimals);
|
|
41
|
+
expect(result.value).toBe(30000000000n);
|
|
42
|
+
expect(result.formatted).toBe("30000");
|
|
43
|
+
});
|
|
44
|
+
it("converts 0.5 BTC correctly", () => {
|
|
45
|
+
const assetAmount = 50000000n; // 0.5 BTC
|
|
46
|
+
const assetDecimals = 8;
|
|
47
|
+
const conversionRate = 40000000000n; // $40,000
|
|
48
|
+
const conversionRateDecimals = 6;
|
|
49
|
+
const result = convertToUsd(assetAmount, assetDecimals, conversionRate, conversionRateDecimals);
|
|
50
|
+
expect(result.value).toBe(20000000000n);
|
|
51
|
+
expect(result.formatted).toBe("20000");
|
|
52
|
+
});
|
|
53
|
+
it("converts 1 ETH (18 decimals) with $2,000 rate (6 decimals)", () => {
|
|
54
|
+
const assetAmount = 1000000000000000000n; // 1 ETH
|
|
55
|
+
const assetDecimals = 18;
|
|
56
|
+
const conversionRate = 2000000000n;
|
|
57
|
+
const conversionRateDecimals = 6;
|
|
58
|
+
const result = convertToUsd(assetAmount, assetDecimals, conversionRate, conversionRateDecimals);
|
|
59
|
+
expect(result.value).toBe(2000000000n);
|
|
60
|
+
expect(result.formatted).toBe("2000");
|
|
61
|
+
});
|
|
62
|
+
it("handles zero amount correctly", () => {
|
|
63
|
+
const result = convertToUsd(0n, 18, 999999999n, 6);
|
|
64
|
+
expect(result.value).toBe(0n);
|
|
65
|
+
expect(result.formatted).toBe("0");
|
|
66
|
+
});
|
|
67
|
+
it("handles assets with fewer decimals than conversion rate", () => {
|
|
68
|
+
const assetAmount = 100n;
|
|
69
|
+
const assetDecimals = 2;
|
|
70
|
+
const conversionRate = 1500000000n; // $1500
|
|
71
|
+
const conversionRateDecimals = 6;
|
|
72
|
+
const result = convertToUsd(assetAmount, assetDecimals, conversionRate, conversionRateDecimals);
|
|
73
|
+
expect(result.value).toBe(1500000000n);
|
|
74
|
+
expect(result.formatted).toBe("1500");
|
|
75
|
+
});
|
|
76
|
+
});
|
|
35
77
|
//# sourceMappingURL=currency.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currency.test.js","sourceRoot":"","sources":["../../../src/utils/currency.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"currency.test.js","sourceRoot":"","sources":["../../../src/utils/currency.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEpE,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,MAAM,GAAG,cAAc,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAA;QAC1D,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;IAClC,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,MAAM,GAAG,cAAc,CAAC,GAAG,EAAE;YACjC,QAAQ,EAAE,KAAK;YACf,qBAAqB,EAAE,CAAC;YACxB,qBAAqB,EAAE,CAAC;SACzB,CAAC,CAAA;QACF,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC/B,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,MAAM,GAAG,cAAc,CAAC,QAAQ,EAAE;YACtC,QAAQ,EAAE,KAAK;YACf,qBAAqB,EAAE,CAAC;YACxB,qBAAqB,EAAE,CAAC;SACzB,CAAC,CAAA;QACF,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC7B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAA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