@solana-mobile/mobile-wallet-adapter-protocol-web3js 0.9.9 → 1.0.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.
@@ -68,7 +68,9 @@ function getPayloadFromTransaction(transaction) {
68
68
  return payload;
69
69
  }
70
70
  function getTransactionFromWireMessage(byteArray) {
71
- const version = web3_js.VersionedMessage.deserializeMessageVersion(byteArray);
71
+ const numSignatures = byteArray[0];
72
+ const messageOffset = numSignatures * web3_js.SIGNATURE_LENGTH_IN_BYTES + 1;
73
+ const version = web3_js.VersionedMessage.deserializeMessageVersion(byteArray.slice(messageOffset, byteArray.length));
72
74
  if (version === 'legacy') {
73
75
  return web3_js.Transaction.from(byteArray);
74
76
  }
package/lib/cjs/index.js CHANGED
@@ -68,7 +68,9 @@ function getPayloadFromTransaction(transaction) {
68
68
  return payload;
69
69
  }
70
70
  function getTransactionFromWireMessage(byteArray) {
71
- const version = web3_js.VersionedMessage.deserializeMessageVersion(byteArray);
71
+ const numSignatures = byteArray[0];
72
+ const messageOffset = numSignatures * web3_js.SIGNATURE_LENGTH_IN_BYTES + 1;
73
+ const version = web3_js.VersionedMessage.deserializeMessageVersion(byteArray.slice(messageOffset, byteArray.length));
72
74
  if (version === 'legacy') {
73
75
  return web3_js.Transaction.from(byteArray);
74
76
  }
@@ -59,7 +59,9 @@ function getPayloadFromTransaction(transaction) {
59
59
  return payload;
60
60
  }
61
61
  function getTransactionFromWireMessage(byteArray) {
62
- const version = web3_js.VersionedMessage.deserializeMessageVersion(byteArray);
62
+ const numSignatures = byteArray[0];
63
+ const messageOffset = numSignatures * web3_js.SIGNATURE_LENGTH_IN_BYTES + 1;
64
+ const version = web3_js.VersionedMessage.deserializeMessageVersion(byteArray.slice(messageOffset, byteArray.length));
63
65
  if (version === 'legacy') {
64
66
  return web3_js.Transaction.from(byteArray);
65
67
  }
@@ -1,4 +1,4 @@
1
- import { VersionedMessage, Transaction, VersionedTransaction } from '@solana/web3.js';
1
+ import { VersionedMessage, Transaction, VersionedTransaction, SIGNATURE_LENGTH_IN_BYTES } from '@solana/web3.js';
2
2
  import { transact as transact$1 } from '@solana-mobile/mobile-wallet-adapter-protocol';
3
3
  import bs58 from 'bs58';
4
4
 
@@ -60,7 +60,9 @@ function getPayloadFromTransaction(transaction) {
60
60
  return payload;
61
61
  }
62
62
  function getTransactionFromWireMessage(byteArray) {
63
- const version = VersionedMessage.deserializeMessageVersion(byteArray);
63
+ const numSignatures = byteArray[0];
64
+ const messageOffset = numSignatures * SIGNATURE_LENGTH_IN_BYTES + 1;
65
+ const version = VersionedMessage.deserializeMessageVersion(byteArray.slice(messageOffset, byteArray.length));
64
66
  if (version === 'legacy') {
65
67
  return Transaction.from(byteArray);
66
68
  }
package/lib/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { VersionedMessage, Transaction, VersionedTransaction } from '@solana/web3.js';
1
+ import { VersionedMessage, Transaction, VersionedTransaction, SIGNATURE_LENGTH_IN_BYTES } from '@solana/web3.js';
2
2
  import { transact as transact$1 } from '@solana-mobile/mobile-wallet-adapter-protocol';
3
3
  import bs58 from 'bs58';
4
4
 
@@ -60,7 +60,9 @@ function getPayloadFromTransaction(transaction) {
60
60
  return payload;
61
61
  }
62
62
  function getTransactionFromWireMessage(byteArray) {
63
- const version = VersionedMessage.deserializeMessageVersion(byteArray);
63
+ const numSignatures = byteArray[0];
64
+ const messageOffset = numSignatures * SIGNATURE_LENGTH_IN_BYTES + 1;
65
+ const version = VersionedMessage.deserializeMessageVersion(byteArray.slice(messageOffset, byteArray.length));
64
66
  if (version === 'legacy') {
65
67
  return Transaction.from(byteArray);
66
68
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@solana-mobile/mobile-wallet-adapter-protocol-web3js",
3
3
  "description": "A convenience wrapper that enables you to call Solana Mobile Stack protocol methods using objects from @solana/web3.js",
4
- "version": "0.9.9",
4
+ "version": "1.0.0",
5
5
  "author": "Steven Luscher <steven.luscher@solanamobile.com>",
6
6
  "repository": "https://github.com/solana-mobile/mobile-wallet-adapter",
7
7
  "license": "Apache-2.0",
@@ -40,13 +40,12 @@
40
40
  "@solana/web3.js": "^1.58.0"
41
41
  },
42
42
  "dependencies": {
43
- "@solana-mobile/mobile-wallet-adapter-protocol": "^0.9.9",
43
+ "@solana-mobile/mobile-wallet-adapter-protocol": "^1.0.0",
44
44
  "bs58": "^5.0.0",
45
45
  "js-base64": "^3.7.2"
46
46
  },
47
47
  "devDependencies": {
48
48
  "agadoo": "^2.0.0",
49
49
  "cross-env": "^7.0.3"
50
- },
51
- "gitHead": "d03adeaa47d752aaac815300572d1157e2362758"
50
+ }
52
51
  }