@luno-kit/core 0.0.8 → 0.0.9
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/chains/index.cjs +2 -2
- package/dist/chains/index.cjs.map +1 -1
- package/dist/chains/index.d.cts +6 -1
- package/dist/chains/index.d.ts +6 -1
- package/dist/chains/index.js +2 -2
- package/dist/chains/index.js.map +1 -1
- package/dist/connectors/index.cjs +1 -1
- package/dist/connectors/index.cjs.map +1 -1
- package/dist/connectors/index.d.cts +4 -3
- package/dist/connectors/index.d.ts +4 -3
- package/dist/connectors/index.js +1 -1
- 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 +3 -7
- package/dist/index.d.ts +3 -7
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.cts +160 -10
- package/dist/types/index.d.ts +160 -10
- package/dist/utils/index.d.cts +5 -2
- package/dist/utils/index.d.ts +5 -2
- package/package.json +1 -1
- package/dist/chain-xQJ0MDiz.d.cts +0 -103
- package/dist/chain-xQJ0MDiz.d.ts +0 -103
- package/dist/connector-LTtOKOSm.d.ts +0 -44
- package/dist/connector-LleKwjLP.d.cts +0 -44
- package/dist/signer-BimV-6cq.d.cts +0 -6
- package/dist/signer-BimV-6cq.d.ts +0 -6
package/dist/types/index.d.cts
CHANGED
|
@@ -1,14 +1,123 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { b as ACCOUNT_TYPE, A as Account, a as AccountBalance, H as HexString } from '../chain-xQJ0MDiz.cjs';
|
|
1
|
+
import { KeypairType, InjectedSigner } from 'dedot/types';
|
|
3
2
|
import { ApiOptions } from 'dedot';
|
|
4
3
|
import { AnyShape } from 'dedot/shape';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
export { S as Signer } from '../signer-BimV-6cq.cjs';
|
|
4
|
+
import { Metadata } from '@walletconnect/universal-provider';
|
|
5
|
+
import { EventEmitter } from 'eventemitter3';
|
|
8
6
|
export { PolkadotSigner as PapiSigner } from '@polkadot-api/pjs-signer';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
|
|
8
|
+
type HexString = `0x${string}`;
|
|
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
|
+
}
|
|
80
|
+
|
|
81
|
+
interface Signer extends InjectedSigner {
|
|
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
|
+
}
|
|
12
121
|
|
|
13
122
|
interface RawStorage {
|
|
14
123
|
getItem(key: string): string | null | Promise<string | null>;
|
|
@@ -20,7 +129,7 @@ interface LunoStorage {
|
|
|
20
129
|
setItem(keySuffix: string, value: string): Promise<void>;
|
|
21
130
|
removeItem(keySuffix: string): Promise<void>;
|
|
22
131
|
}
|
|
23
|
-
type Transport = string
|
|
132
|
+
type Transport = Readonly<string[]>;
|
|
24
133
|
type LunoApiOptions = Partial<Omit<ApiOptions, 'provider' | 'signer'>> & {
|
|
25
134
|
customTypes?: Record<string, AnyShape>;
|
|
26
135
|
customRpc?: Record<string, any>;
|
|
@@ -32,6 +141,11 @@ interface CreateConfigParameters extends LunoApiOptions {
|
|
|
32
141
|
transports?: Record<string, Transport>;
|
|
33
142
|
storage?: LunoStorage;
|
|
34
143
|
autoConnect?: boolean;
|
|
144
|
+
subscan?: {
|
|
145
|
+
apiKey: string;
|
|
146
|
+
cacheTime?: number;
|
|
147
|
+
retryCount?: number;
|
|
148
|
+
};
|
|
35
149
|
}
|
|
36
150
|
interface Config extends LunoApiOptions {
|
|
37
151
|
readonly appName: string;
|
|
@@ -40,6 +154,42 @@ interface Config extends LunoApiOptions {
|
|
|
40
154
|
readonly transports: Readonly<Record<string, Transport>>;
|
|
41
155
|
readonly storage: LunoStorage;
|
|
42
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
|
+
};
|
|
43
193
|
}
|
|
44
194
|
|
|
45
|
-
export { Chain, type Config, Connector, type CreateConfigParameters, type LunoStorage, type RawStorage, type Transport };
|
|
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 };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,14 +1,123 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { b as ACCOUNT_TYPE, A as Account, a as AccountBalance, H as HexString } from '../chain-xQJ0MDiz.js';
|
|
1
|
+
import { KeypairType, InjectedSigner } from 'dedot/types';
|
|
3
2
|
import { ApiOptions } from 'dedot';
|
|
4
3
|
import { AnyShape } from 'dedot/shape';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
export { S as Signer } from '../signer-BimV-6cq.js';
|
|
4
|
+
import { Metadata } from '@walletconnect/universal-provider';
|
|
5
|
+
import { EventEmitter } from 'eventemitter3';
|
|
8
6
|
export { PolkadotSigner as PapiSigner } from '@polkadot-api/pjs-signer';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
|
|
8
|
+
type HexString = `0x${string}`;
|
|
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
|
+
}
|
|
80
|
+
|
|
81
|
+
interface Signer extends InjectedSigner {
|
|
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
|
+
}
|
|
12
121
|
|
|
13
122
|
interface RawStorage {
|
|
14
123
|
getItem(key: string): string | null | Promise<string | null>;
|
|
@@ -20,7 +129,7 @@ interface LunoStorage {
|
|
|
20
129
|
setItem(keySuffix: string, value: string): Promise<void>;
|
|
21
130
|
removeItem(keySuffix: string): Promise<void>;
|
|
22
131
|
}
|
|
23
|
-
type Transport = string
|
|
132
|
+
type Transport = Readonly<string[]>;
|
|
24
133
|
type LunoApiOptions = Partial<Omit<ApiOptions, 'provider' | 'signer'>> & {
|
|
25
134
|
customTypes?: Record<string, AnyShape>;
|
|
26
135
|
customRpc?: Record<string, any>;
|
|
@@ -32,6 +141,11 @@ interface CreateConfigParameters extends LunoApiOptions {
|
|
|
32
141
|
transports?: Record<string, Transport>;
|
|
33
142
|
storage?: LunoStorage;
|
|
34
143
|
autoConnect?: boolean;
|
|
144
|
+
subscan?: {
|
|
145
|
+
apiKey: string;
|
|
146
|
+
cacheTime?: number;
|
|
147
|
+
retryCount?: number;
|
|
148
|
+
};
|
|
35
149
|
}
|
|
36
150
|
interface Config extends LunoApiOptions {
|
|
37
151
|
readonly appName: string;
|
|
@@ -40,6 +154,42 @@ interface Config extends LunoApiOptions {
|
|
|
40
154
|
readonly transports: Readonly<Record<string, Transport>>;
|
|
41
155
|
readonly storage: LunoStorage;
|
|
42
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
|
+
};
|
|
43
193
|
}
|
|
44
194
|
|
|
45
|
-
export { Chain, type Config, Connector, type CreateConfigParameters, type LunoStorage, type RawStorage, type Transport };
|
|
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 };
|
package/dist/utils/index.d.cts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { InjectedAccount } from 'dedot/types';
|
|
2
|
-
import {
|
|
3
|
-
import { S as Signer } from '../signer-BimV-6cq.cjs';
|
|
2
|
+
import { Account, Chain, Signer } from '../types/index.cjs';
|
|
4
3
|
import { PolkadotSigner } from '@polkadot-api/pjs-signer';
|
|
5
4
|
export { PolkadotSigner as PapiSigner } from '@polkadot-api/pjs-signer';
|
|
6
5
|
export { formatBalance as formatBalanceWithUnit } from 'dedot/utils';
|
|
6
|
+
import 'dedot';
|
|
7
|
+
import 'dedot/shape';
|
|
8
|
+
import '@walletconnect/universal-provider';
|
|
9
|
+
import 'eventemitter3';
|
|
7
10
|
|
|
8
11
|
/**
|
|
9
12
|
* check if address is valid
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { InjectedAccount } from 'dedot/types';
|
|
2
|
-
import {
|
|
3
|
-
import { S as Signer } from '../signer-BimV-6cq.js';
|
|
2
|
+
import { Account, Chain, Signer } from '../types/index.js';
|
|
4
3
|
import { PolkadotSigner } from '@polkadot-api/pjs-signer';
|
|
5
4
|
export { PolkadotSigner as PapiSigner } from '@polkadot-api/pjs-signer';
|
|
6
5
|
export { formatBalance as formatBalanceWithUnit } from 'dedot/utils';
|
|
6
|
+
import 'dedot';
|
|
7
|
+
import 'dedot/shape';
|
|
8
|
+
import '@walletconnect/universal-provider';
|
|
9
|
+
import 'eventemitter3';
|
|
7
10
|
|
|
8
11
|
/**
|
|
9
12
|
* check if address is valid
|
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.9",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"polkadot",
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { KeypairType } from 'dedot/types';
|
|
2
|
-
|
|
3
|
-
type HexString = `0x${string}`;
|
|
4
|
-
/**
|
|
5
|
-
* Polkadot account interface
|
|
6
|
-
* Represents a chain account
|
|
7
|
-
*/
|
|
8
|
-
interface Account {
|
|
9
|
-
/**
|
|
10
|
-
* account address (original format from wallet)
|
|
11
|
-
* specific SS58 formatting should be done in the React layer based on the chain.
|
|
12
|
-
*/
|
|
13
|
-
address: string;
|
|
14
|
-
/** account name (if any) */
|
|
15
|
-
name?: string;
|
|
16
|
-
/**
|
|
17
|
-
* account public key (hex format, without 0x prefix)
|
|
18
|
-
* used for cross-chain address conversion and verification
|
|
19
|
-
*/
|
|
20
|
-
publicKey?: HexString;
|
|
21
|
-
/**
|
|
22
|
-
* other metadata
|
|
23
|
-
* including account source, control method, etc.
|
|
24
|
-
*/
|
|
25
|
-
meta?: {
|
|
26
|
-
/** account source (e.g. 'polkadot-js', 'subwallet-js', 'talisman' etc.) */
|
|
27
|
-
source?: string;
|
|
28
|
-
/** genesis hash (if the wallet provides a specific chain account) */
|
|
29
|
-
genesisHash?: string | null;
|
|
30
|
-
/** other custom metadata */
|
|
31
|
-
[key: string]: any;
|
|
32
|
-
};
|
|
33
|
-
type?: KeypairType;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* account balance information
|
|
37
|
-
*/
|
|
38
|
-
interface AccountBalance {
|
|
39
|
-
/** available balance (in smallest unit) */
|
|
40
|
-
free: bigint;
|
|
41
|
-
/** total balance (in smallest unit) */
|
|
42
|
-
total: bigint;
|
|
43
|
-
/** reserved balance (in smallest unit) */
|
|
44
|
-
reserved: bigint;
|
|
45
|
-
/**
|
|
46
|
-
* transferable balance (in smallest unit)
|
|
47
|
-
* free minus various locked amounts
|
|
48
|
-
*/
|
|
49
|
-
transferable: bigint;
|
|
50
|
-
/** formatted available balance (with unit, for display) */
|
|
51
|
-
formattedTransferable: string;
|
|
52
|
-
/** formatted total balance (with unit, for display) */
|
|
53
|
-
formattedTotal: string;
|
|
54
|
-
/** lock details (if any) */
|
|
55
|
-
locks?: Array<{
|
|
56
|
-
id: string;
|
|
57
|
-
amount: bigint;
|
|
58
|
-
reason: string;
|
|
59
|
-
lockHuman: string;
|
|
60
|
-
}>;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* account type enum
|
|
64
|
-
*/
|
|
65
|
-
declare enum ACCOUNT_TYPE {
|
|
66
|
-
/** normal account */
|
|
67
|
-
NORMAL = "normal",
|
|
68
|
-
/** multisig account */
|
|
69
|
-
MULTISIG = "multisig",
|
|
70
|
-
/** proxy account */
|
|
71
|
-
PROXY = "proxy",
|
|
72
|
-
/** smart contract account */
|
|
73
|
-
CONTRACT = "contract"
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
interface Chain {
|
|
77
|
-
genesisHash: HexString;
|
|
78
|
-
name: string;
|
|
79
|
-
nativeCurrency: {
|
|
80
|
-
name: string;
|
|
81
|
-
symbol: string;
|
|
82
|
-
decimals: number;
|
|
83
|
-
};
|
|
84
|
-
rpcUrls: {
|
|
85
|
-
webSocket: readonly string[];
|
|
86
|
-
http?: readonly string[];
|
|
87
|
-
};
|
|
88
|
-
ss58Format: number;
|
|
89
|
-
blockExplorers?: {
|
|
90
|
-
default?: {
|
|
91
|
-
name: string;
|
|
92
|
-
url: string;
|
|
93
|
-
};
|
|
94
|
-
[key: string]: {
|
|
95
|
-
name: string;
|
|
96
|
-
url: string;
|
|
97
|
-
} | undefined;
|
|
98
|
-
};
|
|
99
|
-
testnet: boolean;
|
|
100
|
-
chainIconUrl: string;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export { type Account as A, type Chain as C, type HexString as H, type AccountBalance as a, ACCOUNT_TYPE as b };
|
package/dist/chain-xQJ0MDiz.d.ts
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { KeypairType } from 'dedot/types';
|
|
2
|
-
|
|
3
|
-
type HexString = `0x${string}`;
|
|
4
|
-
/**
|
|
5
|
-
* Polkadot account interface
|
|
6
|
-
* Represents a chain account
|
|
7
|
-
*/
|
|
8
|
-
interface Account {
|
|
9
|
-
/**
|
|
10
|
-
* account address (original format from wallet)
|
|
11
|
-
* specific SS58 formatting should be done in the React layer based on the chain.
|
|
12
|
-
*/
|
|
13
|
-
address: string;
|
|
14
|
-
/** account name (if any) */
|
|
15
|
-
name?: string;
|
|
16
|
-
/**
|
|
17
|
-
* account public key (hex format, without 0x prefix)
|
|
18
|
-
* used for cross-chain address conversion and verification
|
|
19
|
-
*/
|
|
20
|
-
publicKey?: HexString;
|
|
21
|
-
/**
|
|
22
|
-
* other metadata
|
|
23
|
-
* including account source, control method, etc.
|
|
24
|
-
*/
|
|
25
|
-
meta?: {
|
|
26
|
-
/** account source (e.g. 'polkadot-js', 'subwallet-js', 'talisman' etc.) */
|
|
27
|
-
source?: string;
|
|
28
|
-
/** genesis hash (if the wallet provides a specific chain account) */
|
|
29
|
-
genesisHash?: string | null;
|
|
30
|
-
/** other custom metadata */
|
|
31
|
-
[key: string]: any;
|
|
32
|
-
};
|
|
33
|
-
type?: KeypairType;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* account balance information
|
|
37
|
-
*/
|
|
38
|
-
interface AccountBalance {
|
|
39
|
-
/** available balance (in smallest unit) */
|
|
40
|
-
free: bigint;
|
|
41
|
-
/** total balance (in smallest unit) */
|
|
42
|
-
total: bigint;
|
|
43
|
-
/** reserved balance (in smallest unit) */
|
|
44
|
-
reserved: bigint;
|
|
45
|
-
/**
|
|
46
|
-
* transferable balance (in smallest unit)
|
|
47
|
-
* free minus various locked amounts
|
|
48
|
-
*/
|
|
49
|
-
transferable: bigint;
|
|
50
|
-
/** formatted available balance (with unit, for display) */
|
|
51
|
-
formattedTransferable: string;
|
|
52
|
-
/** formatted total balance (with unit, for display) */
|
|
53
|
-
formattedTotal: string;
|
|
54
|
-
/** lock details (if any) */
|
|
55
|
-
locks?: Array<{
|
|
56
|
-
id: string;
|
|
57
|
-
amount: bigint;
|
|
58
|
-
reason: string;
|
|
59
|
-
lockHuman: string;
|
|
60
|
-
}>;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* account type enum
|
|
64
|
-
*/
|
|
65
|
-
declare enum ACCOUNT_TYPE {
|
|
66
|
-
/** normal account */
|
|
67
|
-
NORMAL = "normal",
|
|
68
|
-
/** multisig account */
|
|
69
|
-
MULTISIG = "multisig",
|
|
70
|
-
/** proxy account */
|
|
71
|
-
PROXY = "proxy",
|
|
72
|
-
/** smart contract account */
|
|
73
|
-
CONTRACT = "contract"
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
interface Chain {
|
|
77
|
-
genesisHash: HexString;
|
|
78
|
-
name: string;
|
|
79
|
-
nativeCurrency: {
|
|
80
|
-
name: string;
|
|
81
|
-
symbol: string;
|
|
82
|
-
decimals: number;
|
|
83
|
-
};
|
|
84
|
-
rpcUrls: {
|
|
85
|
-
webSocket: readonly string[];
|
|
86
|
-
http?: readonly string[];
|
|
87
|
-
};
|
|
88
|
-
ss58Format: number;
|
|
89
|
-
blockExplorers?: {
|
|
90
|
-
default?: {
|
|
91
|
-
name: string;
|
|
92
|
-
url: string;
|
|
93
|
-
};
|
|
94
|
-
[key: string]: {
|
|
95
|
-
name: string;
|
|
96
|
-
url: string;
|
|
97
|
-
} | undefined;
|
|
98
|
-
};
|
|
99
|
-
testnet: boolean;
|
|
100
|
-
chainIconUrl: string;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export { type Account as A, type Chain as C, type HexString as H, type AccountBalance as a, ACCOUNT_TYPE as b };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Metadata } from '@walletconnect/universal-provider';
|
|
2
|
-
import { EventEmitter } from 'eventemitter3';
|
|
3
|
-
import { C as Chain, A as Account, H as HexString } from './chain-xQJ0MDiz.js';
|
|
4
|
-
import { S as Signer } from './signer-BimV-6cq.js';
|
|
5
|
-
|
|
6
|
-
interface ConnectorLinks {
|
|
7
|
-
browserExtension?: string;
|
|
8
|
-
deepLink?: string;
|
|
9
|
-
}
|
|
10
|
-
interface Connector extends EventEmitter {
|
|
11
|
-
readonly id: string;
|
|
12
|
-
readonly name: string;
|
|
13
|
-
readonly icon: string;
|
|
14
|
-
readonly links: ConnectorLinks;
|
|
15
|
-
isAvailable(): Promise<boolean>;
|
|
16
|
-
isInstalled: () => boolean;
|
|
17
|
-
connect(appName: string, chains?: Chain[], targetChainId?: string): Promise<Account[] | undefined>;
|
|
18
|
-
disconnect(): Promise<void>;
|
|
19
|
-
getAccounts(): Promise<Array<Account>>;
|
|
20
|
-
getSigner(): Promise<Signer | undefined>;
|
|
21
|
-
signMessage(message: string, address: string): Promise<string | undefined>;
|
|
22
|
-
hasConnectionUri(): boolean;
|
|
23
|
-
getConnectionUri(): Promise<string | undefined>;
|
|
24
|
-
on(event: 'connect', listener: (accounts: Account[]) => void): this;
|
|
25
|
-
on(event: 'disconnect', listener: () => void): this;
|
|
26
|
-
on(event: 'accountsChanged', listener: (accounts: Account[]) => void): this;
|
|
27
|
-
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
28
|
-
off(event: 'connect', listener: (accounts: Account[]) => void): this;
|
|
29
|
-
off(event: 'disconnect', listener: () => void): this;
|
|
30
|
-
off(event: 'accountsChanged', listener: (accounts: Account[]) => void): this;
|
|
31
|
-
off(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
32
|
-
}
|
|
33
|
-
interface WalletConnectConnectorOptions {
|
|
34
|
-
id?: string;
|
|
35
|
-
name?: string;
|
|
36
|
-
icon?: string;
|
|
37
|
-
projectId: string;
|
|
38
|
-
relayUrl?: string;
|
|
39
|
-
metadata?: Metadata;
|
|
40
|
-
links?: ConnectorLinks;
|
|
41
|
-
supportedChains?: HexString[];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export type { ConnectorLinks as C, WalletConnectConnectorOptions as W, Connector as a };
|