@xandeum/web3.js 1.3.8 → 1.3.10

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,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
- * Prepends a 0 byte to the inner data.
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 [0x00, ...innerData]
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
- * Prepends a 0 byte to the inner data.
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 [0x00, ...innerData]
108
+ * @returns A 33-byte Buffer containing the instruction data
108
109
  */
109
110
  function buildInstructionData(innerData) {
110
- return Buffer.concat([Buffer.from([0]), innerData]);
111
+ var instructionData = Buffer.alloc(65, 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xandeum/web3.js",
3
- "version": "1.3.8",
3
+ "version": "1.3.10",
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,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
- * Prepends a 0 byte to the inner data.
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 [0x00, ...innerData]
109
+ * @returns A 33-byte Buffer containing the instruction data
109
110
  */
110
111
  export function buildInstructionData(innerData: Buffer): Buffer {
111
- return Buffer.concat([Buffer.from([0]), innerData]);
112
+ const instructionData = Buffer.alloc(65, 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 } {