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