@xandeum/web3.js 1.3.4 → 1.3.5

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/bigbang.js CHANGED
@@ -53,12 +53,18 @@ var helpers_1 = require("./helpers");
53
53
  */
54
54
  function bigbang(replica_count, wallet) {
55
55
  return __awaiter(this, void 0, void 0, function () {
56
- var instructionData, feeDistributorPda, instruction, tx;
56
+ var innerData, innerLen, instructionData, feeDistributorPda, instruction, tx;
57
57
  return __generator(this, function (_a) {
58
+ innerData = Buffer.concat([
59
+ Buffer.from([0]),
60
+ Buffer.from(new bn_js_1.default(replica_count).toArray('le', 8))
61
+ ]);
62
+ innerLen = Buffer.alloc(4);
63
+ innerLen.writeUInt32LE(innerData.length);
58
64
  instructionData = Buffer.concat([
59
- Buffer.from(Int8Array.from([0]).buffer),
60
- Buffer.from(Int8Array.from([0]).buffer),
61
- Buffer.from(Uint8Array.of.apply(Uint8Array, new bn_js_1.default(replica_count).toArray('le', 8)))
65
+ Buffer.from([0]),
66
+ innerLen,
67
+ innerData
62
68
  ]);
63
69
  feeDistributorPda = (0, helpers_1.getFeeDistributorPda)();
64
70
  instruction = new web3_js_1.TransactionInstruction({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xandeum/web3.js",
3
- "version": "1.3.4",
3
+ "version": "1.3.5",
4
4
  "description": "Xandeum javascript api",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/bigbang.ts CHANGED
@@ -11,10 +11,20 @@ import { getFeeDistributorPda } from './helpers'
11
11
  * @returns A Promise that resolves to a Solana `Transaction` object containing the bigbang instruction.
12
12
  */
13
13
  export async function bigbang(replica_count:string,wallet: PublicKey): Promise<Transaction> {
14
+ // inner_data: [0u8 (operation), replica as u64 LE (8 bytes)]
15
+ const innerData = Buffer.concat([
16
+ Buffer.from([0]),
17
+ Buffer.from(new BN(replica_count).toArray('le', 8))
18
+ ])
19
+
20
+ // wrap_storage_tx: [0u8, inner_data.len() as u32 LE, inner_data]
21
+ const innerLen = Buffer.alloc(4)
22
+ innerLen.writeUInt32LE(innerData.length)
23
+
14
24
  const instructionData = Buffer.concat([
15
- Buffer.from(Int8Array.from([0]).buffer),
16
- Buffer.from(Int8Array.from([0]).buffer),
17
- Buffer.from(Uint8Array.of(...new BN(replica_count).toArray('le', 8)))
25
+ Buffer.from([0]),
26
+ innerLen,
27
+ innerData
18
28
  ])
19
29
  let feeDistributorPda = getFeeDistributorPda()
20
30