@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 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
- * Allocates a fixed 33-byte buffer, sets the first byte to 0,
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 33-byte Buffer containing the instruction data
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
- * Allocates a fixed 33-byte buffer, sets the first byte to 0,
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 33-byte Buffer containing the instruction data
107
+ * @returns A Buffer containing [0x00, ...innerData]
109
108
  */
110
109
  function buildInstructionData(innerData) {
111
- var instructionData = Buffer.alloc(33, 0);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xandeum/web3.js",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "description": "Xandeum javascript api",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
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
- * Allocates a fixed 33-byte buffer, sets the first byte to 0,
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 33-byte Buffer containing the instruction data
108
+ * @returns A Buffer containing [0x00, ...innerData]
110
109
  */
111
110
  export function buildInstructionData(innerData: Buffer): Buffer {
112
- const instructionData = Buffer.alloc(33, 0);
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 } {