@moon-x/react-sdk 0.11.0 → 0.12.0

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.
@@ -1,5 +1,5 @@
1
1
  import { TransactionCommitment, TransactionEncoding, BaseUIOptions, TransactionUIOptions, BaseGetBalanceParams, SolanaChain, BaseGetTokenAccountsParams, BaseSendTransactionParams, PublicWallet, BaseSignMessageParams, BaseSignTransactionParams, BaseGetBalanceResult } from '@moon-x/core/types';
2
- import { B as BaseWalletHooks } from './base-wallet-CzJLpndu.js';
2
+ import { B as BaseWalletHooks } from './base-wallet-SjY7osPg.js';
3
3
  import { SolanaFundingConfig } from '@moon-x/core';
4
4
 
5
5
  interface UseFundWalletInterface {
@@ -1,5 +1,5 @@
1
1
  import { TransactionCommitment, TransactionEncoding, BaseUIOptions, TransactionUIOptions, BaseGetBalanceParams, SolanaChain, BaseGetTokenAccountsParams, BaseSendTransactionParams, PublicWallet, BaseSignMessageParams, BaseSignTransactionParams, BaseGetBalanceResult } from '@moon-x/core/types';
2
- import { B as BaseWalletHooks } from './base-wallet-CzJLpndu.mjs';
2
+ import { B as BaseWalletHooks } from './base-wallet-SjY7osPg.mjs';
3
3
  import { SolanaFundingConfig } from '@moon-x/core';
4
4
 
5
5
  interface UseFundWalletInterface {
@@ -0,0 +1,77 @@
1
+ import { PublicWallet, TronGetBalanceResult, TronTransactionJson, TronSendTransactionParams, TronSendTransactionResult, TronSignMessageParams, TronSignMessageResult, TronSignTransactionParams, TronSignTransactionResult } from '@moon-x/core/types';
2
+
3
+ declare const useCreateWallet: (callbacks?: {
4
+ onSuccess?: (result: {
5
+ wallet: PublicWallet;
6
+ }) => void;
7
+ onError?: (error: Error) => void;
8
+ }) => {
9
+ createWallet: (options?: {
10
+ createAdditional?: boolean;
11
+ walletIndex?: number;
12
+ }) => Promise<{
13
+ wallet: PublicWallet;
14
+ }>;
15
+ };
16
+ declare const useWallets: () => {
17
+ wallets: PublicWallet[];
18
+ loading: boolean;
19
+ error?: Error;
20
+ refetch: () => void;
21
+ };
22
+ declare const useSignMessage: () => {
23
+ signMessage: (params: TronSignMessageParams) => Promise<TronSignMessageResult>;
24
+ loading: boolean;
25
+ error: undefined;
26
+ };
27
+ declare const useSignTransaction: () => {
28
+ signTransaction: (params: TronSignTransactionParams) => Promise<TronSignTransactionResult>;
29
+ loading: boolean;
30
+ error: undefined;
31
+ };
32
+ declare const useSendTransaction: () => {
33
+ sendTransaction: (params: {
34
+ transaction: TronTransactionJson;
35
+ wallet: PublicWallet;
36
+ /** Per-call chain selector: a configured tron id (e.g. "tron:mainnet"). */
37
+ chain?: string;
38
+ /** Inline fullnode override; falls back to provider config when omitted. */
39
+ rpcUrl?: string;
40
+ options?: TronSendTransactionParams["options"];
41
+ }) => Promise<TronSendTransactionResult>;
42
+ loading: boolean;
43
+ error: undefined;
44
+ };
45
+ declare const useGetBalance: () => {
46
+ getBalance: (params: {
47
+ wallet: PublicWallet;
48
+ chain?: string;
49
+ rpcUrl?: string;
50
+ }) => Promise<TronGetBalanceResult>;
51
+ loading: boolean;
52
+ error: undefined;
53
+ };
54
+ declare const useExportKey: () => {
55
+ exportKey: ({ wallet }: {
56
+ wallet: PublicWallet;
57
+ }) => Promise<any>;
58
+ };
59
+ declare const useImportKey: () => {
60
+ importKey: (params?: {
61
+ key?: string;
62
+ }) => Promise<PublicWallet>;
63
+ };
64
+
65
+ declare const tron_useCreateWallet: typeof useCreateWallet;
66
+ declare const tron_useExportKey: typeof useExportKey;
67
+ declare const tron_useGetBalance: typeof useGetBalance;
68
+ declare const tron_useImportKey: typeof useImportKey;
69
+ declare const tron_useSendTransaction: typeof useSendTransaction;
70
+ declare const tron_useSignMessage: typeof useSignMessage;
71
+ declare const tron_useSignTransaction: typeof useSignTransaction;
72
+ declare const tron_useWallets: typeof useWallets;
73
+ declare namespace tron {
74
+ export { tron_useCreateWallet as useCreateWallet, tron_useExportKey as useExportKey, tron_useGetBalance as useGetBalance, tron_useImportKey as useImportKey, tron_useSendTransaction as useSendTransaction, tron_useSignMessage as useSignMessage, tron_useSignTransaction as useSignTransaction, tron_useWallets as useWallets };
75
+ }
76
+
77
+ export { useExportKey as a, useGetBalance as b, useImportKey as c, useSendTransaction as d, useSignMessage as e, useSignTransaction as f, useWallets as g, tron as t, useCreateWallet as u };
@@ -0,0 +1,77 @@
1
+ import { PublicWallet, TronGetBalanceResult, TronTransactionJson, TronSendTransactionParams, TronSendTransactionResult, TronSignMessageParams, TronSignMessageResult, TronSignTransactionParams, TronSignTransactionResult } from '@moon-x/core/types';
2
+
3
+ declare const useCreateWallet: (callbacks?: {
4
+ onSuccess?: (result: {
5
+ wallet: PublicWallet;
6
+ }) => void;
7
+ onError?: (error: Error) => void;
8
+ }) => {
9
+ createWallet: (options?: {
10
+ createAdditional?: boolean;
11
+ walletIndex?: number;
12
+ }) => Promise<{
13
+ wallet: PublicWallet;
14
+ }>;
15
+ };
16
+ declare const useWallets: () => {
17
+ wallets: PublicWallet[];
18
+ loading: boolean;
19
+ error?: Error;
20
+ refetch: () => void;
21
+ };
22
+ declare const useSignMessage: () => {
23
+ signMessage: (params: TronSignMessageParams) => Promise<TronSignMessageResult>;
24
+ loading: boolean;
25
+ error: undefined;
26
+ };
27
+ declare const useSignTransaction: () => {
28
+ signTransaction: (params: TronSignTransactionParams) => Promise<TronSignTransactionResult>;
29
+ loading: boolean;
30
+ error: undefined;
31
+ };
32
+ declare const useSendTransaction: () => {
33
+ sendTransaction: (params: {
34
+ transaction: TronTransactionJson;
35
+ wallet: PublicWallet;
36
+ /** Per-call chain selector: a configured tron id (e.g. "tron:mainnet"). */
37
+ chain?: string;
38
+ /** Inline fullnode override; falls back to provider config when omitted. */
39
+ rpcUrl?: string;
40
+ options?: TronSendTransactionParams["options"];
41
+ }) => Promise<TronSendTransactionResult>;
42
+ loading: boolean;
43
+ error: undefined;
44
+ };
45
+ declare const useGetBalance: () => {
46
+ getBalance: (params: {
47
+ wallet: PublicWallet;
48
+ chain?: string;
49
+ rpcUrl?: string;
50
+ }) => Promise<TronGetBalanceResult>;
51
+ loading: boolean;
52
+ error: undefined;
53
+ };
54
+ declare const useExportKey: () => {
55
+ exportKey: ({ wallet }: {
56
+ wallet: PublicWallet;
57
+ }) => Promise<any>;
58
+ };
59
+ declare const useImportKey: () => {
60
+ importKey: (params?: {
61
+ key?: string;
62
+ }) => Promise<PublicWallet>;
63
+ };
64
+
65
+ declare const tron_useCreateWallet: typeof useCreateWallet;
66
+ declare const tron_useExportKey: typeof useExportKey;
67
+ declare const tron_useGetBalance: typeof useGetBalance;
68
+ declare const tron_useImportKey: typeof useImportKey;
69
+ declare const tron_useSendTransaction: typeof useSendTransaction;
70
+ declare const tron_useSignMessage: typeof useSignMessage;
71
+ declare const tron_useSignTransaction: typeof useSignTransaction;
72
+ declare const tron_useWallets: typeof useWallets;
73
+ declare namespace tron {
74
+ export { tron_useCreateWallet as useCreateWallet, tron_useExportKey as useExportKey, tron_useGetBalance as useGetBalance, tron_useImportKey as useImportKey, tron_useSendTransaction as useSendTransaction, tron_useSignMessage as useSignMessage, tron_useSignTransaction as useSignTransaction, tron_useWallets as useWallets };
75
+ }
76
+
77
+ export { useExportKey as a, useGetBalance as b, useImportKey as c, useSendTransaction as d, useSignMessage as e, useSignTransaction as f, useWallets as g, tron as t, useCreateWallet as u };
@@ -1,4 +1,4 @@
1
1
  import '@moon-x/core/types';
2
- import '../base-wallet-CzJLpndu.mjs';
3
- export { E as EthereumGetBalanceParams, a as EthereumGetTokenAccountsParams, b as EthereumGetTokenAccountsResult, c as EthereumProvider, d as EthereumSendTransactionParams, f as EthereumSignMessageParams, g as EthereumSignTransactionParams, h as EthereumTokenAccount, i as EthereumWalletHooks, S as SendTransactionOptions, j as SendTransactionUIOptions, k as SignMessageUIOptions, l as SignTransactionOptions, m as SignTransactionUIOptions, U as UseFundWalletInterface, u as useCreateWallet, n as useEthereumProvider, o as useExportKey, p as useFundWallet, q as useGetBalance, r as useGetEthereumProvider, s as useImportKey, t as useSendTransaction, v as useSign7702Authorization, w as useSignHash, x as useSignMessage, y as useSignTransaction, z as useSignTypedData, A as useWallets } from '../ethereum-lovLlqC2.mjs';
2
+ import '../base-wallet-SjY7osPg.mjs';
3
+ export { E as EthereumGetBalanceParams, a as EthereumGetTokenAccountsParams, b as EthereumGetTokenAccountsResult, c as EthereumProvider, d as EthereumSendTransactionParams, f as EthereumSignMessageParams, g as EthereumSignTransactionParams, h as EthereumTokenAccount, i as EthereumWalletHooks, S as SendTransactionOptions, j as SendTransactionUIOptions, k as SignMessageUIOptions, l as SignTransactionOptions, m as SignTransactionUIOptions, U as UseFundWalletInterface, u as useCreateWallet, n as useEthereumProvider, o as useExportKey, p as useFundWallet, q as useGetBalance, r as useGetEthereumProvider, s as useImportKey, t as useSendTransaction, v as useSign7702Authorization, w as useSignHash, x as useSignMessage, y as useSignTransaction, z as useSignTypedData, A as useWallets } from '../ethereum-DIGoC1pP.mjs';
4
4
  import '@moon-x/core';
@@ -1,4 +1,4 @@
1
1
  import '@moon-x/core/types';
2
- import '../base-wallet-CzJLpndu.js';
3
- export { E as EthereumGetBalanceParams, a as EthereumGetTokenAccountsParams, b as EthereumGetTokenAccountsResult, c as EthereumProvider, d as EthereumSendTransactionParams, f as EthereumSignMessageParams, g as EthereumSignTransactionParams, h as EthereumTokenAccount, i as EthereumWalletHooks, S as SendTransactionOptions, j as SendTransactionUIOptions, k as SignMessageUIOptions, l as SignTransactionOptions, m as SignTransactionUIOptions, U as UseFundWalletInterface, u as useCreateWallet, n as useEthereumProvider, o as useExportKey, p as useFundWallet, q as useGetBalance, r as useGetEthereumProvider, s as useImportKey, t as useSendTransaction, v as useSign7702Authorization, w as useSignHash, x as useSignMessage, y as useSignTransaction, z as useSignTypedData, A as useWallets } from '../ethereum-Eg3cJKce.js';
2
+ import '../base-wallet-SjY7osPg.js';
3
+ export { E as EthereumGetBalanceParams, a as EthereumGetTokenAccountsParams, b as EthereumGetTokenAccountsResult, c as EthereumProvider, d as EthereumSendTransactionParams, f as EthereumSignMessageParams, g as EthereumSignTransactionParams, h as EthereumTokenAccount, i as EthereumWalletHooks, S as SendTransactionOptions, j as SendTransactionUIOptions, k as SignMessageUIOptions, l as SignTransactionOptions, m as SignTransactionUIOptions, U as UseFundWalletInterface, u as useCreateWallet, n as useEthereumProvider, o as useExportKey, p as useFundWallet, q as useGetBalance, r as useGetEthereumProvider, s as useImportKey, t as useSendTransaction, v as useSign7702Authorization, w as useSignHash, x as useSignMessage, y as useSignTransaction, z as useSignTypedData, A as useWallets } from '../ethereum-B0bChy5v.js';
4
4
  import '@moon-x/core';
@@ -1,4 +1,4 @@
1
1
  import '@moon-x/core/types';
2
- import '../base-wallet-CzJLpndu.mjs';
3
- export { S as SendTransactionOptions, a as SendTransactionUIOptions, b as SignMessageUIOptions, c as SignTransactionOptions, d as SignTransactionUIOptions, e as SolanaGetBalanceParams, f as SolanaGetTokenAccountsParams, g as SolanaGetTokenAccountsResult, h as SolanaSendTransactionParams, i as SolanaSignMessageParams, j as SolanaSignTransactionParams, k as SolanaTokenAccount, l as SolanaWalletHooks, U as UseFundWalletInterface, u as useCreateWallet, m as useExportKey, n as useFundWallet, o as useGetBalance, p as useGetTokenAccounts, q as useImportKey, r as useSendTransaction, t as useSignMessage, v as useSignTransaction, w as useWallets } from '../solana-BVrNImZ1.mjs';
2
+ import '../base-wallet-SjY7osPg.mjs';
3
+ export { S as SendTransactionOptions, a as SendTransactionUIOptions, b as SignMessageUIOptions, c as SignTransactionOptions, d as SignTransactionUIOptions, e as SolanaGetBalanceParams, f as SolanaGetTokenAccountsParams, g as SolanaGetTokenAccountsResult, h as SolanaSendTransactionParams, i as SolanaSignMessageParams, j as SolanaSignTransactionParams, k as SolanaTokenAccount, l as SolanaWalletHooks, U as UseFundWalletInterface, u as useCreateWallet, m as useExportKey, n as useFundWallet, o as useGetBalance, p as useGetTokenAccounts, q as useImportKey, r as useSendTransaction, t as useSignMessage, v as useSignTransaction, w as useWallets } from '../solana-nqJKbWX0.mjs';
4
4
  import '@moon-x/core';
@@ -1,4 +1,4 @@
1
1
  import '@moon-x/core/types';
2
- import '../base-wallet-CzJLpndu.js';
3
- export { S as SendTransactionOptions, a as SendTransactionUIOptions, b as SignMessageUIOptions, c as SignTransactionOptions, d as SignTransactionUIOptions, e as SolanaGetBalanceParams, f as SolanaGetTokenAccountsParams, g as SolanaGetTokenAccountsResult, h as SolanaSendTransactionParams, i as SolanaSignMessageParams, j as SolanaSignTransactionParams, k as SolanaTokenAccount, l as SolanaWalletHooks, U as UseFundWalletInterface, u as useCreateWallet, m as useExportKey, n as useFundWallet, o as useGetBalance, p as useGetTokenAccounts, q as useImportKey, r as useSendTransaction, t as useSignMessage, v as useSignTransaction, w as useWallets } from '../solana-C9rN8lxH.js';
2
+ import '../base-wallet-SjY7osPg.js';
3
+ export { S as SendTransactionOptions, a as SendTransactionUIOptions, b as SignMessageUIOptions, c as SignTransactionOptions, d as SignTransactionUIOptions, e as SolanaGetBalanceParams, f as SolanaGetTokenAccountsParams, g as SolanaGetTokenAccountsResult, h as SolanaSendTransactionParams, i as SolanaSignMessageParams, j as SolanaSignTransactionParams, k as SolanaTokenAccount, l as SolanaWalletHooks, U as UseFundWalletInterface, u as useCreateWallet, m as useExportKey, n as useFundWallet, o as useGetBalance, p as useGetTokenAccounts, q as useImportKey, r as useSendTransaction, t as useSignMessage, v as useSignTransaction, w as useWallets } from '../solana-D2QJgky5.js';
4
4
  import '@moon-x/core';
@@ -0,0 +1,2 @@
1
+ import '@moon-x/core/types';
2
+ export { u as useCreateWallet, a as useExportKey, b as useGetBalance, c as useImportKey, d as useSendTransaction, e as useSignMessage, f as useSignTransaction, g as useWallets } from '../tron-KzJqr-zA.mjs';
@@ -0,0 +1,2 @@
1
+ import '@moon-x/core/types';
2
+ export { u as useCreateWallet, a as useExportKey, b as useGetBalance, c as useImportKey, d as useSendTransaction, e as useSignMessage, f as useSignTransaction, g as useWallets } from '../tron-KzJqr-zA.js';
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ "use client";
6
+ var _chunkJHLZS7ZTjs = require('../chunk-JHLZS7ZT.js');
7
+ require('../chunk-SPXMMQ7Z.js');
8
+ exports.useCreateWallet = _chunkJHLZS7ZTjs.useCreateWallet;
9
+ exports.useExportKey = _chunkJHLZS7ZTjs.useExportKey;
10
+ exports.useGetBalance = _chunkJHLZS7ZTjs.useGetBalance;
11
+ exports.useImportKey = _chunkJHLZS7ZTjs.useImportKey;
12
+ exports.useSendTransaction = _chunkJHLZS7ZTjs.useSendTransaction;
13
+ exports.useSignMessage = _chunkJHLZS7ZTjs.useSignMessage;
14
+ exports.useSignTransaction = _chunkJHLZS7ZTjs.useSignTransaction;
15
+ exports.useWallets = _chunkJHLZS7ZTjs.useWallets;
@@ -0,0 +1,4 @@
1
+ "use client";
2
+ import { useCreateWallet, useExportKey, useGetBalance, useImportKey, useSendTransaction, useSignMessage, useSignTransaction, useWallets } from "../chunk-E7BPHFN5.mjs";
3
+ import "../chunk-PCEN5CH6.mjs";
4
+ export { useCreateWallet, useExportKey, useGetBalance, useImportKey, useSendTransaction, useSignMessage, useSignTransaction, useWallets };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moon-x/react-sdk",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "React authentication hooks and components for MoonX",
5
5
  "license": "UNLICENSED",
6
6
  "main": "dist/index.js",
@@ -22,6 +22,11 @@
22
22
  "import": "./dist/wallets/ethereum.mjs",
23
23
  "require": "./dist/wallets/ethereum.js"
24
24
  },
25
+ "./tron": {
26
+ "types": "./dist/wallets/tron.d.ts",
27
+ "import": "./dist/wallets/tron.mjs",
28
+ "require": "./dist/wallets/tron.js"
29
+ },
25
30
  "./style.css": "./dist/style.css"
26
31
  },
27
32
  "files": [
@@ -34,11 +39,11 @@
34
39
  "@simplewebauthn/browser": "^13.2.2",
35
40
  "@solana/wallet-adapter-base": "^0.9.27",
36
41
  "@solana/wallet-adapter-wallets": "^0.19.37",
42
+ "@solana/wallet-standard-wallet-adapter-base": "^1.1.4",
37
43
  "@solana/web3.js": "^1.98.4",
44
+ "@wallet-standard/app": "^1.1.0",
38
45
  "@swc/core": "^1.13.5",
39
46
  "@tanstack/react-query": "^5.90.5",
40
- "@wagmi/connectors": "^6.0.1",
41
- "@walletconnect/client": "^1.8.0",
42
47
  "@walletconnect/sign-client": "^2.22.4",
43
48
  "bn.js": "5.2.3",
44
49
  "bs58": "^6.0.0",
@@ -50,9 +55,8 @@
50
55
  "react-i18next": "15.7.4",
51
56
  "siwe": "3.0.0",
52
57
  "tweetnacl": "1.0.3",
53
- "viem": "^2.38.2",
54
- "wagmi": "^2.18.1",
55
- "@moon-x/core": "0.13.0"
58
+ "viem": "2.38.2",
59
+ "@moon-x/core": "0.14.0"
56
60
  },
57
61
  "devDependencies": {
58
62
  "tsup": "^8.0.0",