@luno-kit/core 0.0.10 → 0.0.11
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/chain-BcRYsO36.d.cts +194 -0
- package/dist/chain-BcRYsO36.d.ts +194 -0
- package/dist/chains/index.cjs +1 -1
- package/dist/chains/index.d.cts +1 -2
- package/dist/chains/index.d.ts +1 -2
- package/dist/chains/index.js +1 -1
- package/dist/chunk-4237KM7K.js +3 -0
- package/dist/chunk-4237KM7K.js.map +1 -0
- package/dist/{chunk-UXRZAYEH.cjs → chunk-5F3MRGVJ.cjs} +2 -2
- package/dist/chunk-5F3MRGVJ.cjs.map +1 -0
- package/dist/{chunk-AND4WL4I.js → chunk-P7YOYVKP.js} +2 -2
- package/dist/chunk-P7YOYVKP.js.map +1 -0
- package/dist/chunk-QL6JNH54.cjs +3 -0
- package/dist/chunk-QL6JNH54.cjs.map +1 -0
- package/dist/chunk-UFHE4N3F.cjs +2 -0
- package/dist/chunk-UFHE4N3F.cjs.map +1 -0
- package/dist/chunk-WICFE46E.js +2 -0
- package/dist/chunk-WICFE46E.js.map +1 -0
- package/dist/connectors/index.cjs +2 -2
- package/dist/connectors/index.cjs.map +1 -1
- package/dist/connectors/index.d.cts +33 -7
- package/dist/connectors/index.d.ts +33 -7
- package/dist/connectors/index.js +2 -2
- package/dist/connectors/index.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +8 -192
- package/dist/types/index.d.ts +8 -192
- package/dist/types/index.js +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.cts +3 -3
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.js +1 -1
- package/package.json +4 -1
- package/dist/chunk-5WHVXOMN.js +0 -3
- package/dist/chunk-5WHVXOMN.js.map +0 -1
- package/dist/chunk-AND4WL4I.js.map +0 -1
- package/dist/chunk-UXRZAYEH.cjs.map +0 -1
- package/dist/chunk-VDC6UBTV.cjs +0 -3
- package/dist/chunk-VDC6UBTV.cjs.map +0 -1
package/dist/types/index.d.cts
CHANGED
|
@@ -1,195 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import { ApiOptions } from 'dedot';
|
|
3
|
-
import { AnyShape } from 'dedot/shape';
|
|
4
|
-
import { Metadata } from '@walletconnect/universal-provider';
|
|
5
|
-
import { EventEmitter } from 'eventemitter3';
|
|
1
|
+
export { e as ACCOUNT_TYPE, A as Account, d as AccountBalance, b as Chain, a as Config, f as Connector, c as ConnectorLinks, C as CreateConfigParameters, H as HexString, L as LunoStorage, R as RawStorage, S as Signer, T as Transport, W as WalletConnectConnectorOptions } from '../chain-BcRYsO36.cjs';
|
|
6
2
|
export { PolkadotSigner as PapiSigner } from '@polkadot-api/pjs-signer';
|
|
3
|
+
import 'dedot/types';
|
|
4
|
+
import 'dedot';
|
|
5
|
+
import 'dedot/shape';
|
|
6
|
+
import '@walletconnect/universal-provider';
|
|
7
|
+
import 'eventemitter3';
|
|
7
8
|
|
|
8
|
-
type
|
|
9
|
-
/**
|
|
10
|
-
* Polkadot account interface
|
|
11
|
-
* Represents a chain account
|
|
12
|
-
*/
|
|
13
|
-
interface Account {
|
|
14
|
-
/**
|
|
15
|
-
* account address (original format from wallet)
|
|
16
|
-
* specific SS58 formatting should be done in the React layer based on the chain.
|
|
17
|
-
*/
|
|
18
|
-
address: string;
|
|
19
|
-
/** account name (if any) */
|
|
20
|
-
name?: string;
|
|
21
|
-
/**
|
|
22
|
-
* account public key (hex format, without 0x prefix)
|
|
23
|
-
* used for cross-chain address conversion and verification
|
|
24
|
-
*/
|
|
25
|
-
publicKey?: HexString;
|
|
26
|
-
/**
|
|
27
|
-
* other metadata
|
|
28
|
-
* including account source, control method, etc.
|
|
29
|
-
*/
|
|
30
|
-
meta?: {
|
|
31
|
-
/** account source (e.g. 'polkadot-js', 'subwallet-js', 'talisman' etc.) */
|
|
32
|
-
source?: string;
|
|
33
|
-
/** genesis hash (if the wallet provides a specific chain account) */
|
|
34
|
-
genesisHash?: string | null;
|
|
35
|
-
/** other custom metadata */
|
|
36
|
-
[key: string]: any;
|
|
37
|
-
};
|
|
38
|
-
type?: KeypairType;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* account balance information
|
|
42
|
-
*/
|
|
43
|
-
interface AccountBalance {
|
|
44
|
-
/** available balance (in smallest unit) */
|
|
45
|
-
free: bigint;
|
|
46
|
-
/** total balance (in smallest unit) */
|
|
47
|
-
total: bigint;
|
|
48
|
-
/** reserved balance (in smallest unit) */
|
|
49
|
-
reserved: bigint;
|
|
50
|
-
/**
|
|
51
|
-
* transferable balance (in smallest unit)
|
|
52
|
-
* free minus various locked amounts
|
|
53
|
-
*/
|
|
54
|
-
transferable: bigint;
|
|
55
|
-
/** formatted available balance (with unit, for display) */
|
|
56
|
-
formattedTransferable: string;
|
|
57
|
-
/** formatted total balance (with unit, for display) */
|
|
58
|
-
formattedTotal: string;
|
|
59
|
-
/** lock details (if any) */
|
|
60
|
-
locks?: Array<{
|
|
61
|
-
id: string;
|
|
62
|
-
amount: bigint;
|
|
63
|
-
reason: string;
|
|
64
|
-
lockHuman: string;
|
|
65
|
-
}>;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* account type enum
|
|
69
|
-
*/
|
|
70
|
-
declare enum ACCOUNT_TYPE {
|
|
71
|
-
/** normal account */
|
|
72
|
-
NORMAL = "normal",
|
|
73
|
-
/** multisig account */
|
|
74
|
-
MULTISIG = "multisig",
|
|
75
|
-
/** proxy account */
|
|
76
|
-
PROXY = "proxy",
|
|
77
|
-
/** smart contract account */
|
|
78
|
-
CONTRACT = "contract"
|
|
79
|
-
}
|
|
9
|
+
type Optional<T> = T | undefined;
|
|
80
10
|
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
interface ConnectorLinks {
|
|
85
|
-
browserExtension?: string;
|
|
86
|
-
deepLink?: string;
|
|
87
|
-
}
|
|
88
|
-
interface Connector extends EventEmitter {
|
|
89
|
-
readonly id: string;
|
|
90
|
-
readonly name: string;
|
|
91
|
-
readonly icon: string;
|
|
92
|
-
readonly links: ConnectorLinks;
|
|
93
|
-
isAvailable(): Promise<boolean>;
|
|
94
|
-
isInstalled: () => boolean;
|
|
95
|
-
connect(appName: string, chains?: Chain[], targetChainId?: string): Promise<Account[] | undefined>;
|
|
96
|
-
disconnect(): Promise<void>;
|
|
97
|
-
getAccounts(): Promise<Array<Account>>;
|
|
98
|
-
getSigner(): Promise<Signer | undefined>;
|
|
99
|
-
signMessage(message: string, address: string): Promise<string | undefined>;
|
|
100
|
-
hasConnectionUri(): boolean;
|
|
101
|
-
getConnectionUri(): Promise<string | undefined>;
|
|
102
|
-
on(event: 'connect', listener: (accounts: Account[]) => void): this;
|
|
103
|
-
on(event: 'disconnect', listener: () => void): this;
|
|
104
|
-
on(event: 'accountsChanged', listener: (accounts: Account[]) => void): this;
|
|
105
|
-
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
106
|
-
off(event: 'connect', listener: (accounts: Account[]) => void): this;
|
|
107
|
-
off(event: 'disconnect', listener: () => void): this;
|
|
108
|
-
off(event: 'accountsChanged', listener: (accounts: Account[]) => void): this;
|
|
109
|
-
off(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
110
|
-
}
|
|
111
|
-
interface WalletConnectConnectorOptions {
|
|
112
|
-
id?: string;
|
|
113
|
-
name?: string;
|
|
114
|
-
icon?: string;
|
|
115
|
-
projectId: string;
|
|
116
|
-
relayUrl?: string;
|
|
117
|
-
metadata?: Metadata;
|
|
118
|
-
links?: ConnectorLinks;
|
|
119
|
-
supportedChains?: HexString[];
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
interface RawStorage {
|
|
123
|
-
getItem(key: string): string | null | Promise<string | null>;
|
|
124
|
-
setItem(key: string, value: string): void | Promise<void>;
|
|
125
|
-
removeItem(key: string): void | Promise<void>;
|
|
126
|
-
}
|
|
127
|
-
interface LunoStorage {
|
|
128
|
-
getItem(keySuffix: string): Promise<string | null>;
|
|
129
|
-
setItem(keySuffix: string, value: string): Promise<void>;
|
|
130
|
-
removeItem(keySuffix: string): Promise<void>;
|
|
131
|
-
}
|
|
132
|
-
type Transport = Readonly<string[]>;
|
|
133
|
-
type LunoApiOptions = Partial<Omit<ApiOptions, 'provider' | 'signer'>> & {
|
|
134
|
-
customTypes?: Record<string, AnyShape>;
|
|
135
|
-
customRpc?: Record<string, any>;
|
|
136
|
-
};
|
|
137
|
-
interface CreateConfigParameters extends LunoApiOptions {
|
|
138
|
-
appName?: string;
|
|
139
|
-
chains?: readonly Chain[];
|
|
140
|
-
connectors: Connector[];
|
|
141
|
-
transports?: Record<string, Transport>;
|
|
142
|
-
storage?: LunoStorage;
|
|
143
|
-
autoConnect?: boolean;
|
|
144
|
-
subscan?: {
|
|
145
|
-
apiKey: string;
|
|
146
|
-
cacheTime?: number;
|
|
147
|
-
retryCount?: number;
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
interface Config extends LunoApiOptions {
|
|
151
|
-
readonly appName: string;
|
|
152
|
-
readonly chains: readonly Chain[];
|
|
153
|
-
readonly connectors: readonly Connector[];
|
|
154
|
-
readonly transports: Readonly<Record<string, Transport>>;
|
|
155
|
-
readonly storage: LunoStorage;
|
|
156
|
-
readonly autoConnect: boolean;
|
|
157
|
-
readonly subscan?: {
|
|
158
|
-
apiKey: string;
|
|
159
|
-
cacheTime?: number;
|
|
160
|
-
retryCount?: number;
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
interface Chain {
|
|
165
|
-
genesisHash: HexString;
|
|
166
|
-
name: string;
|
|
167
|
-
nativeCurrency: {
|
|
168
|
-
name: string;
|
|
169
|
-
symbol: string;
|
|
170
|
-
decimals: number;
|
|
171
|
-
};
|
|
172
|
-
rpcUrls: {
|
|
173
|
-
webSocket: Transport;
|
|
174
|
-
http?: readonly string[];
|
|
175
|
-
};
|
|
176
|
-
ss58Format: number;
|
|
177
|
-
blockExplorers?: {
|
|
178
|
-
default?: {
|
|
179
|
-
name: string;
|
|
180
|
-
url: string;
|
|
181
|
-
};
|
|
182
|
-
[key: string]: {
|
|
183
|
-
name: string;
|
|
184
|
-
url: string;
|
|
185
|
-
} | undefined;
|
|
186
|
-
};
|
|
187
|
-
testnet: boolean;
|
|
188
|
-
chainIconUrl: string;
|
|
189
|
-
subscan?: {
|
|
190
|
-
api: string;
|
|
191
|
-
url: string;
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
export { ACCOUNT_TYPE, type Account, type AccountBalance, type Chain, type Config, type Connector, type ConnectorLinks, type CreateConfigParameters, type HexString, type LunoStorage, type RawStorage, type Signer, type Transport, type WalletConnectConnectorOptions };
|
|
11
|
+
export type { Optional };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,195 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
import { ApiOptions } from 'dedot';
|
|
3
|
-
import { AnyShape } from 'dedot/shape';
|
|
4
|
-
import { Metadata } from '@walletconnect/universal-provider';
|
|
5
|
-
import { EventEmitter } from 'eventemitter3';
|
|
1
|
+
export { e as ACCOUNT_TYPE, A as Account, d as AccountBalance, b as Chain, a as Config, f as Connector, c as ConnectorLinks, C as CreateConfigParameters, H as HexString, L as LunoStorage, R as RawStorage, S as Signer, T as Transport, W as WalletConnectConnectorOptions } from '../chain-BcRYsO36.js';
|
|
6
2
|
export { PolkadotSigner as PapiSigner } from '@polkadot-api/pjs-signer';
|
|
3
|
+
import 'dedot/types';
|
|
4
|
+
import 'dedot';
|
|
5
|
+
import 'dedot/shape';
|
|
6
|
+
import '@walletconnect/universal-provider';
|
|
7
|
+
import 'eventemitter3';
|
|
7
8
|
|
|
8
|
-
type
|
|
9
|
-
/**
|
|
10
|
-
* Polkadot account interface
|
|
11
|
-
* Represents a chain account
|
|
12
|
-
*/
|
|
13
|
-
interface Account {
|
|
14
|
-
/**
|
|
15
|
-
* account address (original format from wallet)
|
|
16
|
-
* specific SS58 formatting should be done in the React layer based on the chain.
|
|
17
|
-
*/
|
|
18
|
-
address: string;
|
|
19
|
-
/** account name (if any) */
|
|
20
|
-
name?: string;
|
|
21
|
-
/**
|
|
22
|
-
* account public key (hex format, without 0x prefix)
|
|
23
|
-
* used for cross-chain address conversion and verification
|
|
24
|
-
*/
|
|
25
|
-
publicKey?: HexString;
|
|
26
|
-
/**
|
|
27
|
-
* other metadata
|
|
28
|
-
* including account source, control method, etc.
|
|
29
|
-
*/
|
|
30
|
-
meta?: {
|
|
31
|
-
/** account source (e.g. 'polkadot-js', 'subwallet-js', 'talisman' etc.) */
|
|
32
|
-
source?: string;
|
|
33
|
-
/** genesis hash (if the wallet provides a specific chain account) */
|
|
34
|
-
genesisHash?: string | null;
|
|
35
|
-
/** other custom metadata */
|
|
36
|
-
[key: string]: any;
|
|
37
|
-
};
|
|
38
|
-
type?: KeypairType;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* account balance information
|
|
42
|
-
*/
|
|
43
|
-
interface AccountBalance {
|
|
44
|
-
/** available balance (in smallest unit) */
|
|
45
|
-
free: bigint;
|
|
46
|
-
/** total balance (in smallest unit) */
|
|
47
|
-
total: bigint;
|
|
48
|
-
/** reserved balance (in smallest unit) */
|
|
49
|
-
reserved: bigint;
|
|
50
|
-
/**
|
|
51
|
-
* transferable balance (in smallest unit)
|
|
52
|
-
* free minus various locked amounts
|
|
53
|
-
*/
|
|
54
|
-
transferable: bigint;
|
|
55
|
-
/** formatted available balance (with unit, for display) */
|
|
56
|
-
formattedTransferable: string;
|
|
57
|
-
/** formatted total balance (with unit, for display) */
|
|
58
|
-
formattedTotal: string;
|
|
59
|
-
/** lock details (if any) */
|
|
60
|
-
locks?: Array<{
|
|
61
|
-
id: string;
|
|
62
|
-
amount: bigint;
|
|
63
|
-
reason: string;
|
|
64
|
-
lockHuman: string;
|
|
65
|
-
}>;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* account type enum
|
|
69
|
-
*/
|
|
70
|
-
declare enum ACCOUNT_TYPE {
|
|
71
|
-
/** normal account */
|
|
72
|
-
NORMAL = "normal",
|
|
73
|
-
/** multisig account */
|
|
74
|
-
MULTISIG = "multisig",
|
|
75
|
-
/** proxy account */
|
|
76
|
-
PROXY = "proxy",
|
|
77
|
-
/** smart contract account */
|
|
78
|
-
CONTRACT = "contract"
|
|
79
|
-
}
|
|
9
|
+
type Optional<T> = T | undefined;
|
|
80
10
|
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
interface ConnectorLinks {
|
|
85
|
-
browserExtension?: string;
|
|
86
|
-
deepLink?: string;
|
|
87
|
-
}
|
|
88
|
-
interface Connector extends EventEmitter {
|
|
89
|
-
readonly id: string;
|
|
90
|
-
readonly name: string;
|
|
91
|
-
readonly icon: string;
|
|
92
|
-
readonly links: ConnectorLinks;
|
|
93
|
-
isAvailable(): Promise<boolean>;
|
|
94
|
-
isInstalled: () => boolean;
|
|
95
|
-
connect(appName: string, chains?: Chain[], targetChainId?: string): Promise<Account[] | undefined>;
|
|
96
|
-
disconnect(): Promise<void>;
|
|
97
|
-
getAccounts(): Promise<Array<Account>>;
|
|
98
|
-
getSigner(): Promise<Signer | undefined>;
|
|
99
|
-
signMessage(message: string, address: string): Promise<string | undefined>;
|
|
100
|
-
hasConnectionUri(): boolean;
|
|
101
|
-
getConnectionUri(): Promise<string | undefined>;
|
|
102
|
-
on(event: 'connect', listener: (accounts: Account[]) => void): this;
|
|
103
|
-
on(event: 'disconnect', listener: () => void): this;
|
|
104
|
-
on(event: 'accountsChanged', listener: (accounts: Account[]) => void): this;
|
|
105
|
-
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
106
|
-
off(event: 'connect', listener: (accounts: Account[]) => void): this;
|
|
107
|
-
off(event: 'disconnect', listener: () => void): this;
|
|
108
|
-
off(event: 'accountsChanged', listener: (accounts: Account[]) => void): this;
|
|
109
|
-
off(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
110
|
-
}
|
|
111
|
-
interface WalletConnectConnectorOptions {
|
|
112
|
-
id?: string;
|
|
113
|
-
name?: string;
|
|
114
|
-
icon?: string;
|
|
115
|
-
projectId: string;
|
|
116
|
-
relayUrl?: string;
|
|
117
|
-
metadata?: Metadata;
|
|
118
|
-
links?: ConnectorLinks;
|
|
119
|
-
supportedChains?: HexString[];
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
interface RawStorage {
|
|
123
|
-
getItem(key: string): string | null | Promise<string | null>;
|
|
124
|
-
setItem(key: string, value: string): void | Promise<void>;
|
|
125
|
-
removeItem(key: string): void | Promise<void>;
|
|
126
|
-
}
|
|
127
|
-
interface LunoStorage {
|
|
128
|
-
getItem(keySuffix: string): Promise<string | null>;
|
|
129
|
-
setItem(keySuffix: string, value: string): Promise<void>;
|
|
130
|
-
removeItem(keySuffix: string): Promise<void>;
|
|
131
|
-
}
|
|
132
|
-
type Transport = Readonly<string[]>;
|
|
133
|
-
type LunoApiOptions = Partial<Omit<ApiOptions, 'provider' | 'signer'>> & {
|
|
134
|
-
customTypes?: Record<string, AnyShape>;
|
|
135
|
-
customRpc?: Record<string, any>;
|
|
136
|
-
};
|
|
137
|
-
interface CreateConfigParameters extends LunoApiOptions {
|
|
138
|
-
appName?: string;
|
|
139
|
-
chains?: readonly Chain[];
|
|
140
|
-
connectors: Connector[];
|
|
141
|
-
transports?: Record<string, Transport>;
|
|
142
|
-
storage?: LunoStorage;
|
|
143
|
-
autoConnect?: boolean;
|
|
144
|
-
subscan?: {
|
|
145
|
-
apiKey: string;
|
|
146
|
-
cacheTime?: number;
|
|
147
|
-
retryCount?: number;
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
interface Config extends LunoApiOptions {
|
|
151
|
-
readonly appName: string;
|
|
152
|
-
readonly chains: readonly Chain[];
|
|
153
|
-
readonly connectors: readonly Connector[];
|
|
154
|
-
readonly transports: Readonly<Record<string, Transport>>;
|
|
155
|
-
readonly storage: LunoStorage;
|
|
156
|
-
readonly autoConnect: boolean;
|
|
157
|
-
readonly subscan?: {
|
|
158
|
-
apiKey: string;
|
|
159
|
-
cacheTime?: number;
|
|
160
|
-
retryCount?: number;
|
|
161
|
-
};
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
interface Chain {
|
|
165
|
-
genesisHash: HexString;
|
|
166
|
-
name: string;
|
|
167
|
-
nativeCurrency: {
|
|
168
|
-
name: string;
|
|
169
|
-
symbol: string;
|
|
170
|
-
decimals: number;
|
|
171
|
-
};
|
|
172
|
-
rpcUrls: {
|
|
173
|
-
webSocket: Transport;
|
|
174
|
-
http?: readonly string[];
|
|
175
|
-
};
|
|
176
|
-
ss58Format: number;
|
|
177
|
-
blockExplorers?: {
|
|
178
|
-
default?: {
|
|
179
|
-
name: string;
|
|
180
|
-
url: string;
|
|
181
|
-
};
|
|
182
|
-
[key: string]: {
|
|
183
|
-
name: string;
|
|
184
|
-
url: string;
|
|
185
|
-
} | undefined;
|
|
186
|
-
};
|
|
187
|
-
testnet: boolean;
|
|
188
|
-
chainIconUrl: string;
|
|
189
|
-
subscan?: {
|
|
190
|
-
api: string;
|
|
191
|
-
url: string;
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
export { ACCOUNT_TYPE, type Account, type AccountBalance, type Chain, type Config, type Connector, type ConnectorLinks, type CreateConfigParameters, type HexString, type LunoStorage, type RawStorage, type Signer, type Transport, type WalletConnectConnectorOptions };
|
|
11
|
+
export type { Optional };
|
package/dist/types/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var r=(t=>(t.NORMAL="normal",t.MULTISIG="multisig",t.PROXY="proxy",t.CONTRACT="contract",t))(r||{});export{r as ACCOUNT_TYPE};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/account.ts"],"names":["ACCOUNT_TYPE"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/types/account.ts"],"names":["ACCOUNT_TYPE"],"mappings":"AAgFO,IAAKA,CAAAA,CAAAA,CAAAA,CAAAA,GAEVA,CAAAA,CAAA,MAAA,CAAS,QAAA,CAGTA,CAAAA,CAAA,QAAA,CAAW,UAAA,CAGXA,CAAAA,CAAA,KAAA,CAAQ,OAAA,CAGRA,CAAAA,CAAA,QAAA,CAAW,WAXDA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA","file":"index.js","sourcesContent":["import type { KeypairType } from 'dedot/types';\n\nexport type HexString = `0x${string}`;\n\n/**\n * Polkadot account interface\n * Represents a chain account\n */\nexport interface Account {\n /**\n * account address (original format from wallet)\n * specific SS58 formatting should be done in the React layer based on the chain.\n */\n address: string;\n\n /** account name (if any) */\n name?: Optional<string>;\n\n /**\n * account public key (hex format, without 0x prefix)\n * used for cross-chain address conversion and verification\n */\n publicKey?: Optional<HexString>;\n\n /**\n * other metadata\n * including account source, control method, etc.\n */\n meta?: Optional<{\n /** account source (e.g. 'polkadot-js', 'subwallet-js', 'talisman' etc.) */\n source?: Optional<string>;\n\n /** genesis hash (if the wallet provides a specific chain account) */\n genesisHash?: Optional<string | null>;\n\n /** other custom metadata */\n [key: string]: any;\n }>;\n type?: Optional<KeypairType>;\n}\n\n/**\n * account balance information\n */\nexport interface AccountBalance {\n /** available balance (in smallest unit) */\n free: bigint;\n\n /** total balance (in smallest unit) */\n total: bigint;\n\n /** reserved balance (in smallest unit) */\n reserved: bigint;\n\n /**\n * transferable balance (in smallest unit)\n * free minus various locked amounts\n */\n transferable: bigint;\n\n /** formatted available balance (with unit, for display) */\n formattedTransferable: string;\n\n /** formatted total balance (with unit, for display) */\n formattedTotal: string;\n\n /** lock details (if any) */\n locks?: Optional<\n Array<{\n id: string;\n amount: bigint;\n reason: string;\n lockHuman: string;\n }>\n >;\n}\n\n/**\n * account type enum\n */\nexport enum ACCOUNT_TYPE {\n /** normal account */\n NORMAL = 'normal',\n\n /** multisig account */\n MULTISIG = 'multisig',\n\n /** proxy account */\n PROXY = 'proxy',\n\n /** smart contract account */\n CONTRACT = 'contract',\n}\n"]}
|
package/dist/utils/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunk5F3MRGVJ_cjs=require('../chunk-5F3MRGVJ.cjs');Object.defineProperty(exports,"convertAddress",{enumerable:true,get:function(){return chunk5F3MRGVJ_cjs.b}});Object.defineProperty(exports,"createPapiSigner",{enumerable:true,get:function(){return chunk5F3MRGVJ_cjs.m}});Object.defineProperty(exports,"defineChain",{enumerable:true,get:function(){return chunk5F3MRGVJ_cjs.f}});Object.defineProperty(exports,"formatAddress",{enumerable:true,get:function(){return chunk5F3MRGVJ_cjs.k}});Object.defineProperty(exports,"formatBalance",{enumerable:true,get:function(){return chunk5F3MRGVJ_cjs.j}});Object.defineProperty(exports,"formatBalanceWithUnit",{enumerable:true,get:function(){return chunk5F3MRGVJ_cjs.l}});Object.defineProperty(exports,"getChainToken",{enumerable:true,get:function(){return chunk5F3MRGVJ_cjs.g}});Object.defineProperty(exports,"getExplorerUrl",{enumerable:true,get:function(){return chunk5F3MRGVJ_cjs.h}});Object.defineProperty(exports,"getPublicKey",{enumerable:true,get:function(){return chunk5F3MRGVJ_cjs.d}});Object.defineProperty(exports,"isMobileDevice",{enumerable:true,get:function(){return chunk5F3MRGVJ_cjs.i}});Object.defineProperty(exports,"isSameAddress",{enumerable:true,get:function(){return chunk5F3MRGVJ_cjs.c}});Object.defineProperty(exports,"isValidAddress",{enumerable:true,get:function(){return chunk5F3MRGVJ_cjs.a}});Object.defineProperty(exports,"mapInjectedAccounts",{enumerable:true,get:function(){return chunk5F3MRGVJ_cjs.e}});//# sourceMappingURL=index.cjs.map
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/utils/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InjectedAccount } from 'dedot/types';
|
|
2
|
-
import { Account, Chain, Signer } from '../
|
|
2
|
+
import { A as Account, b as Chain, S as Signer } from '../chain-BcRYsO36.cjs';
|
|
3
3
|
import { PolkadotSigner } from '@polkadot-api/pjs-signer';
|
|
4
4
|
export { PolkadotSigner as PapiSigner } from '@polkadot-api/pjs-signer';
|
|
5
5
|
export { formatBalance as formatBalanceWithUnit } from 'dedot/utils';
|
|
@@ -39,11 +39,11 @@ declare const isMobileDevice: () => boolean;
|
|
|
39
39
|
/**
|
|
40
40
|
* format balance
|
|
41
41
|
*/
|
|
42
|
-
declare function formatBalance(value: string | number | bigint
|
|
42
|
+
declare function formatBalance(value: Optional<string | number | bigint>, decimals?: number, fixedDecimals?: number): string;
|
|
43
43
|
/**
|
|
44
44
|
* format address display
|
|
45
45
|
*/
|
|
46
|
-
declare function formatAddress(address?: string
|
|
46
|
+
declare function formatAddress(address?: Optional<string>, prefixLength?: number, suffixLength?: number): string;
|
|
47
47
|
|
|
48
48
|
declare function createPapiSigner(address: string, signer: Signer): Promise<PolkadotSigner | undefined>;
|
|
49
49
|
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InjectedAccount } from 'dedot/types';
|
|
2
|
-
import { Account, Chain, Signer } from '../
|
|
2
|
+
import { A as Account, b as Chain, S as Signer } from '../chain-BcRYsO36.js';
|
|
3
3
|
import { PolkadotSigner } from '@polkadot-api/pjs-signer';
|
|
4
4
|
export { PolkadotSigner as PapiSigner } from '@polkadot-api/pjs-signer';
|
|
5
5
|
export { formatBalance as formatBalanceWithUnit } from 'dedot/utils';
|
|
@@ -39,11 +39,11 @@ declare const isMobileDevice: () => boolean;
|
|
|
39
39
|
/**
|
|
40
40
|
* format balance
|
|
41
41
|
*/
|
|
42
|
-
declare function formatBalance(value: string | number | bigint
|
|
42
|
+
declare function formatBalance(value: Optional<string | number | bigint>, decimals?: number, fixedDecimals?: number): string;
|
|
43
43
|
/**
|
|
44
44
|
* format address display
|
|
45
45
|
*/
|
|
46
|
-
declare function formatAddress(address?: string
|
|
46
|
+
declare function formatAddress(address?: Optional<string>, prefixLength?: number, suffixLength?: number): string;
|
|
47
47
|
|
|
48
48
|
declare function createPapiSigner(address: string, signer: Signer): Promise<PolkadotSigner | undefined>;
|
|
49
49
|
|
package/dist/utils/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{b as convertAddress,m as createPapiSigner,f as defineChain,k as formatAddress,j as formatBalance,l as formatBalanceWithUnit,g as getChainToken,h as getExplorerUrl,d as getPublicKey,i as isMobileDevice,c as isSameAddress,a as isValidAddress,e as mapInjectedAccounts}from'../chunk-
|
|
1
|
+
export{b as convertAddress,m as createPapiSigner,f as defineChain,k as formatAddress,j as formatBalance,l as formatBalanceWithUnit,g as getChainToken,h as getExplorerUrl,d as getPublicKey,i as isMobileDevice,c as isSameAddress,a as isValidAddress,e as mapInjectedAccounts}from'../chunk-P7YOYVKP.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luno-kit/core",
|
|
3
3
|
"description": "Core module for Luno, providing foundational utilities, types, configuration, and connectors for Polkadot wallet interactions.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.11",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"polkadot",
|
|
@@ -51,9 +51,12 @@
|
|
|
51
51
|
],
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@dedot/chaintypes": "0.152.0",
|
|
54
|
+
"@ledgerhq/hw-transport-webusb": "6.29.13",
|
|
54
55
|
"@mimirdev/apps-inject": "3.2.0",
|
|
55
56
|
"@polkadot-api/pjs-signer": "0.6.14",
|
|
56
57
|
"@walletconnect/universal-provider": "2.21.4",
|
|
58
|
+
"@zondax/ledger-substrate": "2.0.0",
|
|
59
|
+
"buffer": "6.0.3",
|
|
57
60
|
"dedot": "0.16.0",
|
|
58
61
|
"eventemitter3": "5.0.1"
|
|
59
62
|
},
|