@bluxcc/core 0.2.2 → 0.2.4
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 +1 -0
- package/dist/assets/index.d.ts +11 -0
- package/dist/components/CDNImage.d.ts +8 -0
- package/dist/components/Link/index.d.ts +8 -0
- package/dist/constants/cdnFiles.d.ts +64 -0
- package/dist/constants/consts.d.ts +2 -0
- package/dist/enums.d.ts +13 -2
- package/dist/exports/blux.d.ts +12 -3
- package/dist/exports/core/index.d.ts +1 -0
- package/dist/exports/core/readContracts.d.ts +2 -1
- package/dist/exports/core/test-types.d.ts +2 -0
- package/dist/exports/core/toScVal.d.ts +30 -0
- package/dist/exports/index.d.ts +5 -1
- package/dist/exports/utils.d.ts +6 -4
- package/dist/index.cjs.js +14 -14
- package/dist/index.esm.js +14 -14
- package/dist/pages/AcceptTermsAndPrivacy/index.d.ts +2 -0
- package/dist/pages/FundMe/FundMeCrypto/index.d.ts +2 -0
- package/dist/pages/FundMe/index.d.ts +2 -0
- package/dist/stellar/handleSignAuthEntry.d.ts +3 -0
- package/dist/stellar/processes/connectWalletProcess.d.ts +1 -1
- package/dist/stellar/processes/continueLoginProcess.d.ts +3 -0
- package/dist/stellar/processes/loginResolver.d.ts +2 -0
- package/dist/stellar/processes/signAuthEntryProcess.d.ts +3 -0
- package/dist/store.d.ts +25 -2
- package/dist/types.d.ts +10 -1
- package/dist/utils/api.d.ts +2 -1
- package/dist/utils/checkRecentLogins.d.ts +3 -0
- package/dist/utils/events.d.ts +49 -0
- package/dist/utils/preloadImages.d.ts +1 -0
- package/dist/utils/walletLogos.d.ts +1 -1
- package/dist/wallets/bitget.d.ts +2 -0
- package/dist/wallets/onekey.d.ts +2 -0
- package/package.json +2 -2
- package/dist/assets/Icons.d.ts +0 -108
- package/dist/assets/Logos.d.ts +0 -33
- package/dist/assets/bluxLogo.d.ts +0 -8
- package/dist/exports/core/writeContracts.d.ts +0 -1
package/dist/store.d.ts
CHANGED
|
@@ -3,9 +3,19 @@ import { SignClient } from '@walletconnect/sign-client/dist/types/client';
|
|
|
3
3
|
import { Route } from './enums';
|
|
4
4
|
import { UseBalancesResult } from './hooks/useBalances';
|
|
5
5
|
import { UseTransactionsResult } from './hooks/useTransactions';
|
|
6
|
-
import
|
|
7
|
-
|
|
6
|
+
import Emitter, { BluxEventMap } from './utils/events';
|
|
7
|
+
import { IAsset, IWallet, IAppearance, ISignMessage, IInternalConfig, ISendTransaction, AuthenticateApiResponse, ISignAuthEntry } from './types';
|
|
8
8
|
export type AlertType = 'error' | 'success' | 'warn' | 'none' | 'copy';
|
|
9
|
+
export type WaitingStatus = 'login' | 'sendTransaction' | 'signMessage' | 'signAuthEntry';
|
|
10
|
+
export interface ILogo {
|
|
11
|
+
id: number;
|
|
12
|
+
name: string;
|
|
13
|
+
content: string;
|
|
14
|
+
default_values?: {
|
|
15
|
+
name: string;
|
|
16
|
+
value: string;
|
|
17
|
+
}[];
|
|
18
|
+
}
|
|
9
19
|
export interface IUser {
|
|
10
20
|
address: string;
|
|
11
21
|
identifier?: string;
|
|
@@ -30,7 +40,15 @@ export interface ISelectAsset {
|
|
|
30
40
|
swapToAsset: IAsset;
|
|
31
41
|
swapFromAsset: IAsset;
|
|
32
42
|
}
|
|
43
|
+
export interface ILoginPromise {
|
|
44
|
+
isSilent: boolean;
|
|
45
|
+
promise: Promise<IUser>;
|
|
46
|
+
rejecter: (reason: any) => void;
|
|
47
|
+
resolver: (value: IUser) => void;
|
|
48
|
+
}
|
|
33
49
|
export interface IStoreProperties {
|
|
50
|
+
logos: ILogo[] | null;
|
|
51
|
+
emitter: Emitter<BluxEventMap>;
|
|
34
52
|
auth?: IAuth;
|
|
35
53
|
config: IInternalConfig;
|
|
36
54
|
user?: IUser;
|
|
@@ -53,6 +71,8 @@ export interface IStoreProperties {
|
|
|
53
71
|
stellar?: IStellarConfig;
|
|
54
72
|
sendTransaction?: ISendTransaction;
|
|
55
73
|
signMessage?: ISignMessage;
|
|
74
|
+
signAuthEntry?: ISignAuthEntry;
|
|
75
|
+
login?: ILoginPromise;
|
|
56
76
|
balances: UseBalancesResult;
|
|
57
77
|
transactions: UseTransactionsResult;
|
|
58
78
|
selectAsset: ISelectAsset;
|
|
@@ -76,6 +96,7 @@ export interface IStoreMethods {
|
|
|
76
96
|
setRoute: (route: Route) => void;
|
|
77
97
|
setSendTransaction: (sendTransaction: ISendTransaction, isOpen: boolean, route?: Route) => void;
|
|
78
98
|
setSignMessage: (messageDetails: ISignMessage, isOpen: boolean, route?: Route) => void;
|
|
99
|
+
setSignAuthEntry: (authEntry: ISignAuthEntry, isOpen: boolean, route?: Route) => void;
|
|
79
100
|
setStellar: (stellar: IStellarConfig) => void;
|
|
80
101
|
setWallets: (wallets: IWallet[]) => void;
|
|
81
102
|
setAlert: (alert: AlertType, message: string) => void;
|
|
@@ -90,6 +111,8 @@ export interface IStoreMethods {
|
|
|
90
111
|
setApiResponse: (res: AuthenticateApiResponse) => void;
|
|
91
112
|
setAuth: (a: IAuth) => void;
|
|
92
113
|
setIsAuthenticated: (isAuthenticated: boolean) => void;
|
|
114
|
+
setLogin: (loginDetails: ILoginPromise | undefined) => void;
|
|
115
|
+
setLogos: (logos: ILogo[]) => void;
|
|
93
116
|
}
|
|
94
117
|
export interface IStore extends IStoreProperties, IStoreMethods {
|
|
95
118
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Horizon } from '@stellar/stellar-sdk';
|
|
2
2
|
import { SupportedWallet } from './enums';
|
|
3
|
-
export type LanguageKey = 'en'
|
|
3
|
+
export type LanguageKey = 'en';
|
|
4
4
|
export type ITransports = Record<string, IServers>;
|
|
5
5
|
export type IExplorer = 'steexp' | 'stellarchain' | 'stellarexpert' | 'lumenscan';
|
|
6
6
|
export type ILoginMethods = Array<'wallet' | 'sms' | 'email' | 'passkey'>;
|
|
@@ -117,8 +117,17 @@ export interface ISignMessage {
|
|
|
117
117
|
rejecter: (reason: any) => void;
|
|
118
118
|
resolver: (value: string) => void;
|
|
119
119
|
}
|
|
120
|
+
export interface ISignAuthEntry {
|
|
121
|
+
result?: string;
|
|
122
|
+
authEntry: string;
|
|
123
|
+
options: ISignOptions;
|
|
124
|
+
rejecter: (reason: any) => void;
|
|
125
|
+
resolver: (value: string) => void;
|
|
126
|
+
}
|
|
120
127
|
export interface AuthenticateApiResponse {
|
|
121
128
|
isValid: boolean;
|
|
122
129
|
message: string;
|
|
130
|
+
privacyPolicy: string;
|
|
131
|
+
terms: string;
|
|
123
132
|
}
|
|
124
133
|
export {};
|
package/dist/utils/api.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { AuthenticateApiResponse } from '../types';
|
|
2
1
|
import { IUser } from '../store';
|
|
2
|
+
import { AuthenticateApiResponse } from '../types';
|
|
3
3
|
export declare const authenticateAppId: (appId: string) => Promise<AuthenticateApiResponse>;
|
|
4
4
|
export declare const apiSendOtp: (appId: string, authValue: string) => Promise<boolean>;
|
|
5
|
+
export declare const apiStoreWalletConnection: (appId: string, walletName: string, walletAddress: string) => Promise<boolean>;
|
|
5
6
|
export declare const apiVerifyOtp: (appId: string, user: IUser, otp: string) => Promise<string>;
|
|
6
7
|
type ApiGetUserResponse = {
|
|
7
8
|
auth_method: string;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { IUser } from '../store';
|
|
2
|
+
export type IErrorPayload = {
|
|
3
|
+
message: string;
|
|
4
|
+
code?: string | number;
|
|
5
|
+
cause?: unknown;
|
|
6
|
+
};
|
|
7
|
+
export type INetwork = {
|
|
8
|
+
previousNetwork: string;
|
|
9
|
+
network: string;
|
|
10
|
+
};
|
|
11
|
+
export declare enum BluxEvent {
|
|
12
|
+
LoggedIn = "blux:logged_in",
|
|
13
|
+
LoggedOut = "blux:logged_out",
|
|
14
|
+
NetworkChanged = "blux:network_changed",// payload: INetwork
|
|
15
|
+
ModalOpened = "blux:modal_opened",// payload: { modal: string; reason?: string; meta?: any }
|
|
16
|
+
ModalClosed = "blux:modal_closed"
|
|
17
|
+
}
|
|
18
|
+
export type BluxEventMap = {
|
|
19
|
+
[BluxEvent.LoggedIn]: {
|
|
20
|
+
user: IUser;
|
|
21
|
+
};
|
|
22
|
+
[BluxEvent.LoggedOut]: void;
|
|
23
|
+
[BluxEvent.NetworkChanged]: INetwork;
|
|
24
|
+
[BluxEvent.ModalOpened]: {
|
|
25
|
+
modal: string;
|
|
26
|
+
reason?: string;
|
|
27
|
+
meta?: any;
|
|
28
|
+
};
|
|
29
|
+
[BluxEvent.ModalClosed]: {
|
|
30
|
+
modal: string;
|
|
31
|
+
reason?: string;
|
|
32
|
+
meta?: any;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export type ReadOnlyEmitter<E> = {
|
|
36
|
+
on: <K extends keyof E>(event: K, handler: (payload: E[K]) => void) => () => void;
|
|
37
|
+
once: <K extends keyof E>(event: K, handler: (payload: E[K]) => void) => () => void;
|
|
38
|
+
off: <K extends keyof E>(event: K, handler: (payload: E[K]) => void) => void;
|
|
39
|
+
};
|
|
40
|
+
type Handler<T> = (payload: T) => void;
|
|
41
|
+
declare class Emitter<Events extends Record<string, any>> {
|
|
42
|
+
private handlers;
|
|
43
|
+
on<K extends keyof Events>(event: K, handler: Handler<Events[K]>): () => void;
|
|
44
|
+
off<K extends keyof Events>(event: K, handler: Handler<Events[K]>): void;
|
|
45
|
+
once<K extends keyof Events>(event: K, handler: Handler<Events[K]>): () => void;
|
|
46
|
+
emit<K extends keyof Events>(event: K, payload: Events[K]): void;
|
|
47
|
+
clear(event?: keyof Events): void;
|
|
48
|
+
}
|
|
49
|
+
export default Emitter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const preloadLogos: () => Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const handleLogos: (walletName: string, isDark: boolean) => import("react/jsx-runtime").JSX.Element | null;
|
|
1
|
+
declare const handleLogos: (walletName: string, isDark: boolean, size?: "small" | "large") => import("react/jsx-runtime").JSX.Element | null;
|
|
2
2
|
export default handleLogos;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bluxcc/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"homepage": "https://blux.cc",
|
|
5
5
|
"description": "Blux is a wallet infra for the Stellar network",
|
|
6
6
|
"type": "module",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@ledgerhq/hw-app-str": "^7.2.8",
|
|
43
43
|
"@lobstrco/signer-extension-api": "^1.0.0-beta.0",
|
|
44
44
|
"@stellar/freighter-api": "^5.0.0",
|
|
45
|
-
"@stellar/stellar-sdk": "^
|
|
45
|
+
"@stellar/stellar-sdk": "^15.1.0",
|
|
46
46
|
"@walletconnect/core": "^2.21.9",
|
|
47
47
|
"@walletconnect/sign-client": "^2.21.9",
|
|
48
48
|
"qrcode.react": "^4.2.0",
|
package/dist/assets/Icons.d.ts
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
export declare const AboutIcon: ({ fill }: {
|
|
2
|
-
fill?: string;
|
|
3
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export declare const ArrowRight: ({ fill }: {
|
|
5
|
-
fill?: string;
|
|
6
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
export declare const ArrowLeft: ({ fill }: {
|
|
8
|
-
fill?: string;
|
|
9
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export declare const Close: ({ fill }: {
|
|
11
|
-
fill?: string;
|
|
12
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export declare const Loading: ({ fill }: {
|
|
14
|
-
fill?: string;
|
|
15
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export declare const Search: ({ fill }: {
|
|
17
|
-
fill?: string;
|
|
18
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export declare const GreenCheck: ({ fill }: {
|
|
20
|
-
fill?: string;
|
|
21
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export declare const LogOut: ({ fill }: {
|
|
23
|
-
fill?: string;
|
|
24
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
export declare const Copy: ({ fill }: {
|
|
26
|
-
fill?: string;
|
|
27
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
export declare const LargeCopy: ({ fill }: {
|
|
29
|
-
fill?: string;
|
|
30
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
export declare const History: ({ fill }: {
|
|
32
|
-
fill?: string;
|
|
33
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
-
export declare const Send: ({ fill }: {
|
|
35
|
-
fill?: string;
|
|
36
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
37
|
-
export declare const ArrowDropUp: ({ fill }: {
|
|
38
|
-
fill?: string;
|
|
39
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
-
export declare const ArrowDropDown: ({ fill }: {
|
|
41
|
-
fill?: string;
|
|
42
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
-
export declare const RedAlert: () => import("react/jsx-runtime").JSX.Element;
|
|
44
|
-
export declare const Upstream: () => import("react/jsx-runtime").JSX.Element;
|
|
45
|
-
export declare const MultiOperation: () => import("react/jsx-runtime").JSX.Element;
|
|
46
|
-
export declare const Downstream: () => import("react/jsx-runtime").JSX.Element;
|
|
47
|
-
export declare const Globe: () => import("react/jsx-runtime").JSX.Element;
|
|
48
|
-
export declare const SmallEmailIcon: ({ fill }: {
|
|
49
|
-
fill?: string;
|
|
50
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
51
|
-
export declare const EmailIcon: ({ fill }: {
|
|
52
|
-
fill?: string;
|
|
53
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
54
|
-
export declare const RedExclamation: () => import("react/jsx-runtime").JSX.Element;
|
|
55
|
-
export declare const WrongNetworkIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
56
|
-
export declare const SwapIcon: ({ fill }: {
|
|
57
|
-
fill?: string;
|
|
58
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
59
|
-
export declare const SmallSwapIcon: ({ fill }: {
|
|
60
|
-
fill?: string;
|
|
61
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
62
|
-
export declare const ReceiveIcon: ({ fill }: {
|
|
63
|
-
fill?: string;
|
|
64
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
65
|
-
export declare const BalancesIcon: ({ fill }: {
|
|
66
|
-
fill?: string;
|
|
67
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
68
|
-
export declare const NFTsIcon: ({ fill }: {
|
|
69
|
-
fill?: string;
|
|
70
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
71
|
-
export declare const AssetsIcon: ({ fill }: {
|
|
72
|
-
fill?: string;
|
|
73
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
74
|
-
export declare const TokenIcon: ({ fill }: {
|
|
75
|
-
fill?: string;
|
|
76
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
77
|
-
export declare const PlusIcon: ({ fill }: {
|
|
78
|
-
fill?: string;
|
|
79
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
80
|
-
export declare const OpenEye: ({ fill }: {
|
|
81
|
-
fill?: string;
|
|
82
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
83
|
-
export declare const CloseEye: ({ fill }: {
|
|
84
|
-
fill?: string;
|
|
85
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
86
|
-
export declare const WarnIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
87
|
-
export declare const ErrorIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
88
|
-
export declare const CopyIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
89
|
-
export declare const SuccessIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
90
|
-
export declare const KeyIcon: ({ fill }: {
|
|
91
|
-
fill?: string;
|
|
92
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
93
|
-
export declare const ChipIcon: ({ fill }: {
|
|
94
|
-
fill?: string;
|
|
95
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
96
|
-
export declare const ShieldIcon: ({ fill }: {
|
|
97
|
-
fill?: string;
|
|
98
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
99
|
-
export declare const WalletIcon: ({ fill }: {
|
|
100
|
-
fill?: string;
|
|
101
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
102
|
-
export declare const QuestionMark: ({ fill }: {
|
|
103
|
-
fill?: string;
|
|
104
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
105
|
-
export declare const SmallQuestionMark: ({ fill }: {
|
|
106
|
-
fill?: string;
|
|
107
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
108
|
-
export declare const GrayCube: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/assets/Logos.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
export declare const AlbedoLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
2
|
-
export declare const HanaLogo: ({ fill }: {
|
|
3
|
-
fill?: string;
|
|
4
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
export declare const HotLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export declare const RabetLogo: ({ fill }: {
|
|
7
|
-
fill?: string;
|
|
8
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export declare const FreighterLogo: ({ fill }: {
|
|
10
|
-
fill?: string;
|
|
11
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export declare const DarkFreighterLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export declare const XBullLogo: ({ fill }: {
|
|
14
|
-
fill?: string;
|
|
15
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export declare const LobstrLogo: ({ fill }: {
|
|
17
|
-
fill?: string;
|
|
18
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export declare const StellarLogo: ({ fill }: {
|
|
20
|
-
fill?: string;
|
|
21
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export declare const StellarSmallLogo: ({ fill }: {
|
|
23
|
-
fill?: string;
|
|
24
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
-
export declare const GoogleLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
export declare const WalletConnectLogo: ({ fill, background, }: {
|
|
27
|
-
fill?: string;
|
|
28
|
-
background?: string;
|
|
29
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
-
export declare const KleverLogo: () => import("react/jsx-runtime").JSX.Element;
|
|
31
|
-
export declare const LedgerLogo: ({ fill }: {
|
|
32
|
-
fill?: string;
|
|
33
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
declare const BluxLogo: ({ fill }: {
|
|
2
|
-
fill?: string;
|
|
3
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export default BluxLogo;
|
|
5
|
-
export declare const SmallBlux: ({ fill, background, }: {
|
|
6
|
-
fill?: string;
|
|
7
|
-
background?: string;
|
|
8
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|