@novasamatech/product-sdk 0.7.9-1 → 0.7.9-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/accounts.js +5 -0
- package/dist/injectWeb3.js +5 -0
- package/package.json +2 -2
package/dist/accounts.js
CHANGED
|
@@ -147,8 +147,13 @@ export const createAccountsProvider = (transport = sandboxTransport) => {
|
|
|
147
147
|
const { version: versions } = decMeta.extrinsic;
|
|
148
148
|
const latestVersion = versions.reduce((acc, v) => Math.max(acc, v), 0);
|
|
149
149
|
const txExtVersion = latestVersion === 4 ? 0 : latestVersion;
|
|
150
|
+
const checkGenesis = signedExtensions['CheckGenesis'];
|
|
151
|
+
if (!checkGenesis) {
|
|
152
|
+
throw new Error("Can't find genesis hash on transaction");
|
|
153
|
+
}
|
|
150
154
|
const txPayload = {
|
|
151
155
|
signer: productAccountId,
|
|
156
|
+
genesisHash: checkGenesis.value,
|
|
152
157
|
callData,
|
|
153
158
|
extensions: Object.values(signedExtensions).map(({ identifier, value, additionalSigned }) => ({
|
|
154
159
|
id: identifier,
|
package/dist/injectWeb3.js
CHANGED
|
@@ -108,9 +108,14 @@ export async function createLegacyExtensionEnableFactory(transport) {
|
|
|
108
108
|
if (!signer) {
|
|
109
109
|
throw new Error("Signer can't route transaction to the right account without signer hint.");
|
|
110
110
|
}
|
|
111
|
+
const checkGenesis = payload.extensions.find(x => x.id === 'CheckGenesis');
|
|
112
|
+
if (!checkGenesis) {
|
|
113
|
+
throw new Error("Can't find genesis hash on transaction");
|
|
114
|
+
}
|
|
111
115
|
const possibleAccountId = accountId.enc(signer);
|
|
112
116
|
const response = await hostApi.createTransactionWithLegacyAccount(enumValue('v1', {
|
|
113
117
|
signer: possibleAccountId,
|
|
118
|
+
genesisHash: fromHex(checkGenesis.extra),
|
|
114
119
|
callData: fromHex(payload.callData),
|
|
115
120
|
txExtVersion: payload.txExtVersion,
|
|
116
121
|
extensions: payload.extensions.map(e => ({
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@novasamatech/product-sdk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.7.9-
|
|
4
|
+
"version": "0.7.9-2",
|
|
5
5
|
"description": "Polkadot product SDK: integrate and run your product inside Polkadot browser.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@polkadot/extension-inject": "^0.63.1",
|
|
29
29
|
"@polkadot-api/json-rpc-provider-proxy": "^0.4.0",
|
|
30
30
|
"@polkadot-api/substrate-bindings": "^0.20.2",
|
|
31
|
-
"@novasamatech/host-api": "0.7.9-
|
|
31
|
+
"@novasamatech/host-api": "0.7.9-2",
|
|
32
32
|
"polkadot-api": ">=2",
|
|
33
33
|
"neverthrow": "^8.2.0"
|
|
34
34
|
},
|