@getpara/viem-v2-integration 3.15.0 → 3.16.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.
|
@@ -108,14 +108,14 @@ function createParaViemAccount(paraOrOptions, walletAddress) {
|
|
|
108
108
|
walletId: currentWallet.id,
|
|
109
109
|
messageBase64: (0, import_core_sdk.hexStringToBase64)(hash)
|
|
110
110
|
});
|
|
111
|
-
const signature = res
|
|
111
|
+
const signature = (0, import_core_sdk.requireSuccessfulSignature)(res);
|
|
112
112
|
return normalizeSignature(signature);
|
|
113
113
|
}),
|
|
114
114
|
/** Signs an EIP-191 personal message (prefixed and hashed). */
|
|
115
115
|
signMessage: (_0) => __async(null, [_0], function* ({ message }) {
|
|
116
116
|
const hashedMessage = (0, import_viem.hashMessage)(message);
|
|
117
117
|
const res = yield para.signMessage({ walletId: currentWallet.id, messageBase64: (0, import_core_sdk.hexStringToBase64)(hashedMessage) });
|
|
118
|
-
const signature = res
|
|
118
|
+
const signature = (0, import_core_sdk.requireSuccessfulSignature)(res);
|
|
119
119
|
return normalizeSignature(signature);
|
|
120
120
|
}),
|
|
121
121
|
/** Signs and serializes an Ethereum transaction. */
|
|
@@ -134,7 +134,7 @@ function createParaViemAccount(paraOrOptions, walletAddress) {
|
|
|
134
134
|
rlpEncodedTxBase64: (0, import_core_sdk.hexStringToBase64)(serializedTx.substring(2)),
|
|
135
135
|
chainId: `${transaction.chainId}`
|
|
136
136
|
});
|
|
137
|
-
const signature = res
|
|
137
|
+
const signature = (0, import_core_sdk.requireSuccessfulSignature)(res);
|
|
138
138
|
const normalizedSig = normalizeSignature(signature);
|
|
139
139
|
const parsed = (0, import_viem.parseSignature)(normalizedSig);
|
|
140
140
|
return serializer(transaction, {
|
|
@@ -150,7 +150,7 @@ function createParaViemAccount(paraOrOptions, walletAddress) {
|
|
|
150
150
|
walletId: currentWallet.id,
|
|
151
151
|
messageBase64: (0, import_core_sdk.hexStringToBase64)((0, import_viem.hashTypedData)(typedDataDefinition))
|
|
152
152
|
});
|
|
153
|
-
const signature = res
|
|
153
|
+
const signature = (0, import_core_sdk.requireSuccessfulSignature)(res);
|
|
154
154
|
return normalizeSignature(signature);
|
|
155
155
|
}),
|
|
156
156
|
/**
|
|
@@ -165,7 +165,7 @@ function createParaViemAccount(paraOrOptions, walletAddress) {
|
|
|
165
165
|
walletId: currentWallet.id,
|
|
166
166
|
messageBase64: (0, import_core_sdk.hexStringToBase64)(hash)
|
|
167
167
|
});
|
|
168
|
-
const signature = res
|
|
168
|
+
const signature = (0, import_core_sdk.requireSuccessfulSignature)(res);
|
|
169
169
|
const sigHex = `0x${signature}`;
|
|
170
170
|
const parsed = (0, import_viem.parseSignature)(sigHex);
|
|
171
171
|
return {
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "viem";
|
|
13
13
|
import { hashAuthorization } from "viem/utils";
|
|
14
14
|
import * as viemChains from "viem/chains";
|
|
15
|
-
import ParaCore, { hexStringToBase64 } from "@getpara/core-sdk";
|
|
15
|
+
import ParaCore, { hexStringToBase64, requireSuccessfulSignature } from "@getpara/core-sdk";
|
|
16
16
|
function normalizeSignature(rawSignature) {
|
|
17
17
|
const sigHex = `0x${rawSignature}`;
|
|
18
18
|
const parsed = parseSignature(sigHex);
|
|
@@ -50,14 +50,14 @@ function createParaViemAccount(paraOrOptions, walletAddress) {
|
|
|
50
50
|
walletId: currentWallet.id,
|
|
51
51
|
messageBase64: hexStringToBase64(hash)
|
|
52
52
|
});
|
|
53
|
-
const signature = res
|
|
53
|
+
const signature = requireSuccessfulSignature(res);
|
|
54
54
|
return normalizeSignature(signature);
|
|
55
55
|
}),
|
|
56
56
|
/** Signs an EIP-191 personal message (prefixed and hashed). */
|
|
57
57
|
signMessage: (_0) => __async(null, [_0], function* ({ message }) {
|
|
58
58
|
const hashedMessage = hashMessage(message);
|
|
59
59
|
const res = yield para.signMessage({ walletId: currentWallet.id, messageBase64: hexStringToBase64(hashedMessage) });
|
|
60
|
-
const signature = res
|
|
60
|
+
const signature = requireSuccessfulSignature(res);
|
|
61
61
|
return normalizeSignature(signature);
|
|
62
62
|
}),
|
|
63
63
|
/** Signs and serializes an Ethereum transaction. */
|
|
@@ -76,7 +76,7 @@ function createParaViemAccount(paraOrOptions, walletAddress) {
|
|
|
76
76
|
rlpEncodedTxBase64: hexStringToBase64(serializedTx.substring(2)),
|
|
77
77
|
chainId: `${transaction.chainId}`
|
|
78
78
|
});
|
|
79
|
-
const signature = res
|
|
79
|
+
const signature = requireSuccessfulSignature(res);
|
|
80
80
|
const normalizedSig = normalizeSignature(signature);
|
|
81
81
|
const parsed = parseSignature(normalizedSig);
|
|
82
82
|
return serializer(transaction, {
|
|
@@ -92,7 +92,7 @@ function createParaViemAccount(paraOrOptions, walletAddress) {
|
|
|
92
92
|
walletId: currentWallet.id,
|
|
93
93
|
messageBase64: hexStringToBase64(hashTypedData(typedDataDefinition))
|
|
94
94
|
});
|
|
95
|
-
const signature = res
|
|
95
|
+
const signature = requireSuccessfulSignature(res);
|
|
96
96
|
return normalizeSignature(signature);
|
|
97
97
|
}),
|
|
98
98
|
/**
|
|
@@ -107,7 +107,7 @@ function createParaViemAccount(paraOrOptions, walletAddress) {
|
|
|
107
107
|
walletId: currentWallet.id,
|
|
108
108
|
messageBase64: hexStringToBase64(hash)
|
|
109
109
|
});
|
|
110
|
-
const signature = res
|
|
110
|
+
const signature = requireSuccessfulSignature(res);
|
|
111
111
|
const sigHex = `0x${signature}`;
|
|
112
112
|
const parsed = parseSignature(sigHex);
|
|
113
113
|
return {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/viem-v2-integration",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.16.0",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@getpara/core-sdk": "3.
|
|
5
|
+
"@getpara/core-sdk": "3.16.0"
|
|
6
6
|
},
|
|
7
7
|
"devDependencies": {
|
|
8
8
|
"typescript": "^5.8.3",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dist",
|
|
25
25
|
"package.json"
|
|
26
26
|
],
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "4a41b3565fa754c272ddcd84070f7e5b4e5c011d",
|
|
28
28
|
"main": "dist/cjs/index.js",
|
|
29
29
|
"module": "dist/esm/index.js",
|
|
30
30
|
"peerDependencies": {
|