@xandeum/web3.js 1.3.3 → 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 +10 -4
- package/dist/helpers.d.ts +1 -1
- package/dist/helpers.js +1 -1
- package/package.json +1 -1
- package/src/bigbang.ts +13 -3
- package/src/helpers.ts +1 -1
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(
|
|
60
|
-
|
|
61
|
-
|
|
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/dist/helpers.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare const PULSE_DURATION_SECONDS = 15;
|
|
|
10
10
|
/**
|
|
11
11
|
* Number of pulses in one yuga
|
|
12
12
|
*/
|
|
13
|
-
export declare const PULSES_PER_YUGA =
|
|
13
|
+
export declare const PULSES_PER_YUGA = 100;
|
|
14
14
|
/**
|
|
15
15
|
* Duration of one yuga in seconds (16384 * 15 = 245,760 seconds ≈ 2.84 days)
|
|
16
16
|
*/
|
package/dist/helpers.js
CHANGED
package/package.json
CHANGED
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(
|
|
16
|
-
|
|
17
|
-
|
|
25
|
+
Buffer.from([0]),
|
|
26
|
+
innerLen,
|
|
27
|
+
innerData
|
|
18
28
|
])
|
|
19
29
|
let feeDistributorPda = getFeeDistributorPda()
|
|
20
30
|
|
package/src/helpers.ts
CHANGED