@meshconnect/uwc-types 0.2.1 → 0.2.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/dist/connector.d.ts +2 -1
- package/dist/connector.d.ts.map +1 -1
- package/dist/react-hooks.d.ts +3 -3
- package/dist/react-hooks.d.ts.map +1 -1
- package/dist/signature.d.ts +20 -1
- package/dist/signature.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/connector.ts +2 -1
- package/src/react-hooks.ts +4 -3
- package/src/signature.ts +23 -1
package/dist/connector.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Network, NetworkId, Namespace } from './networks';
|
|
|
2
2
|
import type { AvailableAddress } from './session';
|
|
3
3
|
import type { DetectedEIP6963WalletInfo, DetectedSolanaWalletInfo, ExtensionInjectedProvider, IntegratedBrowserInjectedProvider, WalletConnectProvider } from './UWC-state';
|
|
4
4
|
import type { EVMCapabilities, TransactionRequest, TransactionResult } from './transactions';
|
|
5
|
+
import type { SignatureType } from './signature';
|
|
5
6
|
/**
|
|
6
7
|
* Result interface for connect operations
|
|
7
8
|
*/
|
|
@@ -64,7 +65,7 @@ export interface Connector {
|
|
|
64
65
|
* @param provider The wallet provider (required for injected connector)
|
|
65
66
|
* @returns A promise that resolves to the signature
|
|
66
67
|
*/
|
|
67
|
-
signMessage?(message: string, provider?: ExtensionInjectedProvider | IntegratedBrowserInjectedProvider | WalletConnectProvider): Promise<
|
|
68
|
+
signMessage?(message: string, provider?: ExtensionInjectedProvider | IntegratedBrowserInjectedProvider | WalletConnectProvider): Promise<SignatureType>;
|
|
68
69
|
/**
|
|
69
70
|
* Send a transaction with the connected wallet
|
|
70
71
|
* @param request The transaction request parameters
|
package/dist/connector.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../src/connector.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,E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3B;;;;;;;OAOG;IACH,gBAAgB,CAAC,IAAI,MAAM,CAAA;IAE3B;;;;OAIG;IACH,UAAU,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAE5B;;;;;OAKG;IAEH,aAAa,CACX,OAAO,EAAE,OAAO,EAChB,QAAQ,CAAC,EACL,yBAAyB,GACzB,iCAAiC,GACjC,qBAAqB,GACxB,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAE/B;;;;;OAKG;IACH,mBAAmB,CAAC,CAClB,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC,yBAAyB,EAAE,GAAG,wBAAwB,EAAE,CAAC,CAAA;IAEpE;;;;;OAKG;IACH,WAAW,CAAC,CACV,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EACL,yBAAyB,GACzB,iCAAiC,GACjC,qBAAqB,GACxB,OAAO,CAAC,aAAa,CAAC,CAAA;IAEzB;;;;;OAKG;IACH,eAAe,CAAC,CACd,OAAO,EAAE,kBAAkB,EAC3B,QAAQ,CAAC,EACL,yBAAyB,GACzB,iCAAiC,GACjC,qBAAqB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAAA;IAE7B,qBAAqB,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAA;CAC/E"}
|
package/dist/react-hooks.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NetworkId, Network, ConnectionMode, Session, AvailableAddress, TransactionRequest, TransactionResult, WalletError, EVMCapabilities } from './index';
|
|
1
|
+
import type { NetworkId, Network, ConnectionMode, Session, AvailableAddress, TransactionRequest, TransactionResult, WalletError, EVMCapabilities, SignatureType } from './index';
|
|
2
2
|
/**
|
|
3
3
|
* WalletConnect connection interface for the useConnection hook
|
|
4
4
|
*/
|
|
@@ -184,7 +184,7 @@ export interface UseSignMessageReturn {
|
|
|
184
184
|
* @returns Promise that resolves to the signature string
|
|
185
185
|
* @throws Error if no wallet is connected or signing fails
|
|
186
186
|
*/
|
|
187
|
-
signMessage: (message: string) => Promise<
|
|
187
|
+
signMessage: (message: string) => Promise<SignatureType>;
|
|
188
188
|
/**
|
|
189
189
|
* Indicates if a message signing operation is currently in progress
|
|
190
190
|
*/
|
|
@@ -192,7 +192,7 @@ export interface UseSignMessageReturn {
|
|
|
192
192
|
/**
|
|
193
193
|
* The last signature result, undefined if no message has been signed yet
|
|
194
194
|
*/
|
|
195
|
-
signature:
|
|
195
|
+
signature: SignatureType | undefined;
|
|
196
196
|
/**
|
|
197
197
|
* Error from the last signing attempt, undefined if no error occurred
|
|
198
198
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-hooks.d.ts","sourceRoot":"","sources":["../src/react-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,OAAO,EACP,cAAc,EACd,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,eAAe,
|
|
1
|
+
{"version":3,"file":"react-hooks.d.ts","sourceRoot":"","sources":["../src/react-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,OAAO,EACP,cAAc,EACd,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,WAAW,EACX,eAAe,EACf,aAAa,EACd,MAAM,SAAS,CAAA;AAIhB;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;OAIG;IACH,OAAO,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACjD;;;OAGG;IACH,aAAa,EAAE,MAAM,GAAG,SAAS,CAAA;IACjC;;OAEG;IACH,SAAS,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,KAAK,EAAE,WAAW,GAAG,SAAS,CAAA;IAC9B;;;OAGG;IACH,SAAS,EAAE,OAAO,CAAA;CACnB;AAED;;GAE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AAE,WAAW,GAAG,SAAS,CAAA;CAC/B;AAID;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,WAAW,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,CAAC,CAAA;IACxD;;OAEG;IACH,SAAS,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,SAAS,EAAE,aAAa,GAAG,SAAS,CAAA;IACpC;;OAEG;IACH,KAAK,EAAE,WAAW,GAAG,SAAS,CAAA;CAC/B;AAID;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,eAAe,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAA;IAC5E;;OAEG;IACH,SAAS,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,iBAAiB,EAAE,iBAAiB,GAAG,SAAS,CAAA;IAChD;;OAEG;IACH,KAAK,EAAE,WAAW,GAAG,SAAS,CAAA;CAC/B"}
|
package/dist/signature.d.ts
CHANGED
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
import type { ExtensionInjectedProvider, IntegratedBrowserInjectedProvider } from './UWC-state';
|
|
2
|
+
/**
|
|
3
|
+
* Standard signature format for most blockchains (EVM, Solana, etc.)
|
|
4
|
+
*/
|
|
5
|
+
export interface StandardSignature {
|
|
6
|
+
type: 'standard';
|
|
7
|
+
signature: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Tron-specific signature format
|
|
11
|
+
*/
|
|
12
|
+
export interface TronSignature {
|
|
13
|
+
type: 'tron';
|
|
14
|
+
signature: string[];
|
|
15
|
+
txID: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Discriminated union type for all signature formats
|
|
19
|
+
*/
|
|
20
|
+
export type SignatureType = StandardSignature | TronSignature;
|
|
2
21
|
/**
|
|
3
22
|
* Result interface for signature operations
|
|
4
23
|
*/
|
|
5
24
|
export interface SignatureResult {
|
|
6
|
-
signature:
|
|
25
|
+
signature: SignatureType;
|
|
7
26
|
address: string;
|
|
8
27
|
}
|
|
9
28
|
/**
|
package/dist/signature.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../src/signature.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,iCAAiC,EAClC,MAAM,aAAa,CAAA;AAEpB;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../src/signature.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,iCAAiC,EAClC,MAAM,aAAa,CAAA;AAEpB;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,UAAU,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,aAAa,CAAA;AAE7D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,aAAa,CAAA;IACxB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;OAKG;IACH,WAAW,CACT,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,yBAAyB,GAAG,iCAAiC,GACtE,OAAO,CAAC,eAAe,CAAC,CAAA;CAC5B"}
|
package/package.json
CHANGED
package/src/connector.ts
CHANGED
|
@@ -12,6 +12,7 @@ import type {
|
|
|
12
12
|
TransactionRequest,
|
|
13
13
|
TransactionResult
|
|
14
14
|
} from './transactions'
|
|
15
|
+
import type { SignatureType } from './signature'
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* Result interface for connect operations
|
|
@@ -104,7 +105,7 @@ export interface Connector {
|
|
|
104
105
|
| ExtensionInjectedProvider
|
|
105
106
|
| IntegratedBrowserInjectedProvider
|
|
106
107
|
| WalletConnectProvider
|
|
107
|
-
): Promise<
|
|
108
|
+
): Promise<SignatureType>
|
|
108
109
|
|
|
109
110
|
/**
|
|
110
111
|
* Send a transaction with the connected wallet
|
package/src/react-hooks.ts
CHANGED
|
@@ -7,7 +7,8 @@ import type {
|
|
|
7
7
|
TransactionRequest,
|
|
8
8
|
TransactionResult,
|
|
9
9
|
WalletError,
|
|
10
|
-
EVMCapabilities
|
|
10
|
+
EVMCapabilities,
|
|
11
|
+
SignatureType
|
|
11
12
|
} from './index'
|
|
12
13
|
|
|
13
14
|
// useConnection hook types
|
|
@@ -208,7 +209,7 @@ export interface UseSignMessageReturn {
|
|
|
208
209
|
* @returns Promise that resolves to the signature string
|
|
209
210
|
* @throws Error if no wallet is connected or signing fails
|
|
210
211
|
*/
|
|
211
|
-
signMessage: (message: string) => Promise<
|
|
212
|
+
signMessage: (message: string) => Promise<SignatureType>
|
|
212
213
|
/**
|
|
213
214
|
* Indicates if a message signing operation is currently in progress
|
|
214
215
|
*/
|
|
@@ -216,7 +217,7 @@ export interface UseSignMessageReturn {
|
|
|
216
217
|
/**
|
|
217
218
|
* The last signature result, undefined if no message has been signed yet
|
|
218
219
|
*/
|
|
219
|
-
signature:
|
|
220
|
+
signature: SignatureType | undefined
|
|
220
221
|
/**
|
|
221
222
|
* Error from the last signing attempt, undefined if no error occurred
|
|
222
223
|
*/
|
package/src/signature.ts
CHANGED
|
@@ -3,11 +3,33 @@ import type {
|
|
|
3
3
|
IntegratedBrowserInjectedProvider
|
|
4
4
|
} from './UWC-state'
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Standard signature format for most blockchains (EVM, Solana, etc.)
|
|
8
|
+
*/
|
|
9
|
+
export interface StandardSignature {
|
|
10
|
+
type: 'standard'
|
|
11
|
+
signature: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Tron-specific signature format
|
|
16
|
+
*/
|
|
17
|
+
export interface TronSignature {
|
|
18
|
+
type: 'tron'
|
|
19
|
+
signature: string[]
|
|
20
|
+
txID: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Discriminated union type for all signature formats
|
|
25
|
+
*/
|
|
26
|
+
export type SignatureType = StandardSignature | TronSignature
|
|
27
|
+
|
|
6
28
|
/**
|
|
7
29
|
* Result interface for signature operations
|
|
8
30
|
*/
|
|
9
31
|
export interface SignatureResult {
|
|
10
|
-
signature:
|
|
32
|
+
signature: SignatureType
|
|
11
33
|
address: string
|
|
12
34
|
}
|
|
13
35
|
|