@xandeum/web3.js 1.14.0 → 2.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.
- package/dist/bigbang.d.ts +1 -1
- package/dist/bigbang.js +7 -2
- package/package.json +1 -1
- package/src/bigbang.ts +4 -2
package/dist/bigbang.d.ts
CHANGED
|
@@ -5,4 +5,4 @@ import { Transaction, PublicKey } from '@solana/web3.js';
|
|
|
5
5
|
* @param wallet - The public key of the wallet that will sign and authorize the transaction.
|
|
6
6
|
* @returns A Promise that resolves to a Solana `Transaction` object containing the bigbang instruction.
|
|
7
7
|
*/
|
|
8
|
-
export declare function bigbang(wallet: PublicKey): Promise<Transaction>;
|
|
8
|
+
export declare function bigbang(replica_count: string, wallet: PublicKey): Promise<Transaction>;
|
package/dist/bigbang.js
CHANGED
|
@@ -35,9 +35,13 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
38
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
42
|
exports.bigbang = bigbang;
|
|
40
43
|
var web3_js_1 = require("@solana/web3.js");
|
|
44
|
+
var bn_js_1 = __importDefault(require("bn.js"));
|
|
41
45
|
var const_1 = require("./const");
|
|
42
46
|
/**
|
|
43
47
|
* Constructs a Solana transaction that triggers the "bigbang" instruction and create new file system.
|
|
@@ -45,12 +49,13 @@ var const_1 = require("./const");
|
|
|
45
49
|
* @param wallet - The public key of the wallet that will sign and authorize the transaction.
|
|
46
50
|
* @returns A Promise that resolves to a Solana `Transaction` object containing the bigbang instruction.
|
|
47
51
|
*/
|
|
48
|
-
function bigbang(wallet) {
|
|
52
|
+
function bigbang(replica_count, wallet) {
|
|
49
53
|
return __awaiter(this, void 0, void 0, function () {
|
|
50
54
|
var instructionData, instruction, tx;
|
|
51
55
|
return __generator(this, function (_a) {
|
|
52
56
|
instructionData = Buffer.concat([
|
|
53
|
-
Buffer.from(Int8Array.from([0]).buffer)
|
|
57
|
+
Buffer.from(Int8Array.from([0]).buffer),
|
|
58
|
+
Buffer.from(Uint8Array.of.apply(Uint8Array, new bn_js_1.default(replica_count).toArray('le', 8)))
|
|
54
59
|
]);
|
|
55
60
|
instruction = new web3_js_1.TransactionInstruction({
|
|
56
61
|
keys: [
|
package/package.json
CHANGED
package/src/bigbang.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Transaction, TransactionInstruction, PublicKey } from '@solana/web3.js'
|
|
2
|
+
import BN from 'bn.js'
|
|
2
3
|
import { programId } from './const'
|
|
3
4
|
|
|
4
5
|
/**
|
|
@@ -7,9 +8,10 @@ import { programId } from './const'
|
|
|
7
8
|
* @param wallet - The public key of the wallet that will sign and authorize the transaction.
|
|
8
9
|
* @returns A Promise that resolves to a Solana `Transaction` object containing the bigbang instruction.
|
|
9
10
|
*/
|
|
10
|
-
export async function bigbang (wallet: PublicKey): Promise<Transaction> {
|
|
11
|
+
export async function bigbang (replica_count:string,wallet: PublicKey): Promise<Transaction> {
|
|
11
12
|
const instructionData = Buffer.concat([
|
|
12
|
-
Buffer.from(Int8Array.from([0]).buffer)
|
|
13
|
+
Buffer.from(Int8Array.from([0]).buffer),
|
|
14
|
+
Buffer.from(Uint8Array.of(...new BN(replica_count).toArray('le', 8)))
|
|
13
15
|
])
|
|
14
16
|
|
|
15
17
|
const instruction = new TransactionInstruction({
|