@carrot-protocol/http-client 0.2.70-carrot-boost-jit-dev-9d9cc8f → 0.2.70-carrot-boost-jit-dev-073d4de

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.
Files changed (2) hide show
  1. package/dist/index.js +18 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -44,6 +44,7 @@ exports.prepareUnsignedTx = prepareUnsignedTx;
44
44
  const cross_fetch_1 = __importDefault(require("cross-fetch"));
45
45
  const anchor = __importStar(require("@coral-xyz/anchor"));
46
46
  const bs58_1 = require("bs58");
47
+ const anchor_1 = require("@coral-xyz/anchor");
47
48
  // when pulling in http-client you will have access to Common as intended
48
49
  exports.Common = __importStar(require("@carrot-protocol/common"));
49
50
  // export http types
@@ -315,8 +316,24 @@ class Client {
315
316
  });
316
317
  checkResponse(response);
317
318
  const responseBody = await response.json();
319
+ // intermediate parse
318
320
  const body = JSON.parse(JSON.stringify(responseBody));
319
- return body;
321
+ // Convert the JSON instructions back to TransactionInstruction objects
322
+ const instructions = body.instructions.map((ix) => {
323
+ return new anchor_1.web3.TransactionInstruction({
324
+ programId: new anchor_1.web3.PublicKey(ix.programId),
325
+ keys: ix.keys.map((key) => ({
326
+ pubkey: new anchor_1.web3.PublicKey(key.pubkey),
327
+ isSigner: Boolean(key.isSigner),
328
+ isWritable: Boolean(key.isWritable),
329
+ })),
330
+ data: Buffer.from(ix.data),
331
+ });
332
+ });
333
+ const getCarrotBoostJitIxnsResponse = {
334
+ instructions,
335
+ };
336
+ return getCarrotBoostJitIxnsResponse;
320
337
  }
321
338
  // Sends a signed transaction to the network
322
339
  async send(base64Tx) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carrot-protocol/http-client",
3
- "version": "0.2.70-carrot-boost-jit-dev-9d9cc8f",
3
+ "version": "0.2.70-carrot-boost-jit-dev-073d4de",
4
4
  "description": "interact with carrot api",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",