apply4.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. "use strict";
  2. var __assign =
  3. (this && this.__assign) ||
  4. function () {
  5. __assign =
  6. Object.assign ||
  7. function (t) {
  8. for (var s, i = 1, n = arguments.length; i < n; i++) {
  9. s = arguments[i];
  10. for (var p in s)
  11. if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  12. }
  13. return t;
  14. };
  15. return __assign.apply(this, arguments);
  16. };
  17. var __createBinding =
  18. (this && this.__createBinding) ||
  19. (Object.create
  20. ? function (o, m, k, k2) {
  21. if (k2 === undefined) k2 = k;
  22. var desc = Object.getOwnPropertyDescriptor(m, k);
  23. if (
  24. !desc ||
  25. ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
  26. ) {
  27. desc = {
  28. enumerable: true,
  29. get: function () {
  30. return m[k];
  31. },
  32. };
  33. }
  34. Object.defineProperty(o, k2, desc);
  35. }
  36. : function (o, m, k, k2) {
  37. if (k2 === undefined) k2 = k;
  38. o[k2] = m[k];
  39. });
  40. var __setModuleDefault =
  41. (this && this.__setModuleDefault) ||
  42. (Object.create
  43. ? function (o, v) {
  44. Object.defineProperty(o, "default", { enumerable: true, value: v });
  45. }
  46. : function (o, v) {
  47. o["default"] = v;
  48. });
  49. var __importStar =
  50. (this && this.__importStar) ||
  51. function (mod) {
  52. if (mod && mod.__esModule) return mod;
  53. var result = {};
  54. if (mod != null)
  55. for (var k in mod)
  56. if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
  57. __createBinding(result, mod, k);
  58. __setModuleDefault(result, mod);
  59. return result;
  60. };
  61. Object.defineProperty(exports, "__esModule", { value: true });
  62. exports.createApply4Instruction =
  63. exports.apply4InstructionDiscriminator =
  64. exports.apply4Struct =
  65. void 0;
  66. var beet = __importStar(require("@metaplex-foundation/beet"));
  67. var web3 = __importStar(require("@solana/web3.js"));
  68. var index_1 = require("../index");
  69. exports.apply4Struct = new beet.FixableBeetArgsStruct(
  70. [
  71. ["instructionDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)],
  72. ["args", beet.bytes],
  73. ],
  74. "Apply4InstructionArgs"
  75. );
  76. exports.apply4InstructionDiscriminator = [223, 104, 24, 79, 252, 196, 14, 109];
  77. function createApply4Instruction(accounts, args, programId) {
  78. var _a, _b;
  79. if (programId === void 0) {
  80. programId = new web3.PublicKey(
  81. "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n"
  82. );
  83. }
  84. var data = exports.apply4Struct.serialize(
  85. __assign(
  86. { instructionDiscriminator: exports.apply4InstructionDiscriminator },
  87. args
  88. )
  89. )[0];
  90. var keys = [
  91. {
  92. pubkey: accounts.boltSystem,
  93. isWritable: false,
  94. isSigner: false,
  95. },
  96. {
  97. pubkey: accounts.componentProgram1,
  98. isWritable: false,
  99. isSigner: false,
  100. },
  101. {
  102. pubkey: accounts.boltComponent1,
  103. isWritable: true,
  104. isSigner: false,
  105. },
  106. {
  107. pubkey: accounts.componentProgram2,
  108. isWritable: false,
  109. isSigner: false,
  110. },
  111. {
  112. pubkey: accounts.boltComponent2,
  113. isWritable: true,
  114. isSigner: false,
  115. },
  116. {
  117. pubkey: accounts.componentProgram3,
  118. isWritable: false,
  119. isSigner: false,
  120. },
  121. {
  122. pubkey: accounts.boltComponent3,
  123. isWritable: true,
  124. isSigner: false,
  125. },
  126. {
  127. pubkey: accounts.componentProgram4,
  128. isWritable: false,
  129. isSigner: false,
  130. },
  131. {
  132. pubkey: accounts.boltComponent4,
  133. isWritable: true,
  134. isSigner: false,
  135. },
  136. {
  137. pubkey:
  138. (_a = accounts.authority) !== null && _a !== void 0 ? _a : programId,
  139. isWritable: false,
  140. isSigner: false,
  141. },
  142. {
  143. pubkey:
  144. (_b = accounts.instructionSysvarAccount) !== null && _b !== void 0
  145. ? _b
  146. : index_1.SYSVAR_INSTRUCTIONS_PUBKEY,
  147. isWritable: false,
  148. isSigner: false,
  149. },
  150. ];
  151. if (accounts.anchorRemainingAccounts != null) {
  152. for (
  153. var _i = 0, _c = accounts.anchorRemainingAccounts;
  154. _i < _c.length;
  155. _i++
  156. ) {
  157. var acc = _c[_i];
  158. keys.push(acc);
  159. }
  160. }
  161. var ix = new web3.TransactionInstruction({
  162. programId: programId,
  163. keys: keys,
  164. data: data,
  165. });
  166. return ix;
  167. }
  168. exports.createApply4Instruction = createApply4Instruction;
  169. //# sourceMappingURL=apply4.js.map