@xandeum/web3.js 1.3.7 → 1.3.8
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/helpers.d.ts +2 -3
- package/dist/helpers.js +3 -7
- package/package.json +1 -1
- package/src/helpers.ts +3 -7
package/dist/helpers.d.ts
CHANGED
|
@@ -69,11 +69,10 @@ export declare function getAssociatedTokenAddressWithProgramIds(walletAddress: P
|
|
|
69
69
|
export declare function u64ToLeBytes(value: number): Buffer;
|
|
70
70
|
/**
|
|
71
71
|
* Builds the instruction data buffer for a given inner data payload.
|
|
72
|
-
*
|
|
73
|
-
* and copies the inner data starting at offset 1.
|
|
72
|
+
* Prepends a 0 byte to the inner data.
|
|
74
73
|
*
|
|
75
74
|
* @param innerData - The inner data buffer to embed in the instruction
|
|
76
|
-
* @returns A
|
|
75
|
+
* @returns A Buffer containing [0x00, ...innerData]
|
|
77
76
|
*/
|
|
78
77
|
export declare function buildInstructionData(innerData: Buffer): Buffer;
|
|
79
78
|
export declare function getFeeDistributorPda(): {
|
package/dist/helpers.js
CHANGED
|
@@ -101,17 +101,13 @@ function u64ToLeBytes(value) {
|
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* Builds the instruction data buffer for a given inner data payload.
|
|
104
|
-
*
|
|
105
|
-
* and copies the inner data starting at offset 1.
|
|
104
|
+
* Prepends a 0 byte to the inner data.
|
|
106
105
|
*
|
|
107
106
|
* @param innerData - The inner data buffer to embed in the instruction
|
|
108
|
-
* @returns A
|
|
107
|
+
* @returns A Buffer containing [0x00, ...innerData]
|
|
109
108
|
*/
|
|
110
109
|
function buildInstructionData(innerData) {
|
|
111
|
-
|
|
112
|
-
instructionData[0] = 0;
|
|
113
|
-
innerData.copy(instructionData, 1);
|
|
114
|
-
return instructionData;
|
|
110
|
+
return Buffer.concat([Buffer.from([0]), innerData]);
|
|
115
111
|
}
|
|
116
112
|
function getFeeDistributorPda() {
|
|
117
113
|
var yuga = getCurrentYuga();
|
package/package.json
CHANGED
package/src/helpers.ts
CHANGED
|
@@ -102,17 +102,13 @@ export function u64ToLeBytes(value: number): Buffer {
|
|
|
102
102
|
|
|
103
103
|
/**
|
|
104
104
|
* Builds the instruction data buffer for a given inner data payload.
|
|
105
|
-
*
|
|
106
|
-
* and copies the inner data starting at offset 1.
|
|
105
|
+
* Prepends a 0 byte to the inner data.
|
|
107
106
|
*
|
|
108
107
|
* @param innerData - The inner data buffer to embed in the instruction
|
|
109
|
-
* @returns A
|
|
108
|
+
* @returns A Buffer containing [0x00, ...innerData]
|
|
110
109
|
*/
|
|
111
110
|
export function buildInstructionData(innerData: Buffer): Buffer {
|
|
112
|
-
|
|
113
|
-
instructionData[0] = 0;
|
|
114
|
-
innerData.copy(instructionData, 1);
|
|
115
|
-
return instructionData;
|
|
111
|
+
return Buffer.concat([Buffer.from([0]), innerData]);
|
|
116
112
|
}
|
|
117
113
|
|
|
118
114
|
export function getFeeDistributorPda(): { pda: PublicKey; bump: number } {
|