@meshconnect/uwc-injected-connector 0.27.1 → 0.27.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature-service.d.ts","sourceRoot":"","sources":["../../src/services/signature-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"signature-service.d.ts","sourceRoot":"","sources":["../../src/services/signature-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAG7D;;GAEG;AACH,qBAAa,gBAAgB;IAC3B;;;OAGG;IACG,qBAAqB,CACzB,SAAS,EAAE,eAAe,EAC1B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,MAAM,CAAC,CAsBjB;IAED;;OAEG;IACG,mBAAmB,CACvB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,MAAM,CAAC,CAuBjB;IAED;;OAEG;IACG,iBAAiB,CACrB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,MAAM,CAAC,CAqBjB;IAED;;OAEG;IACG,eAAe,CACnB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,MAAM,CAAC,CAejB;CACF"}
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import bs58 from 'bs58';
|
|
2
|
-
import { stringToHex } from 'viem';
|
|
3
2
|
import { parseError } from '../utils/error-utils';
|
|
4
|
-
import { withEIP712Domain } from '@meshconnect/uwc-types';
|
|
5
|
-
/**
|
|
6
|
-
* `personal_sign` data must be 0x-prefixed even-length hex. MetaMask accepts
|
|
7
|
-
* UTF-8 as a courtesy; Coinbase Wallet (especially the in-app browser) rejects
|
|
8
|
-
* it with EIP-1193 `-32603` "Invalid message". Pass through already-valid hex
|
|
9
|
-
* so a caller that pre-encoded is not double-encoded. Odd-length `0x…` strings
|
|
10
|
-
* are not valid hex bytes, so they are treated as UTF-8.
|
|
11
|
-
*/
|
|
12
|
-
function toPersonalSignData(message) {
|
|
13
|
-
return /^0x(?:[0-9a-fA-F]{2})*$/.test(message)
|
|
14
|
-
? message
|
|
15
|
-
: stringToHex(message);
|
|
16
|
-
}
|
|
3
|
+
import { toPersonalSignData, withEIP712Domain } from '@meshconnect/uwc-types';
|
|
17
4
|
/**
|
|
18
5
|
* Service for handling message signing operations for injected wallets
|
|
19
6
|
*/
|
|
@@ -57,9 +44,6 @@ export class SignatureService {
|
|
|
57
44
|
throw new Error('Address is required for signing');
|
|
58
45
|
}
|
|
59
46
|
try {
|
|
60
|
-
// Use personal_sign for Ethereum. Hex-encode UTF-8 so Coinbase Wallet
|
|
61
|
-
// (and other strict EIP-1193 providers) accept the payload; MetaMask
|
|
62
|
-
// hex-decodes before hashing, so the EIP-191 digest is unchanged.
|
|
63
47
|
const signature = await provider.request({
|
|
64
48
|
method: 'personal_sign',
|
|
65
49
|
params: [toPersonalSignData(message), address]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature-service.js","sourceRoot":"","sources":["../../src/services/signature-service.ts"],"names":[],"mappings":"AAEA,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"signature-service.js","sourceRoot":"","sources":["../../src/services/signature-service.ts"],"names":[],"mappings":"AA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G,MAAM,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;YACnE,OAAO,SAAS,CAAA;QAClB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,UAAU,CAAC,KAAK,CAAC,CAAA;QACnB,CAAC;IACH,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meshconnect/uwc-injected-connector",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.2",
|
|
4
4
|
"description": "Injected connector for Universal Wallet Connector",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"uuid": "^14.0.2",
|
|
29
29
|
"viem": "^2.56.5",
|
|
30
30
|
"@meshconnect/uwc-bridge-child": "0.6.1",
|
|
31
|
-
"@meshconnect/uwc-constants": "0.8.
|
|
32
|
-
"@meshconnect/uwc-ton-connector": "0.9.
|
|
33
|
-
"@meshconnect/uwc-bitcoin": "0.5.
|
|
34
|
-
"@meshconnect/uwc-tron-connector": "0.7.
|
|
35
|
-
"@meshconnect/uwc-types": "0.
|
|
31
|
+
"@meshconnect/uwc-constants": "0.8.4",
|
|
32
|
+
"@meshconnect/uwc-ton-connector": "0.9.12",
|
|
33
|
+
"@meshconnect/uwc-bitcoin": "0.5.6",
|
|
34
|
+
"@meshconnect/uwc-tron-connector": "0.7.16",
|
|
35
|
+
"@meshconnect/uwc-types": "0.33.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"typescript": "^7.0.2"
|
|
@@ -1,24 +1,10 @@
|
|
|
1
1
|
import type { EthereumProvider } from '../eip6963-discovery'
|
|
2
2
|
import type { TronProvider } from '../tron-discovery'
|
|
3
3
|
import bs58 from 'bs58'
|
|
4
|
-
import { stringToHex } from 'viem'
|
|
5
4
|
import { parseError } from '../utils/error-utils'
|
|
6
5
|
import type { SolanaAdapter } from '../wallet-standard-discovery'
|
|
7
6
|
import type { EIP712TypedData } from '@meshconnect/uwc-types'
|
|
8
|
-
import { withEIP712Domain } from '@meshconnect/uwc-types'
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* `personal_sign` data must be 0x-prefixed even-length hex. MetaMask accepts
|
|
12
|
-
* UTF-8 as a courtesy; Coinbase Wallet (especially the in-app browser) rejects
|
|
13
|
-
* it with EIP-1193 `-32603` "Invalid message". Pass through already-valid hex
|
|
14
|
-
* so a caller that pre-encoded is not double-encoded. Odd-length `0x…` strings
|
|
15
|
-
* are not valid hex bytes, so they are treated as UTF-8.
|
|
16
|
-
*/
|
|
17
|
-
function toPersonalSignData(message: string): string {
|
|
18
|
-
return /^0x(?:[0-9a-fA-F]{2})*$/.test(message)
|
|
19
|
-
? message
|
|
20
|
-
: stringToHex(message)
|
|
21
|
-
}
|
|
7
|
+
import { toPersonalSignData, withEIP712Domain } from '@meshconnect/uwc-types'
|
|
22
8
|
|
|
23
9
|
/**
|
|
24
10
|
* Service for handling message signing operations for injected wallets
|
|
@@ -77,9 +63,6 @@ export class SignatureService {
|
|
|
77
63
|
}
|
|
78
64
|
|
|
79
65
|
try {
|
|
80
|
-
// Use personal_sign for Ethereum. Hex-encode UTF-8 so Coinbase Wallet
|
|
81
|
-
// (and other strict EIP-1193 providers) accept the payload; MetaMask
|
|
82
|
-
// hex-decodes before hashing, so the EIP-191 digest is unchanged.
|
|
83
66
|
const signature = await provider.request({
|
|
84
67
|
method: 'personal_sign',
|
|
85
68
|
params: [toPersonalSignData(message), address]
|