initializeNewWorld.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. "use strict";
  2. var __createBinding =
  3. (this && this.__createBinding) ||
  4. (Object.create
  5. ? function (o, m, k, k2) {
  6. if (k2 === undefined) k2 = k;
  7. var desc = Object.getOwnPropertyDescriptor(m, k);
  8. if (
  9. !desc ||
  10. ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
  11. ) {
  12. desc = {
  13. enumerable: true,
  14. get: function () {
  15. return m[k];
  16. },
  17. };
  18. }
  19. Object.defineProperty(o, k2, desc);
  20. }
  21. : function (o, m, k, k2) {
  22. if (k2 === undefined) k2 = k;
  23. o[k2] = m[k];
  24. });
  25. var __setModuleDefault =
  26. (this && this.__setModuleDefault) ||
  27. (Object.create
  28. ? function (o, v) {
  29. Object.defineProperty(o, "default", { enumerable: true, value: v });
  30. }
  31. : function (o, v) {
  32. o["default"] = v;
  33. });
  34. var __importStar =
  35. (this && this.__importStar) ||
  36. function (mod) {
  37. if (mod && mod.__esModule) return mod;
  38. var result = {};
  39. if (mod != null)
  40. for (var k in mod)
  41. if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
  42. __createBinding(result, mod, k);
  43. __setModuleDefault(result, mod);
  44. return result;
  45. };
  46. Object.defineProperty(exports, "__esModule", { value: true });
  47. exports.createInitializeNewWorldInstruction =
  48. exports.initializeNewWorldInstructionDiscriminator =
  49. exports.initializeNewWorldStruct =
  50. void 0;
  51. var beet = __importStar(require("@metaplex-foundation/beet"));
  52. var web3 = __importStar(require("@solana/web3.js"));
  53. exports.initializeNewWorldStruct = new beet.BeetArgsStruct(
  54. [["instructionDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)]],
  55. "InitializeNewWorldInstructionArgs"
  56. );
  57. exports.initializeNewWorldInstructionDiscriminator = [
  58. 23, 96, 88, 194, 200, 203, 200, 98,
  59. ];
  60. function createInitializeNewWorldInstruction(accounts, programId) {
  61. var _a;
  62. if (programId === void 0) {
  63. programId = new web3.PublicKey(
  64. "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n"
  65. );
  66. }
  67. var data = exports.initializeNewWorldStruct.serialize({
  68. instructionDiscriminator:
  69. exports.initializeNewWorldInstructionDiscriminator,
  70. })[0];
  71. var keys = [
  72. {
  73. pubkey: accounts.payer,
  74. isWritable: true,
  75. isSigner: true,
  76. },
  77. {
  78. pubkey: accounts.world,
  79. isWritable: true,
  80. isSigner: false,
  81. },
  82. {
  83. pubkey: accounts.registry,
  84. isWritable: true,
  85. isSigner: false,
  86. },
  87. {
  88. pubkey:
  89. (_a = accounts.systemProgram) !== null && _a !== void 0
  90. ? _a
  91. : web3.SystemProgram.programId,
  92. isWritable: false,
  93. isSigner: false,
  94. },
  95. ];
  96. if (accounts.anchorRemainingAccounts != null) {
  97. for (
  98. var _i = 0, _b = accounts.anchorRemainingAccounts;
  99. _i < _b.length;
  100. _i++
  101. ) {
  102. var acc = _b[_i];
  103. keys.push(acc);
  104. }
  105. }
  106. var ix = new web3.TransactionInstruction({
  107. programId: programId,
  108. keys: keys,
  109. data: data,
  110. });
  111. return ix;
  112. }
  113. exports.createInitializeNewWorldInstruction =
  114. createInitializeNewWorldInstruction;
  115. //# sourceMappingURL=initializeNewWorld.js.map