@bluxcc/core 0.1.0 → 0.1.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/LICENSE +80 -0
- package/README.md +108 -0
- package/dist/assets/Logos.d.ts +4 -0
- package/dist/components/QRCode/index.d.ts +3 -2
- package/dist/enums.d.ts +7 -2
- package/dist/exports/blux.d.ts +8 -2
- package/dist/exports/createConfig.d.ts +3 -0
- package/dist/exports/index.d.ts +4 -1
- package/dist/index.cjs.js +35 -6
- package/dist/index.d.ts +144 -147
- package/dist/index.esm.js +35 -6
- package/dist/index.iife.js +42 -5
- package/dist/pages/Failed/index.d.ts +2 -0
- package/dist/pages/SignMessage/index.d.ts +1 -1
- package/dist/pages/Waiting/index.d.ts +1 -1
- package/dist/pages/WalletConnect/index.d.ts +2 -0
- package/dist/stellar/handleSignMessage.d.ts +3 -0
- package/dist/stellar/handleTransactionSigning.d.ts +1 -3
- package/dist/stellar/processes/connectWalletProcess.d.ts +4 -0
- package/dist/stellar/processes/sendTransactionProcess.d.ts +3 -0
- package/dist/stellar/processes/signMessageProcess.d.ts +3 -0
- package/dist/stellar/submitTransaction.d.ts +1 -3
- package/dist/store.d.ts +16 -9
- package/dist/types.d.ts +44 -41
- package/dist/utils/initializeWalletConnect.d.ts +3 -0
- package/dist/wallets/hot.d.ts +2 -0
- package/dist/wallets/index.d.ts +2 -2
- package/dist/wallets/klever.d.ts +2 -0
- package/dist/wallets/walletConnect.d.ts +2 -0
- package/package.json +11 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const SignMessage: () => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
declare const SignMessage: () => import("react/jsx-runtime").JSX.Element | null;
|
|
2
2
|
export default SignMessage;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const Waiting: () => import("react/jsx-runtime").JSX.Element
|
|
1
|
+
declare const Waiting: () => import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
export default Waiting;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import { ITransports, IWallet } from "../types";
|
|
2
|
-
declare const handleTransactionSigning: (wallet: IWallet, xdr: string, userAddress: string,
|
|
3
|
-
network: string;
|
|
4
|
-
}, transports: ITransports) => Promise<import("@stellar/stellar-sdk/lib/horizon").HorizonApi.SubmitTransactionResponse>;
|
|
2
|
+
declare const handleTransactionSigning: (wallet: IWallet, xdr: string, userAddress: string, network: string, transports: ITransports) => Promise<import("@stellar/stellar-sdk/lib/horizon").HorizonApi.SubmitTransactionResponse>;
|
|
5
3
|
export default handleTransactionSigning;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { Horizon } from "@stellar/stellar-sdk";
|
|
2
2
|
import { ITransports } from "../types";
|
|
3
|
-
declare function submitTransaction(xdr: string,
|
|
4
|
-
network: string;
|
|
5
|
-
}, transports: ITransports): Promise<// | rpc.Api.GetSuccessfulTransactionResponse
|
|
3
|
+
declare function submitTransaction(xdr: string, network: string, transports: ITransports): Promise<// | rpc.Api.GetSuccessfulTransactionResponse
|
|
6
4
|
Horizon.HorizonApi.SubmitTransactionResponse>;
|
|
7
5
|
export default submitTransaction;
|
package/dist/store.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { Horizon, rpc } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
export type
|
|
1
|
+
import { Horizon, rpc } from '@stellar/stellar-sdk';
|
|
2
|
+
import { SignClient } from '@walletconnect/sign-client/dist/types/client';
|
|
3
|
+
import { Route } from './enums';
|
|
4
|
+
import { UseBalancesResult } from './hooks/useBalances';
|
|
5
|
+
import { UseTransactionsResult } from './hooks/useTransactions';
|
|
6
|
+
import { IWallet, ISignMessage, IInternalConfig, ISendTransaction } from './types';
|
|
7
|
+
export type WaitingStatus = 'login' | 'sendTransaction' | 'signMessage';
|
|
8
|
+
export type AlertType = 'error' | 'success' | 'info' | 'warn' | 'none';
|
|
8
9
|
export interface IUser {
|
|
9
10
|
address: string;
|
|
10
11
|
walletPassphrase: string;
|
|
@@ -39,8 +40,13 @@ export interface IStoreProperties {
|
|
|
39
40
|
wallets: IWallet[];
|
|
40
41
|
stellar?: IStellarConfig;
|
|
41
42
|
sendTransaction?: ISendTransaction;
|
|
43
|
+
signMessage?: ISignMessage;
|
|
42
44
|
balances: UseBalancesResult;
|
|
43
45
|
transactions: UseTransactionsResult;
|
|
46
|
+
walletConnect?: {
|
|
47
|
+
connection: any;
|
|
48
|
+
client: SignClient;
|
|
49
|
+
};
|
|
44
50
|
}
|
|
45
51
|
export interface IStoreMethods {
|
|
46
52
|
connectEmail: (email: string) => void;
|
|
@@ -53,14 +59,15 @@ export interface IStoreMethods {
|
|
|
53
59
|
setIsReady: (isReady: boolean) => void;
|
|
54
60
|
setShowAllWallets: (showAllWallets: boolean) => void;
|
|
55
61
|
setRoute: (route: Route) => void;
|
|
56
|
-
setSendTransaction: (sendTransaction: ISendTransaction) => void;
|
|
62
|
+
setSendTransaction: (sendTransaction: ISendTransaction, route?: Route) => void;
|
|
63
|
+
setSignMessage: (messageDetails: ISignMessage, route?: Route) => void;
|
|
57
64
|
setStellar: (stellar: IStellarConfig) => void;
|
|
58
65
|
setWallets: (wallets: IWallet[]) => void;
|
|
59
66
|
setAlert: (alert: AlertType, message: string) => void;
|
|
60
67
|
setDynamicTitle: (title: string) => void;
|
|
61
|
-
sendTransactionSuccessful: (sendTransaction: ISendTransaction) => void;
|
|
62
68
|
setBalances: (balances: UseBalancesResult) => void;
|
|
63
69
|
setTransactions: (transactions: UseTransactionsResult) => void;
|
|
70
|
+
setWalletConnectClient: (client: SignClient, connection: any) => void;
|
|
64
71
|
}
|
|
65
72
|
export interface IStore extends IStoreProperties, IStoreMethods {
|
|
66
73
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import { Horizon } from
|
|
2
|
-
import { SupportedWallet } from
|
|
3
|
-
export type LanguageKey =
|
|
1
|
+
import { Horizon } from '@stellar/stellar-sdk';
|
|
2
|
+
import { SupportedWallet } from './enums';
|
|
3
|
+
export type LanguageKey = 'en' | 'es';
|
|
4
4
|
export type ITransports = Record<string, IServers>;
|
|
5
|
-
export type IExplorer =
|
|
6
|
-
export type ILoginMethods = Array<
|
|
5
|
+
export type IExplorer = 'steexp' | 'stellarchain' | 'stellarexpert' | 'lumenscan';
|
|
6
|
+
export type ILoginMethods = Array<'wallet' | 'sms' | 'email' | 'passkey'>;
|
|
7
|
+
export type IWalletNames = Array<'rabet' | 'albedo' | 'freighter' | 'xbull' | 'lobstr' | 'hana' | 'hot' | 'klever'>;
|
|
7
8
|
interface IServers {
|
|
8
9
|
horizon: string;
|
|
9
10
|
soroban: string;
|
|
10
11
|
}
|
|
12
|
+
export interface IWalletConnectMetaData {
|
|
13
|
+
icons: [];
|
|
14
|
+
url: string;
|
|
15
|
+
projectId: string;
|
|
16
|
+
description: string;
|
|
17
|
+
}
|
|
11
18
|
export interface IConfig {
|
|
12
19
|
appId: string;
|
|
13
20
|
appName: string;
|
|
@@ -19,6 +26,8 @@ export interface IConfig {
|
|
|
19
26
|
showWalletUIs?: boolean;
|
|
20
27
|
loginMethods?: ILoginMethods;
|
|
21
28
|
transports?: ITransports;
|
|
29
|
+
excludeWallets?: IWalletNames;
|
|
30
|
+
walletConnect?: IWalletConnectMetaData;
|
|
22
31
|
}
|
|
23
32
|
export interface IInternalConfig extends IConfig {
|
|
24
33
|
explorer: IExplorer;
|
|
@@ -26,6 +35,7 @@ export interface IInternalConfig extends IConfig {
|
|
|
26
35
|
showWalletUIs: boolean;
|
|
27
36
|
defaultNetwork: string;
|
|
28
37
|
lang: LanguageKey;
|
|
38
|
+
excludeWallets: IWalletNames;
|
|
29
39
|
}
|
|
30
40
|
export interface IAppearance {
|
|
31
41
|
background: string;
|
|
@@ -42,41 +52,25 @@ export interface IAppearance {
|
|
|
42
52
|
export interface IWallet {
|
|
43
53
|
name: SupportedWallet;
|
|
44
54
|
website: string;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
publicKey: string;
|
|
48
|
-
}>;
|
|
49
|
-
getAddress?: (options?: {
|
|
50
|
-
path?: string;
|
|
51
|
-
}) => Promise<{
|
|
52
|
-
address: string;
|
|
53
|
-
}>;
|
|
54
|
-
signTransaction?: (xdr: string, options?: {
|
|
55
|
-
networkPassphrase?: string;
|
|
56
|
-
address?: string;
|
|
57
|
-
submit?: boolean;
|
|
58
|
-
}) => Promise<string>;
|
|
59
|
-
disconnect?: () => Promise<void>;
|
|
55
|
+
connect: () => Promise<string>;
|
|
56
|
+
disconnect: () => Promise<void>;
|
|
60
57
|
getNetwork: () => Promise<{
|
|
61
58
|
network: string;
|
|
62
59
|
passphrase: string;
|
|
63
60
|
}>;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}) => Promise<
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}) => Promise<
|
|
77
|
-
signedAuthorizationEntry: string;
|
|
78
|
-
signerPublicKey?: string;
|
|
79
|
-
}>;
|
|
61
|
+
isAvailable: () => Promise<boolean>;
|
|
62
|
+
signAuthEntry: (authorizationEntry: string, options: {
|
|
63
|
+
network: string;
|
|
64
|
+
address: string;
|
|
65
|
+
}) => Promise<string>;
|
|
66
|
+
signMessage: (message: string, options: {
|
|
67
|
+
address: string;
|
|
68
|
+
network: string;
|
|
69
|
+
}) => Promise<string>;
|
|
70
|
+
signTransaction: (xdr: string, options: {
|
|
71
|
+
network: string;
|
|
72
|
+
address: string;
|
|
73
|
+
}) => Promise<string>;
|
|
80
74
|
}
|
|
81
75
|
export interface IAccountData {
|
|
82
76
|
id: string;
|
|
@@ -95,15 +89,24 @@ export interface IAsset {
|
|
|
95
89
|
assetType: string;
|
|
96
90
|
assetIssuer: string;
|
|
97
91
|
}
|
|
98
|
-
export interface
|
|
92
|
+
export interface ISignOptions {
|
|
99
93
|
network: string;
|
|
100
94
|
}
|
|
101
|
-
export type
|
|
95
|
+
export type SendTransactionResult = Horizon.HorizonApi.SubmitTransactionResponse;
|
|
102
96
|
export interface ISendTransaction {
|
|
103
97
|
xdr: string;
|
|
104
|
-
|
|
98
|
+
wallet: IWallet;
|
|
99
|
+
options: ISignOptions;
|
|
100
|
+
result?: SendTransactionResult;
|
|
101
|
+
rejecter: (reason: any) => void;
|
|
102
|
+
resolver: (value: SendTransactionResult) => void;
|
|
103
|
+
}
|
|
104
|
+
export interface ISignMessage {
|
|
105
|
+
wallet: IWallet;
|
|
106
|
+
message: string;
|
|
107
|
+
options: ISignOptions;
|
|
108
|
+
result?: string;
|
|
105
109
|
rejecter: (reason: any) => void;
|
|
106
|
-
|
|
107
|
-
resolver: (value: TransactionResponseType) => void;
|
|
110
|
+
resolver: (value: string) => void;
|
|
108
111
|
}
|
|
109
112
|
export {};
|
package/dist/wallets/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { IWallet } from
|
|
2
|
-
import { SupportedWallet } from
|
|
1
|
+
import { IWallet } from '../types';
|
|
2
|
+
import { SupportedWallet } from '../enums';
|
|
3
3
|
export declare const walletsConfig: Record<SupportedWallet, IWallet>;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bluxcc/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"homepage": "https://blux.cc",
|
|
5
5
|
"description": "Blux is a wallet infra for the Stellar network",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.cjs.js",
|
|
8
8
|
"module": "./dist/index.esm.js",
|
|
9
9
|
"browser": "./dist/index.iife.js",
|
|
10
|
-
"types": "./
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
13
|
"url": "git+https://github.com/bluxcc/core"
|
|
@@ -37,12 +37,16 @@
|
|
|
37
37
|
"@lobstrco/signer-extension-api": "^1.0.0-beta.0",
|
|
38
38
|
"@stellar/freighter-api": "^5.0.0",
|
|
39
39
|
"@stellar/stellar-sdk": "^14.1.1",
|
|
40
|
+
"@walletconnect/core": "^2.21.9",
|
|
41
|
+
"@walletconnect/sign-client": "^2.21.9",
|
|
42
|
+
"qrcode.react": "^4.2.0",
|
|
40
43
|
"react": "^19.1.1",
|
|
41
44
|
"react-dom": "^19.1.1",
|
|
42
45
|
"zustand": "^5.0.8"
|
|
43
46
|
},
|
|
44
47
|
"devDependencies": {
|
|
45
48
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
49
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
46
50
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
47
51
|
"@rollup/plugin-replace": "^6.0.2",
|
|
48
52
|
"@rollup/plugin-typescript": "^12.1.4",
|
|
@@ -52,10 +56,13 @@
|
|
|
52
56
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
53
57
|
"rollup-plugin-polyfill-node": "^0.13.0",
|
|
54
58
|
"rollup-plugin-postcss": "^4.0.2",
|
|
59
|
+
"prettier": "^3.6.2",
|
|
55
60
|
"rollup-plugin-terser": "^7.0.2",
|
|
56
61
|
"tailwindcss": "^4.1.13",
|
|
57
62
|
"tslib": "^2.8.1",
|
|
58
|
-
"typescript": "^5.9.2"
|
|
59
|
-
|
|
63
|
+
"typescript": "^5.9.2"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"@hot-wallet/sdk": "^1.0.11"
|
|
60
67
|
}
|
|
61
68
|
}
|