diff --git a/clients/bolt-sdk/.solitarc.js b/clients/bolt-sdk/.solitarc.js index 23f63839..8b83a5f7 100644 --- a/clients/bolt-sdk/.solitarc.js +++ b/clients/bolt-sdk/.solitarc.js @@ -1,15 +1,15 @@ -const path = require('path'); -const programDir = path.join(__dirname, '../../', 'programs', 'world'); -const idlDir = path.join(__dirname, 'idl'); -const sdkDir = path.join(__dirname, 'src', 'generated'); -const binaryInstallDir = path.join(__dirname, '.crates'); +const path = require("path"); +const programDir = path.join(__dirname, "../../", "programs", "world"); +const idlDir = path.join(__dirname, "idl"); +const sdkDir = path.join(__dirname, "src", "generated"); +const binaryInstallDir = path.join(__dirname, ".crates"); module.exports = { - idlGenerator: 'anchor', - programName: 'world', - programId: 'WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n', - idlDir, - sdkDir, - binaryInstallDir, - programDir, -}; \ No newline at end of file + idlGenerator: "anchor", + programName: "world", + programId: "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n", + idlDir, + sdkDir, + binaryInstallDir, + programDir, +}; diff --git a/clients/bolt-sdk/lib/accounts/Entity.d.ts b/clients/bolt-sdk/lib/accounts/Entity.d.ts index cfb226d7..de935e47 100644 --- a/clients/bolt-sdk/lib/accounts/Entity.d.ts +++ b/clients/bolt-sdk/lib/accounts/Entity.d.ts @@ -3,31 +3,46 @@ import * as beet from "@metaplex-foundation/beet"; import * as web3 from "@solana/web3.js"; import * as beetSolana from "@metaplex-foundation/beet-solana"; export interface EntityArgs { - id: beet.bignum; + id: beet.bignum; } export declare const entityDiscriminator: number[]; export declare class Entity implements EntityArgs { - readonly id: beet.bignum; - private constructor(); - static fromArgs(args: EntityArgs): Entity; - static fromAccountInfo(accountInfo: web3.AccountInfo, offset?: number): [Entity, number]; - static fromAccountAddress(connection: web3.Connection, address: web3.PublicKey, commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig): Promise; - static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<{ - accountDiscriminator: any; - id: any; - }>; - static deserialize(buf: Buffer, offset?: number): [Entity, number]; - serialize(): [Buffer, number]; - static get byteSize(): number; - static getMinimumBalanceForRentExemption(connection: web3.Connection, commitment?: web3.Commitment): Promise; - static hasCorrectByteSize(buf: Buffer, offset?: number): boolean; - pretty(): { - id: number | { - toNumber: () => number; + readonly id: beet.bignum; + private constructor(); + static fromArgs(args: EntityArgs): Entity; + static fromAccountInfo( + accountInfo: web3.AccountInfo, + offset?: number + ): [Entity, number]; + static fromAccountAddress( + connection: web3.Connection, + address: web3.PublicKey, + commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig + ): Promise; + static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<{ + accountDiscriminator: any; + id: any; + }>; + static deserialize(buf: Buffer, offset?: number): [Entity, number]; + serialize(): [Buffer, number]; + static get byteSize(): number; + static getMinimumBalanceForRentExemption( + connection: web3.Connection, + commitment?: web3.Commitment + ): Promise; + static hasCorrectByteSize(buf: Buffer, offset?: number): boolean; + pretty(): { + id: + | number + | { + toNumber: () => number; }; - }; + }; } -export declare const entityBeet: beet.BeetStruct; -//# sourceMappingURL=Entity.d.ts.map \ No newline at end of file + } +>; +//# sourceMappingURL=Entity.d.ts.map diff --git a/clients/bolt-sdk/lib/accounts/Entity.js b/clients/bolt-sdk/lib/accounts/Entity.js index c1005726..2c843d88 100644 --- a/clients/bolt-sdk/lib/accounts/Entity.js +++ b/clients/bolt-sdk/lib/accounts/Entity.js @@ -1,74 +1,196 @@ "use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { +var __assign = + (this && this.__assign) || + function () { + __assign = + Object.assign || + function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; - }; + }; return __assign.apply(this, arguments); -}; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { + }; +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + }; +var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } + }; +var __generator = + (this && this.__generator) || + function (thisArg, body) { + var _ = { + label: 0, + sent: function () { + if (t[0] & 1) throw t[1]; + return t[1]; + }, + trys: [], + ops: [], + }, + f, + y, + t, + g; + return ( + (g = { next: verb(0), throw: verb(1), return: verb(2) }), + typeof Symbol === "function" && + (g[Symbol.iterator] = function () { + return this; + }), + g + ); + function verb(n) { + return function (v) { + return step([n, v]); + }; + } function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + if (f) throw new TypeError("Generator is already executing."); + while ((g && ((g = 0), op[0] && (_ = 0)), _)) + try { + if ( + ((f = 1), + y && + (t = + op[0] & 2 + ? y["return"] + : op[0] + ? y["throw"] || ((t = y["return"]) && t.call(y), 0) + : y.next) && + !(t = t.call(y, op[1])).done) + ) + return t; + if (((y = 0), t)) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if ( + !((t = _.trys), (t = t.length > 0 && t[t.length - 1])) && + (op[0] === 6 || op[0] === 2) + ) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; + } + if (op[0] & 5) throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; } -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.entityBeet = exports.Entity = exports.entityDiscriminator = void 0; var beet = __importStar(require("@metaplex-foundation/beet")); @@ -76,83 +198,111 @@ var web3 = __importStar(require("@solana/web3.js")); var beetSolana = __importStar(require("@metaplex-foundation/beet-solana")); exports.entityDiscriminator = [46, 157, 161, 161, 254, 46, 79, 24]; var Entity = (function () { - function Entity(id) { - this.id = id; + function Entity(id) { + this.id = id; + } + Entity.fromArgs = function (args) { + return new Entity(args.id); + }; + Entity.fromAccountInfo = function (accountInfo, offset) { + if (offset === void 0) { + offset = 0; } - Entity.fromArgs = function (args) { - return new Entity(args.id); - }; - Entity.fromAccountInfo = function (accountInfo, offset) { - if (offset === void 0) { offset = 0; } - return Entity.deserialize(accountInfo.data, offset); - }; - Entity.fromAccountAddress = function (connection, address, commitmentOrConfig) { - return __awaiter(this, void 0, void 0, function () { - var accountInfo; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, connection.getAccountInfo(address, commitmentOrConfig)]; - case 1: - accountInfo = _a.sent(); - if (accountInfo == null) { - throw new Error("Unable to find Entity account at ".concat(address)); - } - return [2, Entity.fromAccountInfo(accountInfo, 0)[0]]; - } - }); - }); - }; - Entity.gpaBuilder = function (programId) { - if (programId === void 0) { programId = new web3.PublicKey("WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n"); } - return beetSolana.GpaBuilder.fromStruct(programId, exports.entityBeet); - }; - Entity.deserialize = function (buf, offset) { - if (offset === void 0) { offset = 0; } - return exports.entityBeet.deserialize(buf, offset); - }; - Entity.prototype.serialize = function () { - return exports.entityBeet.serialize(__assign({ accountDiscriminator: exports.entityDiscriminator }, this)); - }; - Object.defineProperty(Entity, "byteSize", { - get: function () { - return exports.entityBeet.byteSize; - }, - enumerable: false, - configurable: true + return Entity.deserialize(accountInfo.data, offset); + }; + Entity.fromAccountAddress = function ( + connection, + address, + commitmentOrConfig + ) { + return __awaiter(this, void 0, void 0, function () { + var accountInfo; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + return [4, connection.getAccountInfo(address, commitmentOrConfig)]; + case 1: + accountInfo = _a.sent(); + if (accountInfo == null) { + throw new Error( + "Unable to find Entity account at ".concat(address) + ); + } + return [2, Entity.fromAccountInfo(accountInfo, 0)[0]]; + } + }); }); - Entity.getMinimumBalanceForRentExemption = function (connection, commitment) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2, connection.getMinimumBalanceForRentExemption(Entity.byteSize, commitment)]; - }); - }); - }; - Entity.hasCorrectByteSize = function (buf, offset) { - if (offset === void 0) { offset = 0; } - return buf.byteLength - offset === Entity.byteSize; - }; - Entity.prototype.pretty = function () { - var _this = this; - return { - id: (function () { - var x = _this.id; - if (typeof x.toNumber === "function") { - try { - return x.toNumber(); - } - catch (_) { - return x; - } - } - return x; - })(), - }; + }; + Entity.gpaBuilder = function (programId) { + if (programId === void 0) { + programId = new web3.PublicKey( + "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n" + ); + } + return beetSolana.GpaBuilder.fromStruct(programId, exports.entityBeet); + }; + Entity.deserialize = function (buf, offset) { + if (offset === void 0) { + offset = 0; + } + return exports.entityBeet.deserialize(buf, offset); + }; + Entity.prototype.serialize = function () { + return exports.entityBeet.serialize( + __assign({ accountDiscriminator: exports.entityDiscriminator }, this) + ); + }; + Object.defineProperty(Entity, "byteSize", { + get: function () { + return exports.entityBeet.byteSize; + }, + enumerable: false, + configurable: true, + }); + Entity.getMinimumBalanceForRentExemption = function (connection, commitment) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [ + 2, + connection.getMinimumBalanceForRentExemption( + Entity.byteSize, + commitment + ), + ]; + }); + }); + }; + Entity.hasCorrectByteSize = function (buf, offset) { + if (offset === void 0) { + offset = 0; + } + return buf.byteLength - offset === Entity.byteSize; + }; + Entity.prototype.pretty = function () { + var _this = this; + return { + id: (function () { + var x = _this.id; + if (typeof x.toNumber === "function") { + try { + return x.toNumber(); + } catch (_) { + return x; + } + } + return x; + })(), }; - return Entity; -}()); + }; + return Entity; +})(); exports.Entity = Entity; -exports.entityBeet = new beet.BeetStruct([ +exports.entityBeet = new beet.BeetStruct( + [ ["accountDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)], ["id", beet.u64], -], Entity.fromArgs, "Entity"); -//# sourceMappingURL=Entity.js.map \ No newline at end of file + ], + Entity.fromArgs, + "Entity" +); +//# sourceMappingURL=Entity.js.map diff --git a/clients/bolt-sdk/lib/accounts/Registry.d.ts b/clients/bolt-sdk/lib/accounts/Registry.d.ts index f07bf46e..0df16b17 100644 --- a/clients/bolt-sdk/lib/accounts/Registry.d.ts +++ b/clients/bolt-sdk/lib/accounts/Registry.d.ts @@ -3,31 +3,46 @@ import * as beet from "@metaplex-foundation/beet"; import * as web3 from "@solana/web3.js"; import * as beetSolana from "@metaplex-foundation/beet-solana"; export interface RegistryArgs { - worlds: beet.bignum; + worlds: beet.bignum; } export declare const registryDiscriminator: number[]; export declare class Registry implements RegistryArgs { - readonly worlds: beet.bignum; - private constructor(); - static fromArgs(args: RegistryArgs): Registry; - static fromAccountInfo(accountInfo: web3.AccountInfo, offset?: number): [Registry, number]; - static fromAccountAddress(connection: web3.Connection, address: web3.PublicKey, commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig): Promise; - static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<{ - worlds: any; - accountDiscriminator: any; - }>; - static deserialize(buf: Buffer, offset?: number): [Registry, number]; - serialize(): [Buffer, number]; - static get byteSize(): number; - static getMinimumBalanceForRentExemption(connection: web3.Connection, commitment?: web3.Commitment): Promise; - static hasCorrectByteSize(buf: Buffer, offset?: number): boolean; - pretty(): { - worlds: number | { - toNumber: () => number; + readonly worlds: beet.bignum; + private constructor(); + static fromArgs(args: RegistryArgs): Registry; + static fromAccountInfo( + accountInfo: web3.AccountInfo, + offset?: number + ): [Registry, number]; + static fromAccountAddress( + connection: web3.Connection, + address: web3.PublicKey, + commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig + ): Promise; + static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<{ + worlds: any; + accountDiscriminator: any; + }>; + static deserialize(buf: Buffer, offset?: number): [Registry, number]; + serialize(): [Buffer, number]; + static get byteSize(): number; + static getMinimumBalanceForRentExemption( + connection: web3.Connection, + commitment?: web3.Commitment + ): Promise; + static hasCorrectByteSize(buf: Buffer, offset?: number): boolean; + pretty(): { + worlds: + | number + | { + toNumber: () => number; }; - }; + }; } -export declare const registryBeet: beet.BeetStruct; -//# sourceMappingURL=Registry.d.ts.map \ No newline at end of file + } +>; +//# sourceMappingURL=Registry.d.ts.map diff --git a/clients/bolt-sdk/lib/accounts/Registry.js b/clients/bolt-sdk/lib/accounts/Registry.js index 8f79e2db..7d3d1bf2 100644 --- a/clients/bolt-sdk/lib/accounts/Registry.js +++ b/clients/bolt-sdk/lib/accounts/Registry.js @@ -1,158 +1,314 @@ "use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { +var __assign = + (this && this.__assign) || + function () { + __assign = + Object.assign || + function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; - }; + }; return __assign.apply(this, arguments); -}; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { + }; +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + }; +var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } + }; +var __generator = + (this && this.__generator) || + function (thisArg, body) { + var _ = { + label: 0, + sent: function () { + if (t[0] & 1) throw t[1]; + return t[1]; + }, + trys: [], + ops: [], + }, + f, + y, + t, + g; + return ( + (g = { next: verb(0), throw: verb(1), return: verb(2) }), + typeof Symbol === "function" && + (g[Symbol.iterator] = function () { + return this; + }), + g + ); + function verb(n) { + return function (v) { + return step([n, v]); + }; + } function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + if (f) throw new TypeError("Generator is already executing."); + while ((g && ((g = 0), op[0] && (_ = 0)), _)) + try { + if ( + ((f = 1), + y && + (t = + op[0] & 2 + ? y["return"] + : op[0] + ? y["throw"] || ((t = y["return"]) && t.call(y), 0) + : y.next) && + !(t = t.call(y, op[1])).done) + ) + return t; + if (((y = 0), t)) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if ( + !((t = _.trys), (t = t.length > 0 && t[t.length - 1])) && + (op[0] === 6 || op[0] === 2) + ) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; + } + if (op[0] & 5) throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; } -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.registryBeet = exports.Registry = exports.registryDiscriminator = void 0; +exports.registryBeet = + exports.Registry = + exports.registryDiscriminator = + void 0; var beet = __importStar(require("@metaplex-foundation/beet")); var web3 = __importStar(require("@solana/web3.js")); var beetSolana = __importStar(require("@metaplex-foundation/beet-solana")); exports.registryDiscriminator = [47, 174, 110, 246, 184, 182, 252, 218]; var Registry = (function () { - function Registry(worlds) { - this.worlds = worlds; + function Registry(worlds) { + this.worlds = worlds; + } + Registry.fromArgs = function (args) { + return new Registry(args.worlds); + }; + Registry.fromAccountInfo = function (accountInfo, offset) { + if (offset === void 0) { + offset = 0; } - Registry.fromArgs = function (args) { - return new Registry(args.worlds); - }; - Registry.fromAccountInfo = function (accountInfo, offset) { - if (offset === void 0) { offset = 0; } - return Registry.deserialize(accountInfo.data, offset); - }; - Registry.fromAccountAddress = function (connection, address, commitmentOrConfig) { - return __awaiter(this, void 0, void 0, function () { - var accountInfo; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, connection.getAccountInfo(address, commitmentOrConfig)]; - case 1: - accountInfo = _a.sent(); - if (accountInfo == null) { - throw new Error("Unable to find Registry account at ".concat(address)); - } - return [2, Registry.fromAccountInfo(accountInfo, 0)[0]]; - } - }); - }); - }; - Registry.gpaBuilder = function (programId) { - if (programId === void 0) { programId = new web3.PublicKey("WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n"); } - return beetSolana.GpaBuilder.fromStruct(programId, exports.registryBeet); - }; - Registry.deserialize = function (buf, offset) { - if (offset === void 0) { offset = 0; } - return exports.registryBeet.deserialize(buf, offset); - }; - Registry.prototype.serialize = function () { - return exports.registryBeet.serialize(__assign({ accountDiscriminator: exports.registryDiscriminator }, this)); - }; - Object.defineProperty(Registry, "byteSize", { - get: function () { - return exports.registryBeet.byteSize; - }, - enumerable: false, - configurable: true + return Registry.deserialize(accountInfo.data, offset); + }; + Registry.fromAccountAddress = function ( + connection, + address, + commitmentOrConfig + ) { + return __awaiter(this, void 0, void 0, function () { + var accountInfo; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + return [4, connection.getAccountInfo(address, commitmentOrConfig)]; + case 1: + accountInfo = _a.sent(); + if (accountInfo == null) { + throw new Error( + "Unable to find Registry account at ".concat(address) + ); + } + return [2, Registry.fromAccountInfo(accountInfo, 0)[0]]; + } + }); }); - Registry.getMinimumBalanceForRentExemption = function (connection, commitment) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2, connection.getMinimumBalanceForRentExemption(Registry.byteSize, commitment)]; - }); - }); - }; - Registry.hasCorrectByteSize = function (buf, offset) { - if (offset === void 0) { offset = 0; } - return buf.byteLength - offset === Registry.byteSize; - }; - Registry.prototype.pretty = function () { - var _this = this; - return { - worlds: (function () { - var x = _this.worlds; - if (typeof x.toNumber === "function") { - try { - return x.toNumber(); - } - catch (_) { - return x; - } - } - return x; - })(), - }; + }; + Registry.gpaBuilder = function (programId) { + if (programId === void 0) { + programId = new web3.PublicKey( + "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n" + ); + } + return beetSolana.GpaBuilder.fromStruct(programId, exports.registryBeet); + }; + Registry.deserialize = function (buf, offset) { + if (offset === void 0) { + offset = 0; + } + return exports.registryBeet.deserialize(buf, offset); + }; + Registry.prototype.serialize = function () { + return exports.registryBeet.serialize( + __assign({ accountDiscriminator: exports.registryDiscriminator }, this) + ); + }; + Object.defineProperty(Registry, "byteSize", { + get: function () { + return exports.registryBeet.byteSize; + }, + enumerable: false, + configurable: true, + }); + Registry.getMinimumBalanceForRentExemption = function ( + connection, + commitment + ) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [ + 2, + connection.getMinimumBalanceForRentExemption( + Registry.byteSize, + commitment + ), + ]; + }); + }); + }; + Registry.hasCorrectByteSize = function (buf, offset) { + if (offset === void 0) { + offset = 0; + } + return buf.byteLength - offset === Registry.byteSize; + }; + Registry.prototype.pretty = function () { + var _this = this; + return { + worlds: (function () { + var x = _this.worlds; + if (typeof x.toNumber === "function") { + try { + return x.toNumber(); + } catch (_) { + return x; + } + } + return x; + })(), }; - return Registry; -}()); + }; + return Registry; +})(); exports.Registry = Registry; -exports.registryBeet = new beet.BeetStruct([ +exports.registryBeet = new beet.BeetStruct( + [ ["accountDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)], ["worlds", beet.u64], -], Registry.fromArgs, "Registry"); -//# sourceMappingURL=Registry.js.map \ No newline at end of file + ], + Registry.fromArgs, + "Registry" +); +//# sourceMappingURL=Registry.js.map diff --git a/clients/bolt-sdk/lib/accounts/World.d.ts b/clients/bolt-sdk/lib/accounts/World.d.ts index e0593f8d..8ade8bb7 100644 --- a/clients/bolt-sdk/lib/accounts/World.d.ts +++ b/clients/bolt-sdk/lib/accounts/World.d.ts @@ -3,37 +3,54 @@ import * as beet from "@metaplex-foundation/beet"; import * as web3 from "@solana/web3.js"; import * as beetSolana from "@metaplex-foundation/beet-solana"; export interface WorldArgs { - id: beet.bignum; - entities: beet.bignum; + id: beet.bignum; + entities: beet.bignum; } export declare const worldDiscriminator: number[]; export declare class World implements WorldArgs { - readonly id: beet.bignum; - readonly entities: beet.bignum; - private constructor(); - static fromArgs(args: WorldArgs): World; - static fromAccountInfo(accountInfo: web3.AccountInfo, offset?: number): [World, number]; - static fromAccountAddress(connection: web3.Connection, address: web3.PublicKey, commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig): Promise; - static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<{ - accountDiscriminator: any; - id: any; - entities: any; - }>; - static deserialize(buf: Buffer, offset?: number): [World, number]; - serialize(): [Buffer, number]; - static get byteSize(): number; - static getMinimumBalanceForRentExemption(connection: web3.Connection, commitment?: web3.Commitment): Promise; - static hasCorrectByteSize(buf: Buffer, offset?: number): boolean; - pretty(): { - id: number | { - toNumber: () => number; + readonly id: beet.bignum; + readonly entities: beet.bignum; + private constructor(); + static fromArgs(args: WorldArgs): World; + static fromAccountInfo( + accountInfo: web3.AccountInfo, + offset?: number + ): [World, number]; + static fromAccountAddress( + connection: web3.Connection, + address: web3.PublicKey, + commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig + ): Promise; + static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<{ + accountDiscriminator: any; + id: any; + entities: any; + }>; + static deserialize(buf: Buffer, offset?: number): [World, number]; + serialize(): [Buffer, number]; + static get byteSize(): number; + static getMinimumBalanceForRentExemption( + connection: web3.Connection, + commitment?: web3.Commitment + ): Promise; + static hasCorrectByteSize(buf: Buffer, offset?: number): boolean; + pretty(): { + id: + | number + | { + toNumber: () => number; }; - entities: number | { - toNumber: () => number; + entities: + | number + | { + toNumber: () => number; }; - }; + }; } -export declare const worldBeet: beet.BeetStruct; -//# sourceMappingURL=World.d.ts.map \ No newline at end of file + } +>; +//# sourceMappingURL=World.d.ts.map diff --git a/clients/bolt-sdk/lib/accounts/World.js b/clients/bolt-sdk/lib/accounts/World.js index 4b6afd06..33e233e6 100644 --- a/clients/bolt-sdk/lib/accounts/World.js +++ b/clients/bolt-sdk/lib/accounts/World.js @@ -1,74 +1,196 @@ "use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { +var __assign = + (this && this.__assign) || + function () { + __assign = + Object.assign || + function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; - }; + }; return __assign.apply(this, arguments); -}; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { + }; +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + }; +var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); -}; -var __generator = (this && this.__generator) || function (thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } + }; +var __generator = + (this && this.__generator) || + function (thisArg, body) { + var _ = { + label: 0, + sent: function () { + if (t[0] & 1) throw t[1]; + return t[1]; + }, + trys: [], + ops: [], + }, + f, + y, + t, + g; + return ( + (g = { next: verb(0), throw: verb(1), return: verb(2) }), + typeof Symbol === "function" && + (g[Symbol.iterator] = function () { + return this; + }), + g + ); + function verb(n) { + return function (v) { + return step([n, v]); + }; + } function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + if (f) throw new TypeError("Generator is already executing."); + while ((g && ((g = 0), op[0] && (_ = 0)), _)) + try { + if ( + ((f = 1), + y && + (t = + op[0] & 2 + ? y["return"] + : op[0] + ? y["throw"] || ((t = y["return"]) && t.call(y), 0) + : y.next) && + !(t = t.call(y, op[1])).done) + ) + return t; + if (((y = 0), t)) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: + case 1: + t = op; + break; + case 4: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if ( + !((t = _.trys), (t = t.length > 0 && t[t.length - 1])) && + (op[0] === 6 || op[0] === 2) + ) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; + } + if (op[0] & 5) throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; } -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.worldBeet = exports.World = exports.worldDiscriminator = void 0; var beet = __importStar(require("@metaplex-foundation/beet")); @@ -76,97 +198,124 @@ var web3 = __importStar(require("@solana/web3.js")); var beetSolana = __importStar(require("@metaplex-foundation/beet-solana")); exports.worldDiscriminator = [145, 45, 170, 174, 122, 32, 155, 124]; var World = (function () { - function World(id, entities) { - this.id = id; - this.entities = entities; + function World(id, entities) { + this.id = id; + this.entities = entities; + } + World.fromArgs = function (args) { + return new World(args.id, args.entities); + }; + World.fromAccountInfo = function (accountInfo, offset) { + if (offset === void 0) { + offset = 0; } - World.fromArgs = function (args) { - return new World(args.id, args.entities); - }; - World.fromAccountInfo = function (accountInfo, offset) { - if (offset === void 0) { offset = 0; } - return World.deserialize(accountInfo.data, offset); - }; - World.fromAccountAddress = function (connection, address, commitmentOrConfig) { - return __awaiter(this, void 0, void 0, function () { - var accountInfo; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4, connection.getAccountInfo(address, commitmentOrConfig)]; - case 1: - accountInfo = _a.sent(); - if (accountInfo == null) { - throw new Error("Unable to find World account at ".concat(address)); - } - return [2, World.fromAccountInfo(accountInfo, 0)[0]]; - } - }); - }); - }; - World.gpaBuilder = function (programId) { - if (programId === void 0) { programId = new web3.PublicKey("WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n"); } - return beetSolana.GpaBuilder.fromStruct(programId, exports.worldBeet); - }; - World.deserialize = function (buf, offset) { - if (offset === void 0) { offset = 0; } - return exports.worldBeet.deserialize(buf, offset); - }; - World.prototype.serialize = function () { - return exports.worldBeet.serialize(__assign({ accountDiscriminator: exports.worldDiscriminator }, this)); - }; - Object.defineProperty(World, "byteSize", { - get: function () { - return exports.worldBeet.byteSize; - }, - enumerable: false, - configurable: true + return World.deserialize(accountInfo.data, offset); + }; + World.fromAccountAddress = function ( + connection, + address, + commitmentOrConfig + ) { + return __awaiter(this, void 0, void 0, function () { + var accountInfo; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + return [4, connection.getAccountInfo(address, commitmentOrConfig)]; + case 1: + accountInfo = _a.sent(); + if (accountInfo == null) { + throw new Error( + "Unable to find World account at ".concat(address) + ); + } + return [2, World.fromAccountInfo(accountInfo, 0)[0]]; + } + }); }); - World.getMinimumBalanceForRentExemption = function (connection, commitment) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2, connection.getMinimumBalanceForRentExemption(World.byteSize, commitment)]; - }); - }); - }; - World.hasCorrectByteSize = function (buf, offset) { - if (offset === void 0) { offset = 0; } - return buf.byteLength - offset === World.byteSize; - }; - World.prototype.pretty = function () { - var _this = this; - return { - id: (function () { - var x = _this.id; - if (typeof x.toNumber === "function") { - try { - return x.toNumber(); - } - catch (_) { - return x; - } - } - return x; - })(), - entities: (function () { - var x = _this.entities; - if (typeof x.toNumber === "function") { - try { - return x.toNumber(); - } - catch (_) { - return x; - } - } - return x; - })(), - }; + }; + World.gpaBuilder = function (programId) { + if (programId === void 0) { + programId = new web3.PublicKey( + "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n" + ); + } + return beetSolana.GpaBuilder.fromStruct(programId, exports.worldBeet); + }; + World.deserialize = function (buf, offset) { + if (offset === void 0) { + offset = 0; + } + return exports.worldBeet.deserialize(buf, offset); + }; + World.prototype.serialize = function () { + return exports.worldBeet.serialize( + __assign({ accountDiscriminator: exports.worldDiscriminator }, this) + ); + }; + Object.defineProperty(World, "byteSize", { + get: function () { + return exports.worldBeet.byteSize; + }, + enumerable: false, + configurable: true, + }); + World.getMinimumBalanceForRentExemption = function (connection, commitment) { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + return [ + 2, + connection.getMinimumBalanceForRentExemption( + World.byteSize, + commitment + ), + ]; + }); + }); + }; + World.hasCorrectByteSize = function (buf, offset) { + if (offset === void 0) { + offset = 0; + } + return buf.byteLength - offset === World.byteSize; + }; + World.prototype.pretty = function () { + var _this = this; + return { + id: (function () { + var x = _this.id; + if (typeof x.toNumber === "function") { + try { + return x.toNumber(); + } catch (_) { + return x; + } + } + return x; + })(), + entities: (function () { + var x = _this.entities; + if (typeof x.toNumber === "function") { + try { + return x.toNumber(); + } catch (_) { + return x; + } + } + return x; + })(), }; - return World; -}()); + }; + return World; +})(); exports.World = World; -exports.worldBeet = new beet.BeetStruct([ +exports.worldBeet = new beet.BeetStruct( + [ ["accountDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)], ["id", beet.u64], ["entities", beet.u64], -], World.fromArgs, "World"); -//# sourceMappingURL=World.js.map \ No newline at end of file + ], + World.fromArgs, + "World" +); +//# sourceMappingURL=World.js.map diff --git a/clients/bolt-sdk/lib/accounts/index.d.ts b/clients/bolt-sdk/lib/accounts/index.d.ts index 359a49b5..ec82a45a 100644 --- a/clients/bolt-sdk/lib/accounts/index.d.ts +++ b/clients/bolt-sdk/lib/accounts/index.d.ts @@ -5,8 +5,8 @@ export * from "./Entity"; export * from "./Registry"; export * from "./World"; export declare const accountProviders: { - Registry: typeof Registry; - World: typeof World; - Entity: typeof Entity; + Registry: typeof Registry; + World: typeof World; + Entity: typeof Entity; }; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file +//# sourceMappingURL=index.d.ts.map diff --git a/clients/bolt-sdk/lib/accounts/index.js b/clients/bolt-sdk/lib/accounts/index.js index 0cde17d7..a958c29f 100644 --- a/clients/bolt-sdk/lib/accounts/index.js +++ b/clients/bolt-sdk/lib/accounts/index.js @@ -1,18 +1,34 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __exportStar = + (this && this.__exportStar) || + function (m, exports) { + for (var p in m) + if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) + __createBinding(exports, m, p); + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.accountProviders = void 0; var Registry_1 = require("./Registry"); @@ -21,5 +37,9 @@ var Entity_1 = require("./Entity"); __exportStar(require("./Entity"), exports); __exportStar(require("./Registry"), exports); __exportStar(require("./World"), exports); -exports.accountProviders = { Registry: Registry_1.Registry, World: World_1.World, Entity: Entity_1.Entity }; -//# sourceMappingURL=index.js.map \ No newline at end of file +exports.accountProviders = { + Registry: Registry_1.Registry, + World: World_1.World, + Entity: Entity_1.Entity, +}; +//# sourceMappingURL=index.js.map diff --git a/clients/bolt-sdk/lib/index.d.ts b/clients/bolt-sdk/lib/index.d.ts index 522ffa47..a9662fc8 100644 --- a/clients/bolt-sdk/lib/index.d.ts +++ b/clients/bolt-sdk/lib/index.d.ts @@ -1,6 +1,7 @@ import { PublicKey } from "@solana/web3.js"; export * from "./accounts"; export * from "./instructions"; -export declare const PROGRAM_ADDRESS = "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n"; +export declare const PROGRAM_ADDRESS = + "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n"; export declare const PROGRAM_ID: PublicKey; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file +//# sourceMappingURL=index.d.ts.map diff --git a/clients/bolt-sdk/lib/index.js b/clients/bolt-sdk/lib/index.js index 9bb7cab7..840df246 100644 --- a/clients/bolt-sdk/lib/index.js +++ b/clients/bolt-sdk/lib/index.js @@ -1,18 +1,34 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __exportStar = + (this && this.__exportStar) || + function (m, exports) { + for (var p in m) + if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) + __createBinding(exports, m, p); + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.PROGRAM_ID = exports.PROGRAM_ADDRESS = void 0; var web3_js_1 = require("@solana/web3.js"); @@ -20,4 +36,4 @@ __exportStar(require("./accounts"), exports); __exportStar(require("./instructions"), exports); exports.PROGRAM_ADDRESS = "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n"; exports.PROGRAM_ID = new web3_js_1.PublicKey(exports.PROGRAM_ADDRESS); -//# sourceMappingURL=index.js.map \ No newline at end of file +//# sourceMappingURL=index.js.map diff --git a/clients/bolt-sdk/lib/instructions/addEntity.d.ts b/clients/bolt-sdk/lib/instructions/addEntity.d.ts index 99d59c0f..396e7c8d 100644 --- a/clients/bolt-sdk/lib/instructions/addEntity.d.ts +++ b/clients/bolt-sdk/lib/instructions/addEntity.d.ts @@ -1,15 +1,18 @@ import * as beet from "@metaplex-foundation/beet"; import * as web3 from "@solana/web3.js"; export declare const addEntityStruct: beet.BeetArgsStruct<{ - instructionDiscriminator: number[]; + instructionDiscriminator: number[]; }>; export interface AddEntityInstructionAccounts { - payer: web3.PublicKey; - entity: web3.PublicKey; - world: web3.PublicKey; - systemProgram?: web3.PublicKey; - anchorRemainingAccounts?: web3.AccountMeta[]; + payer: web3.PublicKey; + entity: web3.PublicKey; + world: web3.PublicKey; + systemProgram?: web3.PublicKey; + anchorRemainingAccounts?: web3.AccountMeta[]; } export declare const addEntityInstructionDiscriminator: number[]; -export declare function createAddEntityInstruction(accounts: AddEntityInstructionAccounts, programId?: web3.PublicKey): web3.TransactionInstruction; -//# sourceMappingURL=addEntity.d.ts.map \ No newline at end of file +export declare function createAddEntityInstruction( + accounts: AddEntityInstructionAccounts, + programId?: web3.PublicKey +): web3.TransactionInstruction; +//# sourceMappingURL=addEntity.d.ts.map diff --git a/clients/bolt-sdk/lib/instructions/addEntity.js b/clients/bolt-sdk/lib/instructions/addEntity.js index 04d678c3..5bc34849 100644 --- a/clients/bolt-sdk/lib/instructions/addEntity.js +++ b/clients/bolt-sdk/lib/instructions/addEntity.js @@ -1,75 +1,113 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.createAddEntityInstruction = exports.addEntityInstructionDiscriminator = exports.addEntityStruct = void 0; +exports.createAddEntityInstruction = + exports.addEntityInstructionDiscriminator = + exports.addEntityStruct = + void 0; var beet = __importStar(require("@metaplex-foundation/beet")); var web3 = __importStar(require("@solana/web3.js")); -exports.addEntityStruct = new beet.BeetArgsStruct([["instructionDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)]], "AddEntityInstructionArgs"); +exports.addEntityStruct = new beet.BeetArgsStruct( + [["instructionDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)]], + "AddEntityInstructionArgs" +); exports.addEntityInstructionDiscriminator = [ - 163, 241, 57, 35, 244, 244, 48, 57, + 163, 241, 57, 35, 244, 244, 48, 57, ]; function createAddEntityInstruction(accounts, programId) { - var _a; - if (programId === void 0) { programId = new web3.PublicKey("WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n"); } - var data = exports.addEntityStruct.serialize({ - instructionDiscriminator: exports.addEntityInstructionDiscriminator, - })[0]; - var keys = [ - { - pubkey: accounts.payer, - isWritable: true, - isSigner: true, - }, - { - pubkey: accounts.entity, - isWritable: true, - isSigner: false, - }, - { - pubkey: accounts.world, - isWritable: true, - isSigner: false, - }, - { - pubkey: (_a = accounts.systemProgram) !== null && _a !== void 0 ? _a : web3.SystemProgram.programId, - isWritable: false, - isSigner: false, - }, - ]; - if (accounts.anchorRemainingAccounts != null) { - for (var _i = 0, _b = accounts.anchorRemainingAccounts; _i < _b.length; _i++) { - var acc = _b[_i]; - keys.push(acc); - } + var _a; + if (programId === void 0) { + programId = new web3.PublicKey( + "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n" + ); + } + var data = exports.addEntityStruct.serialize({ + instructionDiscriminator: exports.addEntityInstructionDiscriminator, + })[0]; + var keys = [ + { + pubkey: accounts.payer, + isWritable: true, + isSigner: true, + }, + { + pubkey: accounts.entity, + isWritable: true, + isSigner: false, + }, + { + pubkey: accounts.world, + isWritable: true, + isSigner: false, + }, + { + pubkey: + (_a = accounts.systemProgram) !== null && _a !== void 0 + ? _a + : web3.SystemProgram.programId, + isWritable: false, + isSigner: false, + }, + ]; + if (accounts.anchorRemainingAccounts != null) { + for ( + var _i = 0, _b = accounts.anchorRemainingAccounts; + _i < _b.length; + _i++ + ) { + var acc = _b[_i]; + keys.push(acc); } - var ix = new web3.TransactionInstruction({ - programId: programId, - keys: keys, - data: data, - }); - return ix; + } + var ix = new web3.TransactionInstruction({ + programId: programId, + keys: keys, + data: data, + }); + return ix; } exports.createAddEntityInstruction = createAddEntityInstruction; -//# sourceMappingURL=addEntity.js.map \ No newline at end of file +//# sourceMappingURL=addEntity.js.map diff --git a/clients/bolt-sdk/lib/instructions/apply.d.ts b/clients/bolt-sdk/lib/instructions/apply.d.ts index 5bc76c74..5ef9b1f9 100644 --- a/clients/bolt-sdk/lib/instructions/apply.d.ts +++ b/clients/bolt-sdk/lib/instructions/apply.d.ts @@ -1,17 +1,23 @@ import * as beet from "@metaplex-foundation/beet"; import * as web3 from "@solana/web3.js"; export interface ApplyInstructionArgs { - args: Uint8Array; + args: Uint8Array; } -export declare const applyStruct: beet.FixableBeetArgsStruct; + } +>; export interface ApplyInstructionAccounts { - componentProgram: web3.PublicKey; - boltSystem: web3.PublicKey; - boltComponent: web3.PublicKey; - anchorRemainingAccounts?: web3.AccountMeta[]; + componentProgram: web3.PublicKey; + boltSystem: web3.PublicKey; + boltComponent: web3.PublicKey; + anchorRemainingAccounts?: web3.AccountMeta[]; } export declare const applyInstructionDiscriminator: number[]; -export declare function createApplyInstruction(accounts: ApplyInstructionAccounts, args: ApplyInstructionArgs, programId?: web3.PublicKey): web3.TransactionInstruction; -//# sourceMappingURL=apply.d.ts.map \ No newline at end of file +export declare function createApplyInstruction( + accounts: ApplyInstructionAccounts, + args: ApplyInstructionArgs, + programId?: web3.PublicKey +): web3.TransactionInstruction; +//# sourceMappingURL=apply.d.ts.map diff --git a/clients/bolt-sdk/lib/instructions/apply.js b/clients/bolt-sdk/lib/instructions/apply.js index 70f7c2d7..e1914943 100644 --- a/clients/bolt-sdk/lib/instructions/apply.js +++ b/clients/bolt-sdk/lib/instructions/apply.js @@ -1,81 +1,123 @@ "use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { +var __assign = + (this && this.__assign) || + function () { + __assign = + Object.assign || + function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; - }; + }; return __assign.apply(this, arguments); -}; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { + }; +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.createApplyInstruction = exports.applyInstructionDiscriminator = exports.applyStruct = void 0; +exports.createApplyInstruction = + exports.applyInstructionDiscriminator = + exports.applyStruct = + void 0; var beet = __importStar(require("@metaplex-foundation/beet")); var web3 = __importStar(require("@solana/web3.js")); -exports.applyStruct = new beet.FixableBeetArgsStruct([ +exports.applyStruct = new beet.FixableBeetArgsStruct( + [ ["instructionDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)], ["args", beet.bytes], -], "ApplyInstructionArgs"); -exports.applyInstructionDiscriminator = [ - 248, 243, 145, 24, 105, 50, 162, 225, -]; + ], + "ApplyInstructionArgs" +); +exports.applyInstructionDiscriminator = [248, 243, 145, 24, 105, 50, 162, 225]; function createApplyInstruction(accounts, args, programId) { - if (programId === void 0) { programId = new web3.PublicKey("WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n"); } - var data = exports.applyStruct.serialize(__assign({ instructionDiscriminator: exports.applyInstructionDiscriminator }, args))[0]; - var keys = [ - { - pubkey: accounts.componentProgram, - isWritable: false, - isSigner: false, - }, - { - pubkey: accounts.boltSystem, - isWritable: false, - isSigner: false, - }, - { - pubkey: accounts.boltComponent, - isWritable: true, - isSigner: false, - }, - ]; - if (accounts.anchorRemainingAccounts != null) { - for (var _i = 0, _a = accounts.anchorRemainingAccounts; _i < _a.length; _i++) { - var acc = _a[_i]; - keys.push(acc); - } + if (programId === void 0) { + programId = new web3.PublicKey( + "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n" + ); + } + var data = exports.applyStruct.serialize( + __assign( + { instructionDiscriminator: exports.applyInstructionDiscriminator }, + args + ) + )[0]; + var keys = [ + { + pubkey: accounts.componentProgram, + isWritable: false, + isSigner: false, + }, + { + pubkey: accounts.boltSystem, + isWritable: false, + isSigner: false, + }, + { + pubkey: accounts.boltComponent, + isWritable: true, + isSigner: false, + }, + ]; + if (accounts.anchorRemainingAccounts != null) { + for ( + var _i = 0, _a = accounts.anchorRemainingAccounts; + _i < _a.length; + _i++ + ) { + var acc = _a[_i]; + keys.push(acc); } - var ix = new web3.TransactionInstruction({ - programId: programId, - keys: keys, - data: data, - }); - return ix; + } + var ix = new web3.TransactionInstruction({ + programId: programId, + keys: keys, + data: data, + }); + return ix; } exports.createApplyInstruction = createApplyInstruction; -//# sourceMappingURL=apply.js.map \ No newline at end of file +//# sourceMappingURL=apply.js.map diff --git a/clients/bolt-sdk/lib/instructions/apply2.d.ts b/clients/bolt-sdk/lib/instructions/apply2.d.ts index a6f6a97d..ffe50253 100644 --- a/clients/bolt-sdk/lib/instructions/apply2.d.ts +++ b/clients/bolt-sdk/lib/instructions/apply2.d.ts @@ -1,19 +1,25 @@ import * as beet from "@metaplex-foundation/beet"; import * as web3 from "@solana/web3.js"; export interface Apply2InstructionArgs { - args: Uint8Array; + args: Uint8Array; } -export declare const apply2Struct: beet.FixableBeetArgsStruct; + } +>; export interface Apply2InstructionAccounts { - boltSystem: web3.PublicKey; - componentProgram1: web3.PublicKey; - boltComponent1: web3.PublicKey; - componentProgram2: web3.PublicKey; - boltComponent2: web3.PublicKey; - anchorRemainingAccounts?: web3.AccountMeta[]; + boltSystem: web3.PublicKey; + componentProgram1: web3.PublicKey; + boltComponent1: web3.PublicKey; + componentProgram2: web3.PublicKey; + boltComponent2: web3.PublicKey; + anchorRemainingAccounts?: web3.AccountMeta[]; } export declare const apply2InstructionDiscriminator: number[]; -export declare function createApply2Instruction(accounts: Apply2InstructionAccounts, args: Apply2InstructionArgs, programId?: web3.PublicKey): web3.TransactionInstruction; -//# sourceMappingURL=apply2.d.ts.map \ No newline at end of file +export declare function createApply2Instruction( + accounts: Apply2InstructionAccounts, + args: Apply2InstructionArgs, + programId?: web3.PublicKey +): web3.TransactionInstruction; +//# sourceMappingURL=apply2.d.ts.map diff --git a/clients/bolt-sdk/lib/instructions/apply2.js b/clients/bolt-sdk/lib/instructions/apply2.js index 085fd125..614cc52c 100644 --- a/clients/bolt-sdk/lib/instructions/apply2.js +++ b/clients/bolt-sdk/lib/instructions/apply2.js @@ -1,91 +1,133 @@ "use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { +var __assign = + (this && this.__assign) || + function () { + __assign = + Object.assign || + function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; - }; + }; return __assign.apply(this, arguments); -}; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { + }; +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.createApply2Instruction = exports.apply2InstructionDiscriminator = exports.apply2Struct = void 0; +exports.createApply2Instruction = + exports.apply2InstructionDiscriminator = + exports.apply2Struct = + void 0; var beet = __importStar(require("@metaplex-foundation/beet")); var web3 = __importStar(require("@solana/web3.js")); -exports.apply2Struct = new beet.FixableBeetArgsStruct([ +exports.apply2Struct = new beet.FixableBeetArgsStruct( + [ ["instructionDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)], ["args", beet.bytes], -], "Apply2InstructionArgs"); -exports.apply2InstructionDiscriminator = [ - 120, 32, 116, 154, 158, 159, 208, 73, -]; + ], + "Apply2InstructionArgs" +); +exports.apply2InstructionDiscriminator = [120, 32, 116, 154, 158, 159, 208, 73]; function createApply2Instruction(accounts, args, programId) { - if (programId === void 0) { programId = new web3.PublicKey("WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n"); } - var data = exports.apply2Struct.serialize(__assign({ instructionDiscriminator: exports.apply2InstructionDiscriminator }, args))[0]; - var keys = [ - { - pubkey: accounts.boltSystem, - isWritable: false, - isSigner: false, - }, - { - pubkey: accounts.componentProgram1, - isWritable: false, - isSigner: false, - }, - { - pubkey: accounts.boltComponent1, - isWritable: true, - isSigner: false, - }, - { - pubkey: accounts.componentProgram2, - isWritable: false, - isSigner: false, - }, - { - pubkey: accounts.boltComponent2, - isWritable: true, - isSigner: false, - }, - ]; - if (accounts.anchorRemainingAccounts != null) { - for (var _i = 0, _a = accounts.anchorRemainingAccounts; _i < _a.length; _i++) { - var acc = _a[_i]; - keys.push(acc); - } + if (programId === void 0) { + programId = new web3.PublicKey( + "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n" + ); + } + var data = exports.apply2Struct.serialize( + __assign( + { instructionDiscriminator: exports.apply2InstructionDiscriminator }, + args + ) + )[0]; + var keys = [ + { + pubkey: accounts.boltSystem, + isWritable: false, + isSigner: false, + }, + { + pubkey: accounts.componentProgram1, + isWritable: false, + isSigner: false, + }, + { + pubkey: accounts.boltComponent1, + isWritable: true, + isSigner: false, + }, + { + pubkey: accounts.componentProgram2, + isWritable: false, + isSigner: false, + }, + { + pubkey: accounts.boltComponent2, + isWritable: true, + isSigner: false, + }, + ]; + if (accounts.anchorRemainingAccounts != null) { + for ( + var _i = 0, _a = accounts.anchorRemainingAccounts; + _i < _a.length; + _i++ + ) { + var acc = _a[_i]; + keys.push(acc); } - var ix = new web3.TransactionInstruction({ - programId: programId, - keys: keys, - data: data, - }); - return ix; + } + var ix = new web3.TransactionInstruction({ + programId: programId, + keys: keys, + data: data, + }); + return ix; } exports.createApply2Instruction = createApply2Instruction; -//# sourceMappingURL=apply2.js.map \ No newline at end of file +//# sourceMappingURL=apply2.js.map diff --git a/clients/bolt-sdk/lib/instructions/apply3.d.ts b/clients/bolt-sdk/lib/instructions/apply3.d.ts index 77f9c75e..c29a4aa7 100644 --- a/clients/bolt-sdk/lib/instructions/apply3.d.ts +++ b/clients/bolt-sdk/lib/instructions/apply3.d.ts @@ -1,21 +1,27 @@ import * as beet from "@metaplex-foundation/beet"; import * as web3 from "@solana/web3.js"; export interface Apply3InstructionArgs { - args: Uint8Array; + args: Uint8Array; } -export declare const apply3Struct: beet.FixableBeetArgsStruct; + } +>; export interface Apply3InstructionAccounts { - boltSystem: web3.PublicKey; - componentProgram1: web3.PublicKey; - boltComponent1: web3.PublicKey; - componentProgram2: web3.PublicKey; - boltComponent2: web3.PublicKey; - componentProgram3: web3.PublicKey; - boltComponent3: web3.PublicKey; - anchorRemainingAccounts?: web3.AccountMeta[]; + boltSystem: web3.PublicKey; + componentProgram1: web3.PublicKey; + boltComponent1: web3.PublicKey; + componentProgram2: web3.PublicKey; + boltComponent2: web3.PublicKey; + componentProgram3: web3.PublicKey; + boltComponent3: web3.PublicKey; + anchorRemainingAccounts?: web3.AccountMeta[]; } export declare const apply3InstructionDiscriminator: number[]; -export declare function createApply3Instruction(accounts: Apply3InstructionAccounts, args: Apply3InstructionArgs, programId?: web3.PublicKey): web3.TransactionInstruction; -//# sourceMappingURL=apply3.d.ts.map \ No newline at end of file +export declare function createApply3Instruction( + accounts: Apply3InstructionAccounts, + args: Apply3InstructionArgs, + programId?: web3.PublicKey +): web3.TransactionInstruction; +//# sourceMappingURL=apply3.d.ts.map diff --git a/clients/bolt-sdk/lib/instructions/apply3.js b/clients/bolt-sdk/lib/instructions/apply3.js index 33e108c4..b69d3dc6 100644 --- a/clients/bolt-sdk/lib/instructions/apply3.js +++ b/clients/bolt-sdk/lib/instructions/apply3.js @@ -1,101 +1,143 @@ "use strict"; -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { +var __assign = + (this && this.__assign) || + function () { + __assign = + Object.assign || + function (t) { for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; - }; + }; return __assign.apply(this, arguments); -}; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { + }; +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.createApply3Instruction = exports.apply3InstructionDiscriminator = exports.apply3Struct = void 0; +exports.createApply3Instruction = + exports.apply3InstructionDiscriminator = + exports.apply3Struct = + void 0; var beet = __importStar(require("@metaplex-foundation/beet")); var web3 = __importStar(require("@solana/web3.js")); -exports.apply3Struct = new beet.FixableBeetArgsStruct([ +exports.apply3Struct = new beet.FixableBeetArgsStruct( + [ ["instructionDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)], ["args", beet.bytes], -], "Apply3InstructionArgs"); -exports.apply3InstructionDiscriminator = [ - 254, 146, 49, 7, 236, 131, 105, 221, -]; + ], + "Apply3InstructionArgs" +); +exports.apply3InstructionDiscriminator = [254, 146, 49, 7, 236, 131, 105, 221]; function createApply3Instruction(accounts, args, programId) { - if (programId === void 0) { programId = new web3.PublicKey("WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n"); } - var data = exports.apply3Struct.serialize(__assign({ instructionDiscriminator: exports.apply3InstructionDiscriminator }, args))[0]; - var keys = [ - { - pubkey: accounts.boltSystem, - isWritable: false, - isSigner: false, - }, - { - pubkey: accounts.componentProgram1, - isWritable: false, - isSigner: false, - }, - { - pubkey: accounts.boltComponent1, - isWritable: true, - isSigner: false, - }, - { - pubkey: accounts.componentProgram2, - isWritable: false, - isSigner: false, - }, - { - pubkey: accounts.boltComponent2, - isWritable: true, - isSigner: false, - }, - { - pubkey: accounts.componentProgram3, - isWritable: false, - isSigner: false, - }, - { - pubkey: accounts.boltComponent3, - isWritable: true, - isSigner: false, - }, - ]; - if (accounts.anchorRemainingAccounts != null) { - for (var _i = 0, _a = accounts.anchorRemainingAccounts; _i < _a.length; _i++) { - var acc = _a[_i]; - keys.push(acc); - } + if (programId === void 0) { + programId = new web3.PublicKey( + "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n" + ); + } + var data = exports.apply3Struct.serialize( + __assign( + { instructionDiscriminator: exports.apply3InstructionDiscriminator }, + args + ) + )[0]; + var keys = [ + { + pubkey: accounts.boltSystem, + isWritable: false, + isSigner: false, + }, + { + pubkey: accounts.componentProgram1, + isWritable: false, + isSigner: false, + }, + { + pubkey: accounts.boltComponent1, + isWritable: true, + isSigner: false, + }, + { + pubkey: accounts.componentProgram2, + isWritable: false, + isSigner: false, + }, + { + pubkey: accounts.boltComponent2, + isWritable: true, + isSigner: false, + }, + { + pubkey: accounts.componentProgram3, + isWritable: false, + isSigner: false, + }, + { + pubkey: accounts.boltComponent3, + isWritable: true, + isSigner: false, + }, + ]; + if (accounts.anchorRemainingAccounts != null) { + for ( + var _i = 0, _a = accounts.anchorRemainingAccounts; + _i < _a.length; + _i++ + ) { + var acc = _a[_i]; + keys.push(acc); } - var ix = new web3.TransactionInstruction({ - programId: programId, - keys: keys, - data: data, - }); - return ix; + } + var ix = new web3.TransactionInstruction({ + programId: programId, + keys: keys, + data: data, + }); + return ix; } exports.createApply3Instruction = createApply3Instruction; -//# sourceMappingURL=apply3.js.map \ No newline at end of file +//# sourceMappingURL=apply3.js.map diff --git a/clients/bolt-sdk/lib/instructions/index.d.ts b/clients/bolt-sdk/lib/instructions/index.d.ts index ffe9bff2..b9bc0698 100644 --- a/clients/bolt-sdk/lib/instructions/index.d.ts +++ b/clients/bolt-sdk/lib/instructions/index.d.ts @@ -5,4 +5,4 @@ export * from "./apply3"; export * from "./initializeComponent"; export * from "./initializeNewWorld"; export * from "./initializeRegistry"; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file +//# sourceMappingURL=index.d.ts.map diff --git a/clients/bolt-sdk/lib/instructions/index.js b/clients/bolt-sdk/lib/instructions/index.js index 51654ae9..d7cbfcb6 100644 --- a/clients/bolt-sdk/lib/instructions/index.js +++ b/clients/bolt-sdk/lib/instructions/index.js @@ -1,18 +1,34 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __exportStar = + (this && this.__exportStar) || + function (m, exports) { + for (var p in m) + if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) + __createBinding(exports, m, p); + }; Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./addEntity"), exports); __exportStar(require("./apply"), exports); @@ -21,4 +37,4 @@ __exportStar(require("./apply3"), exports); __exportStar(require("./initializeComponent"), exports); __exportStar(require("./initializeNewWorld"), exports); __exportStar(require("./initializeRegistry"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file +//# sourceMappingURL=index.js.map diff --git a/clients/bolt-sdk/lib/instructions/initializeComponent.d.ts b/clients/bolt-sdk/lib/instructions/initializeComponent.d.ts index f91db35f..523f62e0 100644 --- a/clients/bolt-sdk/lib/instructions/initializeComponent.d.ts +++ b/clients/bolt-sdk/lib/instructions/initializeComponent.d.ts @@ -1,16 +1,19 @@ import * as beet from "@metaplex-foundation/beet"; import * as web3 from "@solana/web3.js"; export declare const initializeComponentStruct: beet.BeetArgsStruct<{ - instructionDiscriminator: number[]; + instructionDiscriminator: number[]; }>; export interface InitializeComponentInstructionAccounts { - payer: web3.PublicKey; - data: web3.PublicKey; - entity: web3.PublicKey; - componentProgram: web3.PublicKey; - systemProgram?: web3.PublicKey; - anchorRemainingAccounts?: web3.AccountMeta[]; + payer: web3.PublicKey; + data: web3.PublicKey; + entity: web3.PublicKey; + componentProgram: web3.PublicKey; + systemProgram?: web3.PublicKey; + anchorRemainingAccounts?: web3.AccountMeta[]; } export declare const initializeComponentInstructionDiscriminator: number[]; -export declare function createInitializeComponentInstruction(accounts: InitializeComponentInstructionAccounts, programId?: web3.PublicKey): web3.TransactionInstruction; -//# sourceMappingURL=initializeComponent.d.ts.map \ No newline at end of file +export declare function createInitializeComponentInstruction( + accounts: InitializeComponentInstructionAccounts, + programId?: web3.PublicKey +): web3.TransactionInstruction; +//# sourceMappingURL=initializeComponent.d.ts.map diff --git a/clients/bolt-sdk/lib/instructions/initializeComponent.js b/clients/bolt-sdk/lib/instructions/initializeComponent.js index bf2ff4e3..3d9a4044 100644 --- a/clients/bolt-sdk/lib/instructions/initializeComponent.js +++ b/clients/bolt-sdk/lib/instructions/initializeComponent.js @@ -1,80 +1,120 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.createInitializeComponentInstruction = exports.initializeComponentInstructionDiscriminator = exports.initializeComponentStruct = void 0; +exports.createInitializeComponentInstruction = + exports.initializeComponentInstructionDiscriminator = + exports.initializeComponentStruct = + void 0; var beet = __importStar(require("@metaplex-foundation/beet")); var web3 = __importStar(require("@solana/web3.js")); -exports.initializeComponentStruct = new beet.BeetArgsStruct([["instructionDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)]], "InitializeComponentInstructionArgs"); +exports.initializeComponentStruct = new beet.BeetArgsStruct( + [["instructionDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)]], + "InitializeComponentInstructionArgs" +); exports.initializeComponentInstructionDiscriminator = [ - 36, 143, 233, 113, 12, 234, 61, 30, + 36, 143, 233, 113, 12, 234, 61, 30, ]; function createInitializeComponentInstruction(accounts, programId) { - var _a; - if (programId === void 0) { programId = new web3.PublicKey("WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n"); } - var data = exports.initializeComponentStruct.serialize({ - instructionDiscriminator: exports.initializeComponentInstructionDiscriminator, - })[0]; - var keys = [ - { - pubkey: accounts.payer, - isWritable: true, - isSigner: true, - }, - { - pubkey: accounts.data, - isWritable: true, - isSigner: false, - }, - { - pubkey: accounts.entity, - isWritable: false, - isSigner: false, - }, - { - pubkey: accounts.componentProgram, - isWritable: false, - isSigner: false, - }, - { - pubkey: (_a = accounts.systemProgram) !== null && _a !== void 0 ? _a : web3.SystemProgram.programId, - isWritable: false, - isSigner: false, - }, - ]; - if (accounts.anchorRemainingAccounts != null) { - for (var _i = 0, _b = accounts.anchorRemainingAccounts; _i < _b.length; _i++) { - var acc = _b[_i]; - keys.push(acc); - } + var _a; + if (programId === void 0) { + programId = new web3.PublicKey( + "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n" + ); + } + var data = exports.initializeComponentStruct.serialize({ + instructionDiscriminator: + exports.initializeComponentInstructionDiscriminator, + })[0]; + var keys = [ + { + pubkey: accounts.payer, + isWritable: true, + isSigner: true, + }, + { + pubkey: accounts.data, + isWritable: true, + isSigner: false, + }, + { + pubkey: accounts.entity, + isWritable: false, + isSigner: false, + }, + { + pubkey: accounts.componentProgram, + isWritable: false, + isSigner: false, + }, + { + pubkey: + (_a = accounts.systemProgram) !== null && _a !== void 0 + ? _a + : web3.SystemProgram.programId, + isWritable: false, + isSigner: false, + }, + ]; + if (accounts.anchorRemainingAccounts != null) { + for ( + var _i = 0, _b = accounts.anchorRemainingAccounts; + _i < _b.length; + _i++ + ) { + var acc = _b[_i]; + keys.push(acc); } - var ix = new web3.TransactionInstruction({ - programId: programId, - keys: keys, - data: data, - }); - return ix; + } + var ix = new web3.TransactionInstruction({ + programId: programId, + keys: keys, + data: data, + }); + return ix; } -exports.createInitializeComponentInstruction = createInitializeComponentInstruction; -//# sourceMappingURL=initializeComponent.js.map \ No newline at end of file +exports.createInitializeComponentInstruction = + createInitializeComponentInstruction; +//# sourceMappingURL=initializeComponent.js.map diff --git a/clients/bolt-sdk/lib/instructions/initializeNewWorld.d.ts b/clients/bolt-sdk/lib/instructions/initializeNewWorld.d.ts index 4f119ac8..d9876eaf 100644 --- a/clients/bolt-sdk/lib/instructions/initializeNewWorld.d.ts +++ b/clients/bolt-sdk/lib/instructions/initializeNewWorld.d.ts @@ -1,15 +1,18 @@ import * as beet from "@metaplex-foundation/beet"; import * as web3 from "@solana/web3.js"; export declare const initializeNewWorldStruct: beet.BeetArgsStruct<{ - instructionDiscriminator: number[]; + instructionDiscriminator: number[]; }>; export interface InitializeNewWorldInstructionAccounts { - payer: web3.PublicKey; - world: web3.PublicKey; - registry: web3.PublicKey; - systemProgram?: web3.PublicKey; - anchorRemainingAccounts?: web3.AccountMeta[]; + payer: web3.PublicKey; + world: web3.PublicKey; + registry: web3.PublicKey; + systemProgram?: web3.PublicKey; + anchorRemainingAccounts?: web3.AccountMeta[]; } export declare const initializeNewWorldInstructionDiscriminator: number[]; -export declare function createInitializeNewWorldInstruction(accounts: InitializeNewWorldInstructionAccounts, programId?: web3.PublicKey): web3.TransactionInstruction; -//# sourceMappingURL=initializeNewWorld.d.ts.map \ No newline at end of file +export declare function createInitializeNewWorldInstruction( + accounts: InitializeNewWorldInstructionAccounts, + programId?: web3.PublicKey +): web3.TransactionInstruction; +//# sourceMappingURL=initializeNewWorld.d.ts.map diff --git a/clients/bolt-sdk/lib/instructions/initializeNewWorld.js b/clients/bolt-sdk/lib/instructions/initializeNewWorld.js index 3426afc7..f922cb11 100644 --- a/clients/bolt-sdk/lib/instructions/initializeNewWorld.js +++ b/clients/bolt-sdk/lib/instructions/initializeNewWorld.js @@ -1,75 +1,115 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.createInitializeNewWorldInstruction = exports.initializeNewWorldInstructionDiscriminator = exports.initializeNewWorldStruct = void 0; +exports.createInitializeNewWorldInstruction = + exports.initializeNewWorldInstructionDiscriminator = + exports.initializeNewWorldStruct = + void 0; var beet = __importStar(require("@metaplex-foundation/beet")); var web3 = __importStar(require("@solana/web3.js")); -exports.initializeNewWorldStruct = new beet.BeetArgsStruct([["instructionDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)]], "InitializeNewWorldInstructionArgs"); +exports.initializeNewWorldStruct = new beet.BeetArgsStruct( + [["instructionDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)]], + "InitializeNewWorldInstructionArgs" +); exports.initializeNewWorldInstructionDiscriminator = [ - 23, 96, 88, 194, 200, 203, 200, 98, + 23, 96, 88, 194, 200, 203, 200, 98, ]; function createInitializeNewWorldInstruction(accounts, programId) { - var _a; - if (programId === void 0) { programId = new web3.PublicKey("WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n"); } - var data = exports.initializeNewWorldStruct.serialize({ - instructionDiscriminator: exports.initializeNewWorldInstructionDiscriminator, - })[0]; - var keys = [ - { - pubkey: accounts.payer, - isWritable: true, - isSigner: true, - }, - { - pubkey: accounts.world, - isWritable: true, - isSigner: false, - }, - { - pubkey: accounts.registry, - isWritable: true, - isSigner: false, - }, - { - pubkey: (_a = accounts.systemProgram) !== null && _a !== void 0 ? _a : web3.SystemProgram.programId, - isWritable: false, - isSigner: false, - }, - ]; - if (accounts.anchorRemainingAccounts != null) { - for (var _i = 0, _b = accounts.anchorRemainingAccounts; _i < _b.length; _i++) { - var acc = _b[_i]; - keys.push(acc); - } + var _a; + if (programId === void 0) { + programId = new web3.PublicKey( + "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n" + ); + } + var data = exports.initializeNewWorldStruct.serialize({ + instructionDiscriminator: + exports.initializeNewWorldInstructionDiscriminator, + })[0]; + var keys = [ + { + pubkey: accounts.payer, + isWritable: true, + isSigner: true, + }, + { + pubkey: accounts.world, + isWritable: true, + isSigner: false, + }, + { + pubkey: accounts.registry, + isWritable: true, + isSigner: false, + }, + { + pubkey: + (_a = accounts.systemProgram) !== null && _a !== void 0 + ? _a + : web3.SystemProgram.programId, + isWritable: false, + isSigner: false, + }, + ]; + if (accounts.anchorRemainingAccounts != null) { + for ( + var _i = 0, _b = accounts.anchorRemainingAccounts; + _i < _b.length; + _i++ + ) { + var acc = _b[_i]; + keys.push(acc); } - var ix = new web3.TransactionInstruction({ - programId: programId, - keys: keys, - data: data, - }); - return ix; + } + var ix = new web3.TransactionInstruction({ + programId: programId, + keys: keys, + data: data, + }); + return ix; } -exports.createInitializeNewWorldInstruction = createInitializeNewWorldInstruction; -//# sourceMappingURL=initializeNewWorld.js.map \ No newline at end of file +exports.createInitializeNewWorldInstruction = + createInitializeNewWorldInstruction; +//# sourceMappingURL=initializeNewWorld.js.map diff --git a/clients/bolt-sdk/lib/instructions/initializeRegistry.d.ts b/clients/bolt-sdk/lib/instructions/initializeRegistry.d.ts index 93b9ea0d..4e97da95 100644 --- a/clients/bolt-sdk/lib/instructions/initializeRegistry.d.ts +++ b/clients/bolt-sdk/lib/instructions/initializeRegistry.d.ts @@ -1,14 +1,17 @@ import * as beet from "@metaplex-foundation/beet"; import * as web3 from "@solana/web3.js"; export declare const initializeRegistryStruct: beet.BeetArgsStruct<{ - instructionDiscriminator: number[]; + instructionDiscriminator: number[]; }>; export interface InitializeRegistryInstructionAccounts { - registry: web3.PublicKey; - payer: web3.PublicKey; - systemProgram?: web3.PublicKey; - anchorRemainingAccounts?: web3.AccountMeta[]; + registry: web3.PublicKey; + payer: web3.PublicKey; + systemProgram?: web3.PublicKey; + anchorRemainingAccounts?: web3.AccountMeta[]; } export declare const initializeRegistryInstructionDiscriminator: number[]; -export declare function createInitializeRegistryInstruction(accounts: InitializeRegistryInstructionAccounts, programId?: web3.PublicKey): web3.TransactionInstruction; -//# sourceMappingURL=initializeRegistry.d.ts.map \ No newline at end of file +export declare function createInitializeRegistryInstruction( + accounts: InitializeRegistryInstructionAccounts, + programId?: web3.PublicKey +): web3.TransactionInstruction; +//# sourceMappingURL=initializeRegistry.d.ts.map diff --git a/clients/bolt-sdk/lib/instructions/initializeRegistry.js b/clients/bolt-sdk/lib/instructions/initializeRegistry.js index 48e8009f..e0f0789c 100644 --- a/clients/bolt-sdk/lib/instructions/initializeRegistry.js +++ b/clients/bolt-sdk/lib/instructions/initializeRegistry.js @@ -1,70 +1,110 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.createInitializeRegistryInstruction = exports.initializeRegistryInstructionDiscriminator = exports.initializeRegistryStruct = void 0; +exports.createInitializeRegistryInstruction = + exports.initializeRegistryInstructionDiscriminator = + exports.initializeRegistryStruct = + void 0; var beet = __importStar(require("@metaplex-foundation/beet")); var web3 = __importStar(require("@solana/web3.js")); -exports.initializeRegistryStruct = new beet.BeetArgsStruct([["instructionDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)]], "InitializeRegistryInstructionArgs"); +exports.initializeRegistryStruct = new beet.BeetArgsStruct( + [["instructionDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)]], + "InitializeRegistryInstructionArgs" +); exports.initializeRegistryInstructionDiscriminator = [ - 189, 181, 20, 17, 174, 57, 249, 59, + 189, 181, 20, 17, 174, 57, 249, 59, ]; function createInitializeRegistryInstruction(accounts, programId) { - var _a; - if (programId === void 0) { programId = new web3.PublicKey("WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n"); } - var data = exports.initializeRegistryStruct.serialize({ - instructionDiscriminator: exports.initializeRegistryInstructionDiscriminator, - })[0]; - var keys = [ - { - pubkey: accounts.registry, - isWritable: true, - isSigner: false, - }, - { - pubkey: accounts.payer, - isWritable: true, - isSigner: true, - }, - { - pubkey: (_a = accounts.systemProgram) !== null && _a !== void 0 ? _a : web3.SystemProgram.programId, - isWritable: false, - isSigner: false, - }, - ]; - if (accounts.anchorRemainingAccounts != null) { - for (var _i = 0, _b = accounts.anchorRemainingAccounts; _i < _b.length; _i++) { - var acc = _b[_i]; - keys.push(acc); - } + var _a; + if (programId === void 0) { + programId = new web3.PublicKey( + "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n" + ); + } + var data = exports.initializeRegistryStruct.serialize({ + instructionDiscriminator: + exports.initializeRegistryInstructionDiscriminator, + })[0]; + var keys = [ + { + pubkey: accounts.registry, + isWritable: true, + isSigner: false, + }, + { + pubkey: accounts.payer, + isWritable: true, + isSigner: true, + }, + { + pubkey: + (_a = accounts.systemProgram) !== null && _a !== void 0 + ? _a + : web3.SystemProgram.programId, + isWritable: false, + isSigner: false, + }, + ]; + if (accounts.anchorRemainingAccounts != null) { + for ( + var _i = 0, _b = accounts.anchorRemainingAccounts; + _i < _b.length; + _i++ + ) { + var acc = _b[_i]; + keys.push(acc); } - var ix = new web3.TransactionInstruction({ - programId: programId, - keys: keys, - data: data, - }); - return ix; + } + var ix = new web3.TransactionInstruction({ + programId: programId, + keys: keys, + data: data, + }); + return ix; } -exports.createInitializeRegistryInstruction = createInitializeRegistryInstruction; -//# sourceMappingURL=initializeRegistry.js.map \ No newline at end of file +exports.createInitializeRegistryInstruction = + createInitializeRegistryInstruction; +//# sourceMappingURL=initializeRegistry.js.map diff --git a/clients/bolt-sdk/src/generated/accounts/Entity.js b/clients/bolt-sdk/src/generated/accounts/Entity.js index ee964f0c..691f0374 100644 --- a/clients/bolt-sdk/src/generated/accounts/Entity.js +++ b/clients/bolt-sdk/src/generated/accounts/Entity.js @@ -5,38 +5,83 @@ * * See: https://github.com/metaplex-foundation/solita */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + }; +var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.entityBeet = exports.Entity = exports.entityDiscriminator = void 0; const beet = __importStar(require("@metaplex-foundation/beet")); @@ -51,112 +96,127 @@ exports.entityDiscriminator = [46, 157, 161, 161, 254, 46, 79, 24]; * @category generated */ class Entity { - constructor(id) { - this.id = id; - } - /** - * Creates a {@link Entity} instance from the provided args. - */ - static fromArgs(args) { - return new Entity(args.id); - } - /** - * Deserializes the {@link Entity} from the data of the provided {@link web3.AccountInfo}. - * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it. - */ - static fromAccountInfo(accountInfo, offset = 0) { - return Entity.deserialize(accountInfo.data, offset); - } - /** - * Retrieves the account info from the provided address and deserializes - * the {@link Entity} from its data. - * - * @throws Error if no account info is found at the address or if deserialization fails - */ - static fromAccountAddress(connection, address, commitmentOrConfig) { - return __awaiter(this, void 0, void 0, function* () { - const accountInfo = yield connection.getAccountInfo(address, commitmentOrConfig); - if (accountInfo == null) { - throw new Error(`Unable to find Entity account at ${address}`); - } - return Entity.fromAccountInfo(accountInfo, 0)[0]; - }); - } - /** - * Provides a {@link web3.Connection.getProgramAccounts} config builder, - * to fetch accounts matching filters that can be specified via that builder. - * - * @param programId - the program that owns the accounts we are filtering - */ - static gpaBuilder(programId = new web3.PublicKey('WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n')) { - return beetSolana.GpaBuilder.fromStruct(programId, exports.entityBeet); - } - /** - * Deserializes the {@link Entity} from the provided data Buffer. - * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it. - */ - static deserialize(buf, offset = 0) { - return exports.entityBeet.deserialize(buf, offset); - } - /** - * Serializes the {@link Entity} into a Buffer. - * @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it. - */ - serialize() { - return exports.entityBeet.serialize(Object.assign({ accountDiscriminator: exports.entityDiscriminator }, this)); - } - /** - * Returns the byteSize of a {@link Buffer} holding the serialized data of - * {@link Entity} - */ - static get byteSize() { - return exports.entityBeet.byteSize; - } - /** - * Fetches the minimum balance needed to exempt an account holding - * {@link Entity} data from rent - * - * @param connection used to retrieve the rent exemption information - */ - static getMinimumBalanceForRentExemption(connection, commitment) { - return __awaiter(this, void 0, void 0, function* () { - return connection.getMinimumBalanceForRentExemption(Entity.byteSize, commitment); - }); - } - /** - * Determines if the provided {@link Buffer} has the correct byte size to - * hold {@link Entity} data. - */ - static hasCorrectByteSize(buf, offset = 0) { - return buf.byteLength - offset === Entity.byteSize; - } - /** - * Returns a readable version of {@link Entity} properties - * and can be used to convert to JSON and/or logging - */ - pretty() { - return { - id: (() => { - const x = this.id; - if (typeof x.toNumber === 'function') { - try { - return x.toNumber(); - } - catch (_) { - return x; - } - } - return x; - })(), - }; - } + constructor(id) { + this.id = id; + } + /** + * Creates a {@link Entity} instance from the provided args. + */ + static fromArgs(args) { + return new Entity(args.id); + } + /** + * Deserializes the {@link Entity} from the data of the provided {@link web3.AccountInfo}. + * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it. + */ + static fromAccountInfo(accountInfo, offset = 0) { + return Entity.deserialize(accountInfo.data, offset); + } + /** + * Retrieves the account info from the provided address and deserializes + * the {@link Entity} from its data. + * + * @throws Error if no account info is found at the address or if deserialization fails + */ + static fromAccountAddress(connection, address, commitmentOrConfig) { + return __awaiter(this, void 0, void 0, function* () { + const accountInfo = yield connection.getAccountInfo( + address, + commitmentOrConfig + ); + if (accountInfo == null) { + throw new Error(`Unable to find Entity account at ${address}`); + } + return Entity.fromAccountInfo(accountInfo, 0)[0]; + }); + } + /** + * Provides a {@link web3.Connection.getProgramAccounts} config builder, + * to fetch accounts matching filters that can be specified via that builder. + * + * @param programId - the program that owns the accounts we are filtering + */ + static gpaBuilder( + programId = new web3.PublicKey( + "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n" + ) + ) { + return beetSolana.GpaBuilder.fromStruct(programId, exports.entityBeet); + } + /** + * Deserializes the {@link Entity} from the provided data Buffer. + * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it. + */ + static deserialize(buf, offset = 0) { + return exports.entityBeet.deserialize(buf, offset); + } + /** + * Serializes the {@link Entity} into a Buffer. + * @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it. + */ + serialize() { + return exports.entityBeet.serialize( + Object.assign({ accountDiscriminator: exports.entityDiscriminator }, this) + ); + } + /** + * Returns the byteSize of a {@link Buffer} holding the serialized data of + * {@link Entity} + */ + static get byteSize() { + return exports.entityBeet.byteSize; + } + /** + * Fetches the minimum balance needed to exempt an account holding + * {@link Entity} data from rent + * + * @param connection used to retrieve the rent exemption information + */ + static getMinimumBalanceForRentExemption(connection, commitment) { + return __awaiter(this, void 0, void 0, function* () { + return connection.getMinimumBalanceForRentExemption( + Entity.byteSize, + commitment + ); + }); + } + /** + * Determines if the provided {@link Buffer} has the correct byte size to + * hold {@link Entity} data. + */ + static hasCorrectByteSize(buf, offset = 0) { + return buf.byteLength - offset === Entity.byteSize; + } + /** + * Returns a readable version of {@link Entity} properties + * and can be used to convert to JSON and/or logging + */ + pretty() { + return { + id: (() => { + const x = this.id; + if (typeof x.toNumber === "function") { + try { + return x.toNumber(); + } catch (_) { + return x; + } + } + return x; + })(), + }; + } } exports.Entity = Entity; /** * @category Accounts * @category generated */ -exports.entityBeet = new beet.BeetStruct([ - ['accountDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], - ['id', beet.u64], -], Entity.fromArgs, 'Entity'); +exports.entityBeet = new beet.BeetStruct( + [ + ["accountDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)], + ["id", beet.u64], + ], + Entity.fromArgs, + "Entity" +); diff --git a/clients/bolt-sdk/src/generated/accounts/Registry.js b/clients/bolt-sdk/src/generated/accounts/Registry.js index 7c1adb8c..70169b62 100644 --- a/clients/bolt-sdk/src/generated/accounts/Registry.js +++ b/clients/bolt-sdk/src/generated/accounts/Registry.js @@ -5,40 +5,88 @@ * * See: https://github.com/metaplex-foundation/solita */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + }; +var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.registryBeet = exports.Registry = exports.registryDiscriminator = void 0; +exports.registryBeet = + exports.Registry = + exports.registryDiscriminator = + void 0; const beet = __importStar(require("@metaplex-foundation/beet")); const web3 = __importStar(require("@solana/web3.js")); const beetSolana = __importStar(require("@metaplex-foundation/beet-solana")); @@ -51,112 +99,130 @@ exports.registryDiscriminator = [47, 174, 110, 246, 184, 182, 252, 218]; * @category generated */ class Registry { - constructor(worlds) { - this.worlds = worlds; - } - /** - * Creates a {@link Registry} instance from the provided args. - */ - static fromArgs(args) { - return new Registry(args.worlds); - } - /** - * Deserializes the {@link Registry} from the data of the provided {@link web3.AccountInfo}. - * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it. - */ - static fromAccountInfo(accountInfo, offset = 0) { - return Registry.deserialize(accountInfo.data, offset); - } - /** - * Retrieves the account info from the provided address and deserializes - * the {@link Registry} from its data. - * - * @throws Error if no account info is found at the address or if deserialization fails - */ - static fromAccountAddress(connection, address, commitmentOrConfig) { - return __awaiter(this, void 0, void 0, function* () { - const accountInfo = yield connection.getAccountInfo(address, commitmentOrConfig); - if (accountInfo == null) { - throw new Error(`Unable to find Registry account at ${address}`); - } - return Registry.fromAccountInfo(accountInfo, 0)[0]; - }); - } - /** - * Provides a {@link web3.Connection.getProgramAccounts} config builder, - * to fetch accounts matching filters that can be specified via that builder. - * - * @param programId - the program that owns the accounts we are filtering - */ - static gpaBuilder(programId = new web3.PublicKey('WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n')) { - return beetSolana.GpaBuilder.fromStruct(programId, exports.registryBeet); - } - /** - * Deserializes the {@link Registry} from the provided data Buffer. - * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it. - */ - static deserialize(buf, offset = 0) { - return exports.registryBeet.deserialize(buf, offset); - } - /** - * Serializes the {@link Registry} into a Buffer. - * @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it. - */ - serialize() { - return exports.registryBeet.serialize(Object.assign({ accountDiscriminator: exports.registryDiscriminator }, this)); - } - /** - * Returns the byteSize of a {@link Buffer} holding the serialized data of - * {@link Registry} - */ - static get byteSize() { - return exports.registryBeet.byteSize; - } - /** - * Fetches the minimum balance needed to exempt an account holding - * {@link Registry} data from rent - * - * @param connection used to retrieve the rent exemption information - */ - static getMinimumBalanceForRentExemption(connection, commitment) { - return __awaiter(this, void 0, void 0, function* () { - return connection.getMinimumBalanceForRentExemption(Registry.byteSize, commitment); - }); - } - /** - * Determines if the provided {@link Buffer} has the correct byte size to - * hold {@link Registry} data. - */ - static hasCorrectByteSize(buf, offset = 0) { - return buf.byteLength - offset === Registry.byteSize; - } - /** - * Returns a readable version of {@link Registry} properties - * and can be used to convert to JSON and/or logging - */ - pretty() { - return { - worlds: (() => { - const x = this.worlds; - if (typeof x.toNumber === 'function') { - try { - return x.toNumber(); - } - catch (_) { - return x; - } - } - return x; - })(), - }; - } + constructor(worlds) { + this.worlds = worlds; + } + /** + * Creates a {@link Registry} instance from the provided args. + */ + static fromArgs(args) { + return new Registry(args.worlds); + } + /** + * Deserializes the {@link Registry} from the data of the provided {@link web3.AccountInfo}. + * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it. + */ + static fromAccountInfo(accountInfo, offset = 0) { + return Registry.deserialize(accountInfo.data, offset); + } + /** + * Retrieves the account info from the provided address and deserializes + * the {@link Registry} from its data. + * + * @throws Error if no account info is found at the address or if deserialization fails + */ + static fromAccountAddress(connection, address, commitmentOrConfig) { + return __awaiter(this, void 0, void 0, function* () { + const accountInfo = yield connection.getAccountInfo( + address, + commitmentOrConfig + ); + if (accountInfo == null) { + throw new Error(`Unable to find Registry account at ${address}`); + } + return Registry.fromAccountInfo(accountInfo, 0)[0]; + }); + } + /** + * Provides a {@link web3.Connection.getProgramAccounts} config builder, + * to fetch accounts matching filters that can be specified via that builder. + * + * @param programId - the program that owns the accounts we are filtering + */ + static gpaBuilder( + programId = new web3.PublicKey( + "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n" + ) + ) { + return beetSolana.GpaBuilder.fromStruct(programId, exports.registryBeet); + } + /** + * Deserializes the {@link Registry} from the provided data Buffer. + * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it. + */ + static deserialize(buf, offset = 0) { + return exports.registryBeet.deserialize(buf, offset); + } + /** + * Serializes the {@link Registry} into a Buffer. + * @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it. + */ + serialize() { + return exports.registryBeet.serialize( + Object.assign( + { accountDiscriminator: exports.registryDiscriminator }, + this + ) + ); + } + /** + * Returns the byteSize of a {@link Buffer} holding the serialized data of + * {@link Registry} + */ + static get byteSize() { + return exports.registryBeet.byteSize; + } + /** + * Fetches the minimum balance needed to exempt an account holding + * {@link Registry} data from rent + * + * @param connection used to retrieve the rent exemption information + */ + static getMinimumBalanceForRentExemption(connection, commitment) { + return __awaiter(this, void 0, void 0, function* () { + return connection.getMinimumBalanceForRentExemption( + Registry.byteSize, + commitment + ); + }); + } + /** + * Determines if the provided {@link Buffer} has the correct byte size to + * hold {@link Registry} data. + */ + static hasCorrectByteSize(buf, offset = 0) { + return buf.byteLength - offset === Registry.byteSize; + } + /** + * Returns a readable version of {@link Registry} properties + * and can be used to convert to JSON and/or logging + */ + pretty() { + return { + worlds: (() => { + const x = this.worlds; + if (typeof x.toNumber === "function") { + try { + return x.toNumber(); + } catch (_) { + return x; + } + } + return x; + })(), + }; + } } exports.Registry = Registry; /** * @category Accounts * @category generated */ -exports.registryBeet = new beet.BeetStruct([ - ['accountDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], - ['worlds', beet.u64], -], Registry.fromArgs, 'Registry'); +exports.registryBeet = new beet.BeetStruct( + [ + ["accountDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)], + ["worlds", beet.u64], + ], + Registry.fromArgs, + "Registry" +); diff --git a/clients/bolt-sdk/src/generated/accounts/World.js b/clients/bolt-sdk/src/generated/accounts/World.js index 851a184d..5450bb7a 100644 --- a/clients/bolt-sdk/src/generated/accounts/World.js +++ b/clients/bolt-sdk/src/generated/accounts/World.js @@ -5,38 +5,83 @@ * * See: https://github.com/metaplex-foundation/solita */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + }; +var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.worldBeet = exports.World = exports.worldDiscriminator = void 0; const beet = __importStar(require("@metaplex-foundation/beet")); @@ -51,126 +96,140 @@ exports.worldDiscriminator = [145, 45, 170, 174, 122, 32, 155, 124]; * @category generated */ class World { - constructor(id, entities) { - this.id = id; - this.entities = entities; - } - /** - * Creates a {@link World} instance from the provided args. - */ - static fromArgs(args) { - return new World(args.id, args.entities); - } - /** - * Deserializes the {@link World} from the data of the provided {@link web3.AccountInfo}. - * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it. - */ - static fromAccountInfo(accountInfo, offset = 0) { - return World.deserialize(accountInfo.data, offset); - } - /** - * Retrieves the account info from the provided address and deserializes - * the {@link World} from its data. - * - * @throws Error if no account info is found at the address or if deserialization fails - */ - static fromAccountAddress(connection, address, commitmentOrConfig) { - return __awaiter(this, void 0, void 0, function* () { - const accountInfo = yield connection.getAccountInfo(address, commitmentOrConfig); - if (accountInfo == null) { - throw new Error(`Unable to find World account at ${address}`); - } - return World.fromAccountInfo(accountInfo, 0)[0]; - }); - } - /** - * Provides a {@link web3.Connection.getProgramAccounts} config builder, - * to fetch accounts matching filters that can be specified via that builder. - * - * @param programId - the program that owns the accounts we are filtering - */ - static gpaBuilder(programId = new web3.PublicKey('WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n')) { - return beetSolana.GpaBuilder.fromStruct(programId, exports.worldBeet); - } - /** - * Deserializes the {@link World} from the provided data Buffer. - * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it. - */ - static deserialize(buf, offset = 0) { - return exports.worldBeet.deserialize(buf, offset); - } - /** - * Serializes the {@link World} into a Buffer. - * @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it. - */ - serialize() { - return exports.worldBeet.serialize(Object.assign({ accountDiscriminator: exports.worldDiscriminator }, this)); - } - /** - * Returns the byteSize of a {@link Buffer} holding the serialized data of - * {@link World} - */ - static get byteSize() { - return exports.worldBeet.byteSize; - } - /** - * Fetches the minimum balance needed to exempt an account holding - * {@link World} data from rent - * - * @param connection used to retrieve the rent exemption information - */ - static getMinimumBalanceForRentExemption(connection, commitment) { - return __awaiter(this, void 0, void 0, function* () { - return connection.getMinimumBalanceForRentExemption(World.byteSize, commitment); - }); - } - /** - * Determines if the provided {@link Buffer} has the correct byte size to - * hold {@link World} data. - */ - static hasCorrectByteSize(buf, offset = 0) { - return buf.byteLength - offset === World.byteSize; - } - /** - * Returns a readable version of {@link World} properties - * and can be used to convert to JSON and/or logging - */ - pretty() { - return { - id: (() => { - const x = this.id; - if (typeof x.toNumber === 'function') { - try { - return x.toNumber(); - } - catch (_) { - return x; - } - } - return x; - })(), - entities: (() => { - const x = this.entities; - if (typeof x.toNumber === 'function') { - try { - return x.toNumber(); - } - catch (_) { - return x; - } - } - return x; - })(), - }; - } + constructor(id, entities) { + this.id = id; + this.entities = entities; + } + /** + * Creates a {@link World} instance from the provided args. + */ + static fromArgs(args) { + return new World(args.id, args.entities); + } + /** + * Deserializes the {@link World} from the data of the provided {@link web3.AccountInfo}. + * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it. + */ + static fromAccountInfo(accountInfo, offset = 0) { + return World.deserialize(accountInfo.data, offset); + } + /** + * Retrieves the account info from the provided address and deserializes + * the {@link World} from its data. + * + * @throws Error if no account info is found at the address or if deserialization fails + */ + static fromAccountAddress(connection, address, commitmentOrConfig) { + return __awaiter(this, void 0, void 0, function* () { + const accountInfo = yield connection.getAccountInfo( + address, + commitmentOrConfig + ); + if (accountInfo == null) { + throw new Error(`Unable to find World account at ${address}`); + } + return World.fromAccountInfo(accountInfo, 0)[0]; + }); + } + /** + * Provides a {@link web3.Connection.getProgramAccounts} config builder, + * to fetch accounts matching filters that can be specified via that builder. + * + * @param programId - the program that owns the accounts we are filtering + */ + static gpaBuilder( + programId = new web3.PublicKey( + "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n" + ) + ) { + return beetSolana.GpaBuilder.fromStruct(programId, exports.worldBeet); + } + /** + * Deserializes the {@link World} from the provided data Buffer. + * @returns a tuple of the account data and the offset up to which the buffer was read to obtain it. + */ + static deserialize(buf, offset = 0) { + return exports.worldBeet.deserialize(buf, offset); + } + /** + * Serializes the {@link World} into a Buffer. + * @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it. + */ + serialize() { + return exports.worldBeet.serialize( + Object.assign({ accountDiscriminator: exports.worldDiscriminator }, this) + ); + } + /** + * Returns the byteSize of a {@link Buffer} holding the serialized data of + * {@link World} + */ + static get byteSize() { + return exports.worldBeet.byteSize; + } + /** + * Fetches the minimum balance needed to exempt an account holding + * {@link World} data from rent + * + * @param connection used to retrieve the rent exemption information + */ + static getMinimumBalanceForRentExemption(connection, commitment) { + return __awaiter(this, void 0, void 0, function* () { + return connection.getMinimumBalanceForRentExemption( + World.byteSize, + commitment + ); + }); + } + /** + * Determines if the provided {@link Buffer} has the correct byte size to + * hold {@link World} data. + */ + static hasCorrectByteSize(buf, offset = 0) { + return buf.byteLength - offset === World.byteSize; + } + /** + * Returns a readable version of {@link World} properties + * and can be used to convert to JSON and/or logging + */ + pretty() { + return { + id: (() => { + const x = this.id; + if (typeof x.toNumber === "function") { + try { + return x.toNumber(); + } catch (_) { + return x; + } + } + return x; + })(), + entities: (() => { + const x = this.entities; + if (typeof x.toNumber === "function") { + try { + return x.toNumber(); + } catch (_) { + return x; + } + } + return x; + })(), + }; + } } exports.World = World; /** * @category Accounts * @category generated */ -exports.worldBeet = new beet.BeetStruct([ - ['accountDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], - ['id', beet.u64], - ['entities', beet.u64], -], World.fromArgs, 'World'); +exports.worldBeet = new beet.BeetStruct( + [ + ["accountDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)], + ["id", beet.u64], + ["entities", beet.u64], + ], + World.fromArgs, + "World" +); diff --git a/clients/bolt-sdk/src/generated/accounts/index.js b/clients/bolt-sdk/src/generated/accounts/index.js index 9a0b4cae..dec86140 100644 --- a/clients/bolt-sdk/src/generated/accounts/index.js +++ b/clients/bolt-sdk/src/generated/accounts/index.js @@ -1,18 +1,34 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __exportStar = + (this && this.__exportStar) || + function (m, exports) { + for (var p in m) + if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) + __createBinding(exports, m, p); + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.accountProviders = void 0; __exportStar(require("./Entity"), exports); @@ -21,4 +37,8 @@ __exportStar(require("./World"), exports); const Registry_1 = require("./Registry"); const World_1 = require("./World"); const Entity_1 = require("./Entity"); -exports.accountProviders = { Registry: Registry_1.Registry, World: World_1.World, Entity: Entity_1.Entity }; +exports.accountProviders = { + Registry: Registry_1.Registry, + World: World_1.World, + Entity: Entity_1.Entity, +}; diff --git a/clients/bolt-sdk/src/generated/index.js b/clients/bolt-sdk/src/generated/index.js index eca37145..58997c32 100644 --- a/clients/bolt-sdk/src/generated/index.js +++ b/clients/bolt-sdk/src/generated/index.js @@ -1,18 +1,34 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __exportStar = + (this && this.__exportStar) || + function (m, exports) { + for (var p in m) + if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) + __createBinding(exports, m, p); + }; Object.defineProperty(exports, "__esModule", { value: true }); exports.PROGRAM_ID = exports.PROGRAM_ADDRESS = void 0; const web3_js_1 = require("@solana/web3.js"); @@ -24,7 +40,7 @@ __exportStar(require("./instructions"), exports); * @category constants * @category generated */ -exports.PROGRAM_ADDRESS = 'WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n'; +exports.PROGRAM_ADDRESS = "WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n"; /** * Program public key * diff --git a/clients/bolt-sdk/src/generated/instructions/addEntity.js b/clients/bolt-sdk/src/generated/instructions/addEntity.js index d778f399..4d3c1b80 100644 --- a/clients/bolt-sdk/src/generated/instructions/addEntity.js +++ b/clients/bolt-sdk/src/generated/instructions/addEntity.js @@ -5,31 +5,55 @@ * * See: https://github.com/metaplex-foundation/solita */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.createAddEntityInstruction = exports.addEntityInstructionDiscriminator = exports.addEntityStruct = void 0; +exports.createAddEntityInstruction = + exports.addEntityInstructionDiscriminator = + exports.addEntityStruct = + void 0; const beet = __importStar(require("@metaplex-foundation/beet")); const web3 = __importStar(require("@solana/web3.js")); /** @@ -37,9 +61,12 @@ const web3 = __importStar(require("@solana/web3.js")); * @category AddEntity * @category generated */ -exports.addEntityStruct = new beet.BeetArgsStruct([['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)]], 'AddEntityInstructionArgs'); +exports.addEntityStruct = new beet.BeetArgsStruct( + [["instructionDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)]], + "AddEntityInstructionArgs" +); exports.addEntityInstructionDiscriminator = [ - 163, 241, 57, 35, 244, 244, 48, 57, + 163, 241, 57, 35, 244, 244, 48, 57, ]; /** * Creates a _AddEntity_ instruction. @@ -49,43 +76,49 @@ exports.addEntityInstructionDiscriminator = [ * @category AddEntity * @category generated */ -function createAddEntityInstruction(accounts, programId = new web3.PublicKey('WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n')) { - var _a; - const [data] = exports.addEntityStruct.serialize({ - instructionDiscriminator: exports.addEntityInstructionDiscriminator, - }); - const keys = [ - { - pubkey: accounts.payer, - isWritable: true, - isSigner: true, - }, - { - pubkey: accounts.entity, - isWritable: true, - isSigner: false, - }, - { - pubkey: accounts.world, - isWritable: true, - isSigner: false, - }, - { - pubkey: (_a = accounts.systemProgram) !== null && _a !== void 0 ? _a : web3.SystemProgram.programId, - isWritable: false, - isSigner: false, - }, - ]; - if (accounts.anchorRemainingAccounts != null) { - for (const acc of accounts.anchorRemainingAccounts) { - keys.push(acc); - } +function createAddEntityInstruction( + accounts, + programId = new web3.PublicKey("WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n") +) { + var _a; + const [data] = exports.addEntityStruct.serialize({ + instructionDiscriminator: exports.addEntityInstructionDiscriminator, + }); + const keys = [ + { + pubkey: accounts.payer, + isWritable: true, + isSigner: true, + }, + { + pubkey: accounts.entity, + isWritable: true, + isSigner: false, + }, + { + pubkey: accounts.world, + isWritable: true, + isSigner: false, + }, + { + pubkey: + (_a = accounts.systemProgram) !== null && _a !== void 0 + ? _a + : web3.SystemProgram.programId, + isWritable: false, + isSigner: false, + }, + ]; + if (accounts.anchorRemainingAccounts != null) { + for (const acc of accounts.anchorRemainingAccounts) { + keys.push(acc); } - const ix = new web3.TransactionInstruction({ - programId, - keys, - data, - }); - return ix; + } + const ix = new web3.TransactionInstruction({ + programId, + keys, + data, + }); + return ix; } exports.createAddEntityInstruction = createAddEntityInstruction; diff --git a/clients/bolt-sdk/src/generated/instructions/apply.js b/clients/bolt-sdk/src/generated/instructions/apply.js index 8d70c867..f4a3b17e 100644 --- a/clients/bolt-sdk/src/generated/instructions/apply.js +++ b/clients/bolt-sdk/src/generated/instructions/apply.js @@ -5,31 +5,55 @@ * * See: https://github.com/metaplex-foundation/solita */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.createApplyInstruction = exports.applyInstructionDiscriminator = exports.applyStruct = void 0; +exports.createApplyInstruction = + exports.applyInstructionDiscriminator = + exports.applyStruct = + void 0; const beet = __importStar(require("@metaplex-foundation/beet")); const web3 = __importStar(require("@solana/web3.js")); /** @@ -37,13 +61,14 @@ const web3 = __importStar(require("@solana/web3.js")); * @category Apply * @category generated */ -exports.applyStruct = new beet.FixableBeetArgsStruct([ - ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], - ['args', beet.bytes], -], 'ApplyInstructionArgs'); -exports.applyInstructionDiscriminator = [ - 248, 243, 145, 24, 105, 50, 162, 225, -]; +exports.applyStruct = new beet.FixableBeetArgsStruct( + [ + ["instructionDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)], + ["args", beet.bytes], + ], + "ApplyInstructionArgs" +); +exports.applyInstructionDiscriminator = [248, 243, 145, 24, 105, 50, 162, 225]; /** * Creates a _Apply_ instruction. * @@ -54,35 +79,44 @@ exports.applyInstructionDiscriminator = [ * @category Apply * @category generated */ -function createApplyInstruction(accounts, args, programId = new web3.PublicKey('WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n')) { - const [data] = exports.applyStruct.serialize(Object.assign({ instructionDiscriminator: exports.applyInstructionDiscriminator }, args)); - const keys = [ - { - pubkey: accounts.componentProgram, - isWritable: false, - isSigner: false, - }, - { - pubkey: accounts.boltSystem, - isWritable: false, - isSigner: false, - }, - { - pubkey: accounts.boltComponent, - isWritable: true, - isSigner: false, - }, - ]; - if (accounts.anchorRemainingAccounts != null) { - for (const acc of accounts.anchorRemainingAccounts) { - keys.push(acc); - } +function createApplyInstruction( + accounts, + args, + programId = new web3.PublicKey("WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n") +) { + const [data] = exports.applyStruct.serialize( + Object.assign( + { instructionDiscriminator: exports.applyInstructionDiscriminator }, + args + ) + ); + const keys = [ + { + pubkey: accounts.componentProgram, + isWritable: false, + isSigner: false, + }, + { + pubkey: accounts.boltSystem, + isWritable: false, + isSigner: false, + }, + { + pubkey: accounts.boltComponent, + isWritable: true, + isSigner: false, + }, + ]; + if (accounts.anchorRemainingAccounts != null) { + for (const acc of accounts.anchorRemainingAccounts) { + keys.push(acc); } - const ix = new web3.TransactionInstruction({ - programId, - keys, - data, - }); - return ix; + } + const ix = new web3.TransactionInstruction({ + programId, + keys, + data, + }); + return ix; } exports.createApplyInstruction = createApplyInstruction; diff --git a/clients/bolt-sdk/src/generated/instructions/apply2.js b/clients/bolt-sdk/src/generated/instructions/apply2.js index 1d3fcfcf..1c45aadb 100644 --- a/clients/bolt-sdk/src/generated/instructions/apply2.js +++ b/clients/bolt-sdk/src/generated/instructions/apply2.js @@ -5,31 +5,55 @@ * * See: https://github.com/metaplex-foundation/solita */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.createApply2Instruction = exports.apply2InstructionDiscriminator = exports.apply2Struct = void 0; +exports.createApply2Instruction = + exports.apply2InstructionDiscriminator = + exports.apply2Struct = + void 0; const beet = __importStar(require("@metaplex-foundation/beet")); const web3 = __importStar(require("@solana/web3.js")); /** @@ -37,13 +61,14 @@ const web3 = __importStar(require("@solana/web3.js")); * @category Apply2 * @category generated */ -exports.apply2Struct = new beet.FixableBeetArgsStruct([ - ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], - ['args', beet.bytes], -], 'Apply2InstructionArgs'); -exports.apply2InstructionDiscriminator = [ - 120, 32, 116, 154, 158, 159, 208, 73, -]; +exports.apply2Struct = new beet.FixableBeetArgsStruct( + [ + ["instructionDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)], + ["args", beet.bytes], + ], + "Apply2InstructionArgs" +); +exports.apply2InstructionDiscriminator = [120, 32, 116, 154, 158, 159, 208, 73]; /** * Creates a _Apply2_ instruction. * @@ -54,45 +79,54 @@ exports.apply2InstructionDiscriminator = [ * @category Apply2 * @category generated */ -function createApply2Instruction(accounts, args, programId = new web3.PublicKey('WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n')) { - const [data] = exports.apply2Struct.serialize(Object.assign({ instructionDiscriminator: exports.apply2InstructionDiscriminator }, args)); - const keys = [ - { - pubkey: accounts.boltSystem, - isWritable: false, - isSigner: false, - }, - { - pubkey: accounts.componentProgram1, - isWritable: false, - isSigner: false, - }, - { - pubkey: accounts.boltComponent1, - isWritable: true, - isSigner: false, - }, - { - pubkey: accounts.componentProgram2, - isWritable: false, - isSigner: false, - }, - { - pubkey: accounts.boltComponent2, - isWritable: true, - isSigner: false, - }, - ]; - if (accounts.anchorRemainingAccounts != null) { - for (const acc of accounts.anchorRemainingAccounts) { - keys.push(acc); - } +function createApply2Instruction( + accounts, + args, + programId = new web3.PublicKey("WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n") +) { + const [data] = exports.apply2Struct.serialize( + Object.assign( + { instructionDiscriminator: exports.apply2InstructionDiscriminator }, + args + ) + ); + const keys = [ + { + pubkey: accounts.boltSystem, + isWritable: false, + isSigner: false, + }, + { + pubkey: accounts.componentProgram1, + isWritable: false, + isSigner: false, + }, + { + pubkey: accounts.boltComponent1, + isWritable: true, + isSigner: false, + }, + { + pubkey: accounts.componentProgram2, + isWritable: false, + isSigner: false, + }, + { + pubkey: accounts.boltComponent2, + isWritable: true, + isSigner: false, + }, + ]; + if (accounts.anchorRemainingAccounts != null) { + for (const acc of accounts.anchorRemainingAccounts) { + keys.push(acc); } - const ix = new web3.TransactionInstruction({ - programId, - keys, - data, - }); - return ix; + } + const ix = new web3.TransactionInstruction({ + programId, + keys, + data, + }); + return ix; } exports.createApply2Instruction = createApply2Instruction; diff --git a/clients/bolt-sdk/src/generated/instructions/apply3.js b/clients/bolt-sdk/src/generated/instructions/apply3.js index 3206b0e1..e35da36c 100644 --- a/clients/bolt-sdk/src/generated/instructions/apply3.js +++ b/clients/bolt-sdk/src/generated/instructions/apply3.js @@ -5,31 +5,55 @@ * * See: https://github.com/metaplex-foundation/solita */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.createApply3Instruction = exports.apply3InstructionDiscriminator = exports.apply3Struct = void 0; +exports.createApply3Instruction = + exports.apply3InstructionDiscriminator = + exports.apply3Struct = + void 0; const beet = __importStar(require("@metaplex-foundation/beet")); const web3 = __importStar(require("@solana/web3.js")); /** @@ -37,13 +61,14 @@ const web3 = __importStar(require("@solana/web3.js")); * @category Apply3 * @category generated */ -exports.apply3Struct = new beet.FixableBeetArgsStruct([ - ['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)], - ['args', beet.bytes], -], 'Apply3InstructionArgs'); -exports.apply3InstructionDiscriminator = [ - 254, 146, 49, 7, 236, 131, 105, 221, -]; +exports.apply3Struct = new beet.FixableBeetArgsStruct( + [ + ["instructionDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)], + ["args", beet.bytes], + ], + "Apply3InstructionArgs" +); +exports.apply3InstructionDiscriminator = [254, 146, 49, 7, 236, 131, 105, 221]; /** * Creates a _Apply3_ instruction. * @@ -54,55 +79,64 @@ exports.apply3InstructionDiscriminator = [ * @category Apply3 * @category generated */ -function createApply3Instruction(accounts, args, programId = new web3.PublicKey('WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n')) { - const [data] = exports.apply3Struct.serialize(Object.assign({ instructionDiscriminator: exports.apply3InstructionDiscriminator }, args)); - const keys = [ - { - pubkey: accounts.boltSystem, - isWritable: false, - isSigner: false, - }, - { - pubkey: accounts.componentProgram1, - isWritable: false, - isSigner: false, - }, - { - pubkey: accounts.boltComponent1, - isWritable: true, - isSigner: false, - }, - { - pubkey: accounts.componentProgram2, - isWritable: false, - isSigner: false, - }, - { - pubkey: accounts.boltComponent2, - isWritable: true, - isSigner: false, - }, - { - pubkey: accounts.componentProgram3, - isWritable: false, - isSigner: false, - }, - { - pubkey: accounts.boltComponent3, - isWritable: true, - isSigner: false, - }, - ]; - if (accounts.anchorRemainingAccounts != null) { - for (const acc of accounts.anchorRemainingAccounts) { - keys.push(acc); - } +function createApply3Instruction( + accounts, + args, + programId = new web3.PublicKey("WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n") +) { + const [data] = exports.apply3Struct.serialize( + Object.assign( + { instructionDiscriminator: exports.apply3InstructionDiscriminator }, + args + ) + ); + const keys = [ + { + pubkey: accounts.boltSystem, + isWritable: false, + isSigner: false, + }, + { + pubkey: accounts.componentProgram1, + isWritable: false, + isSigner: false, + }, + { + pubkey: accounts.boltComponent1, + isWritable: true, + isSigner: false, + }, + { + pubkey: accounts.componentProgram2, + isWritable: false, + isSigner: false, + }, + { + pubkey: accounts.boltComponent2, + isWritable: true, + isSigner: false, + }, + { + pubkey: accounts.componentProgram3, + isWritable: false, + isSigner: false, + }, + { + pubkey: accounts.boltComponent3, + isWritable: true, + isSigner: false, + }, + ]; + if (accounts.anchorRemainingAccounts != null) { + for (const acc of accounts.anchorRemainingAccounts) { + keys.push(acc); } - const ix = new web3.TransactionInstruction({ - programId, - keys, - data, - }); - return ix; + } + const ix = new web3.TransactionInstruction({ + programId, + keys, + data, + }); + return ix; } exports.createApply3Instruction = createApply3Instruction; diff --git a/clients/bolt-sdk/src/generated/instructions/index.js b/clients/bolt-sdk/src/generated/instructions/index.js index 2efdb971..43a8c798 100644 --- a/clients/bolt-sdk/src/generated/instructions/index.js +++ b/clients/bolt-sdk/src/generated/instructions/index.js @@ -1,18 +1,34 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __exportStar = + (this && this.__exportStar) || + function (m, exports) { + for (var p in m) + if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) + __createBinding(exports, m, p); + }; Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./addEntity"), exports); __exportStar(require("./apply"), exports); diff --git a/clients/bolt-sdk/src/generated/instructions/initializeComponent.js b/clients/bolt-sdk/src/generated/instructions/initializeComponent.js index f385575d..46adf68d 100644 --- a/clients/bolt-sdk/src/generated/instructions/initializeComponent.js +++ b/clients/bolt-sdk/src/generated/instructions/initializeComponent.js @@ -5,31 +5,55 @@ * * See: https://github.com/metaplex-foundation/solita */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.createInitializeComponentInstruction = exports.initializeComponentInstructionDiscriminator = exports.initializeComponentStruct = void 0; +exports.createInitializeComponentInstruction = + exports.initializeComponentInstructionDiscriminator = + exports.initializeComponentStruct = + void 0; const beet = __importStar(require("@metaplex-foundation/beet")); const web3 = __importStar(require("@solana/web3.js")); /** @@ -37,9 +61,12 @@ const web3 = __importStar(require("@solana/web3.js")); * @category InitializeComponent * @category generated */ -exports.initializeComponentStruct = new beet.BeetArgsStruct([['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)]], 'InitializeComponentInstructionArgs'); +exports.initializeComponentStruct = new beet.BeetArgsStruct( + [["instructionDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)]], + "InitializeComponentInstructionArgs" +); exports.initializeComponentInstructionDiscriminator = [ - 36, 143, 233, 113, 12, 234, 61, 30, + 36, 143, 233, 113, 12, 234, 61, 30, ]; /** * Creates a _InitializeComponent_ instruction. @@ -49,48 +76,56 @@ exports.initializeComponentInstructionDiscriminator = [ * @category InitializeComponent * @category generated */ -function createInitializeComponentInstruction(accounts, programId = new web3.PublicKey('WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n')) { - var _a; - const [data] = exports.initializeComponentStruct.serialize({ - instructionDiscriminator: exports.initializeComponentInstructionDiscriminator, - }); - const keys = [ - { - pubkey: accounts.payer, - isWritable: true, - isSigner: true, - }, - { - pubkey: accounts.data, - isWritable: true, - isSigner: false, - }, - { - pubkey: accounts.entity, - isWritable: false, - isSigner: false, - }, - { - pubkey: accounts.componentProgram, - isWritable: false, - isSigner: false, - }, - { - pubkey: (_a = accounts.systemProgram) !== null && _a !== void 0 ? _a : web3.SystemProgram.programId, - isWritable: false, - isSigner: false, - }, - ]; - if (accounts.anchorRemainingAccounts != null) { - for (const acc of accounts.anchorRemainingAccounts) { - keys.push(acc); - } +function createInitializeComponentInstruction( + accounts, + programId = new web3.PublicKey("WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n") +) { + var _a; + const [data] = exports.initializeComponentStruct.serialize({ + instructionDiscriminator: + exports.initializeComponentInstructionDiscriminator, + }); + const keys = [ + { + pubkey: accounts.payer, + isWritable: true, + isSigner: true, + }, + { + pubkey: accounts.data, + isWritable: true, + isSigner: false, + }, + { + pubkey: accounts.entity, + isWritable: false, + isSigner: false, + }, + { + pubkey: accounts.componentProgram, + isWritable: false, + isSigner: false, + }, + { + pubkey: + (_a = accounts.systemProgram) !== null && _a !== void 0 + ? _a + : web3.SystemProgram.programId, + isWritable: false, + isSigner: false, + }, + ]; + if (accounts.anchorRemainingAccounts != null) { + for (const acc of accounts.anchorRemainingAccounts) { + keys.push(acc); } - const ix = new web3.TransactionInstruction({ - programId, - keys, - data, - }); - return ix; + } + const ix = new web3.TransactionInstruction({ + programId, + keys, + data, + }); + return ix; } -exports.createInitializeComponentInstruction = createInitializeComponentInstruction; +exports.createInitializeComponentInstruction = + createInitializeComponentInstruction; diff --git a/clients/bolt-sdk/src/generated/instructions/initializeNewWorld.js b/clients/bolt-sdk/src/generated/instructions/initializeNewWorld.js index 2e088651..6b9c025e 100644 --- a/clients/bolt-sdk/src/generated/instructions/initializeNewWorld.js +++ b/clients/bolt-sdk/src/generated/instructions/initializeNewWorld.js @@ -5,31 +5,55 @@ * * See: https://github.com/metaplex-foundation/solita */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.createInitializeNewWorldInstruction = exports.initializeNewWorldInstructionDiscriminator = exports.initializeNewWorldStruct = void 0; +exports.createInitializeNewWorldInstruction = + exports.initializeNewWorldInstructionDiscriminator = + exports.initializeNewWorldStruct = + void 0; const beet = __importStar(require("@metaplex-foundation/beet")); const web3 = __importStar(require("@solana/web3.js")); /** @@ -37,9 +61,12 @@ const web3 = __importStar(require("@solana/web3.js")); * @category InitializeNewWorld * @category generated */ -exports.initializeNewWorldStruct = new beet.BeetArgsStruct([['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)]], 'InitializeNewWorldInstructionArgs'); +exports.initializeNewWorldStruct = new beet.BeetArgsStruct( + [["instructionDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)]], + "InitializeNewWorldInstructionArgs" +); exports.initializeNewWorldInstructionDiscriminator = [ - 23, 96, 88, 194, 200, 203, 200, 98, + 23, 96, 88, 194, 200, 203, 200, 98, ]; /** * Creates a _InitializeNewWorld_ instruction. @@ -49,43 +76,51 @@ exports.initializeNewWorldInstructionDiscriminator = [ * @category InitializeNewWorld * @category generated */ -function createInitializeNewWorldInstruction(accounts, programId = new web3.PublicKey('WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n')) { - var _a; - const [data] = exports.initializeNewWorldStruct.serialize({ - instructionDiscriminator: exports.initializeNewWorldInstructionDiscriminator, - }); - const keys = [ - { - pubkey: accounts.payer, - isWritable: true, - isSigner: true, - }, - { - pubkey: accounts.world, - isWritable: true, - isSigner: false, - }, - { - pubkey: accounts.registry, - isWritable: true, - isSigner: false, - }, - { - pubkey: (_a = accounts.systemProgram) !== null && _a !== void 0 ? _a : web3.SystemProgram.programId, - isWritable: false, - isSigner: false, - }, - ]; - if (accounts.anchorRemainingAccounts != null) { - for (const acc of accounts.anchorRemainingAccounts) { - keys.push(acc); - } +function createInitializeNewWorldInstruction( + accounts, + programId = new web3.PublicKey("WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n") +) { + var _a; + const [data] = exports.initializeNewWorldStruct.serialize({ + instructionDiscriminator: + exports.initializeNewWorldInstructionDiscriminator, + }); + const keys = [ + { + pubkey: accounts.payer, + isWritable: true, + isSigner: true, + }, + { + pubkey: accounts.world, + isWritable: true, + isSigner: false, + }, + { + pubkey: accounts.registry, + isWritable: true, + isSigner: false, + }, + { + pubkey: + (_a = accounts.systemProgram) !== null && _a !== void 0 + ? _a + : web3.SystemProgram.programId, + isWritable: false, + isSigner: false, + }, + ]; + if (accounts.anchorRemainingAccounts != null) { + for (const acc of accounts.anchorRemainingAccounts) { + keys.push(acc); } - const ix = new web3.TransactionInstruction({ - programId, - keys, - data, - }); - return ix; + } + const ix = new web3.TransactionInstruction({ + programId, + keys, + data, + }); + return ix; } -exports.createInitializeNewWorldInstruction = createInitializeNewWorldInstruction; +exports.createInitializeNewWorldInstruction = + createInitializeNewWorldInstruction; diff --git a/clients/bolt-sdk/src/generated/instructions/initializeRegistry.js b/clients/bolt-sdk/src/generated/instructions/initializeRegistry.js index 98d8f60f..2608f08d 100644 --- a/clients/bolt-sdk/src/generated/instructions/initializeRegistry.js +++ b/clients/bolt-sdk/src/generated/instructions/initializeRegistry.js @@ -5,31 +5,55 @@ * * See: https://github.com/metaplex-foundation/solita */ -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; + }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.createInitializeRegistryInstruction = exports.initializeRegistryInstructionDiscriminator = exports.initializeRegistryStruct = void 0; +exports.createInitializeRegistryInstruction = + exports.initializeRegistryInstructionDiscriminator = + exports.initializeRegistryStruct = + void 0; const beet = __importStar(require("@metaplex-foundation/beet")); const web3 = __importStar(require("@solana/web3.js")); /** @@ -37,9 +61,12 @@ const web3 = __importStar(require("@solana/web3.js")); * @category InitializeRegistry * @category generated */ -exports.initializeRegistryStruct = new beet.BeetArgsStruct([['instructionDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)]], 'InitializeRegistryInstructionArgs'); +exports.initializeRegistryStruct = new beet.BeetArgsStruct( + [["instructionDiscriminator", beet.uniformFixedSizeArray(beet.u8, 8)]], + "InitializeRegistryInstructionArgs" +); exports.initializeRegistryInstructionDiscriminator = [ - 189, 181, 20, 17, 174, 57, 249, 59, + 189, 181, 20, 17, 174, 57, 249, 59, ]; /** * Creates a _InitializeRegistry_ instruction. @@ -49,38 +76,46 @@ exports.initializeRegistryInstructionDiscriminator = [ * @category InitializeRegistry * @category generated */ -function createInitializeRegistryInstruction(accounts, programId = new web3.PublicKey('WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n')) { - var _a; - const [data] = exports.initializeRegistryStruct.serialize({ - instructionDiscriminator: exports.initializeRegistryInstructionDiscriminator, - }); - const keys = [ - { - pubkey: accounts.registry, - isWritable: true, - isSigner: false, - }, - { - pubkey: accounts.payer, - isWritable: true, - isSigner: true, - }, - { - pubkey: (_a = accounts.systemProgram) !== null && _a !== void 0 ? _a : web3.SystemProgram.programId, - isWritable: false, - isSigner: false, - }, - ]; - if (accounts.anchorRemainingAccounts != null) { - for (const acc of accounts.anchorRemainingAccounts) { - keys.push(acc); - } +function createInitializeRegistryInstruction( + accounts, + programId = new web3.PublicKey("WorLD15A7CrDwLcLy4fRqtaTb9fbd8o8iqiEMUDse2n") +) { + var _a; + const [data] = exports.initializeRegistryStruct.serialize({ + instructionDiscriminator: + exports.initializeRegistryInstructionDiscriminator, + }); + const keys = [ + { + pubkey: accounts.registry, + isWritable: true, + isSigner: false, + }, + { + pubkey: accounts.payer, + isWritable: true, + isSigner: true, + }, + { + pubkey: + (_a = accounts.systemProgram) !== null && _a !== void 0 + ? _a + : web3.SystemProgram.programId, + isWritable: false, + isSigner: false, + }, + ]; + if (accounts.anchorRemainingAccounts != null) { + for (const acc of accounts.anchorRemainingAccounts) { + keys.push(acc); } - const ix = new web3.TransactionInstruction({ - programId, - keys, - data, - }); - return ix; + } + const ix = new web3.TransactionInstruction({ + programId, + keys, + data, + }); + return ix; } -exports.createInitializeRegistryInstruction = createInitializeRegistryInstruction; +exports.createInitializeRegistryInstruction = + createInitializeRegistryInstruction; diff --git a/migrations/deploy.js b/migrations/deploy.js index 4a337d26..933d4a08 100644 --- a/migrations/deploy.js +++ b/migrations/deploy.js @@ -1,20 +1,44 @@ // Migrations are an early feature. Currently, they're nothing more than this // single deploy script that's invoked from the CLI, injecting a provider // configured from the workspace's Anchor.toml. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } +var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); -}; + }; const anchor = require("@coral-xyz/anchor"); module.exports = function (provider) { - return __awaiter(this, void 0, void 0, function* () { - // Configure client to use the provider. - anchor.setProvider(provider); - // Add your deploy script here. - }); + return __awaiter(this, void 0, void 0, function* () { + // Configure client to use the provider. + anchor.setProvider(provider); + // Add your deploy script here. + }); }; diff --git a/tests/bolt.js b/tests/bolt.js index a273ec5c..41b1a955 100644 --- a/tests/bolt.js +++ b/tests/bolt.js @@ -1,39 +1,86 @@ "use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if ( + !desc || + ("get" in desc ? !m.__esModule : desc.writable || desc.configurable) + ) { + desc = { + enumerable: true, + get: function () { + return m[k]; + }, + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); + } + : function (o, v) { + o["default"] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) + for (var k in mod) + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + }; +var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done + ? resolve(result.value) + : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; + }; +var __importDefault = + (this && this.__importDefault) || + function (mod) { + return mod && mod.__esModule ? mod : { default: mod }; + }; Object.defineProperty(exports, "__esModule", { value: true }); const anchor = __importStar(require("@coral-xyz/anchor")); const web3_js_1 = require("@solana/web3.js"); @@ -41,323 +88,428 @@ const chai_1 = require("chai"); const bn_js_1 = __importDefault(require("bn.js")); var Direction; (function (Direction) { - Direction["Left"] = "Left"; - Direction["Right"] = "Right"; - Direction["Up"] = "Up"; - Direction["Down"] = "Down"; + Direction["Left"] = "Left"; + Direction["Right"] = "Right"; + Direction["Up"] = "Up"; + Direction["Down"] = "Down"; })(Direction || (Direction = {})); function serializeArgs(args = {}) { - const jsonString = JSON.stringify(args); - const encoder = new TextEncoder(); - const binaryData = encoder.encode(jsonString); - return Buffer.from(binaryData.buffer, binaryData.byteOffset, binaryData.byteLength); + const jsonString = JSON.stringify(args); + const encoder = new TextEncoder(); + const binaryData = encoder.encode(jsonString); + return Buffer.from( + binaryData.buffer, + binaryData.byteOffset, + binaryData.byteLength + ); } describe("bolt", () => { - const provider = anchor.AnchorProvider.env(); - anchor.setProvider(provider); - const worldProgram = anchor.workspace.World; - const boltComponentPositionProgram = anchor.workspace - .ComponentPosition; - const boltComponentVelocityProgram = anchor.workspace - .ComponentVelocity; - const boltComponentProgramOrigin = anchor.workspace - .BoltComponent; - const systemSimpleMovement = anchor.workspace.SystemSimpleMovement.programId; - const systemFly = anchor.workspace.SystemFly - .programId; - const applyVelocity = anchor.workspace.SystemApplyVelocity.programId; - let entity1; - let entity2; - let componentPositionEntity1; - let componentPositionEntity2; - let componentVelocityEntity1; - it("InitializeWorldsRegistry", () => __awaiter(void 0, void 0, void 0, function* () { - const registryPda = FindWorldRegistryPda(worldProgram); - yield worldProgram.methods - .initializeRegistry() - .accounts({ - registry: registryPda, - payer: provider.wallet.publicKey, + const provider = anchor.AnchorProvider.env(); + anchor.setProvider(provider); + const worldProgram = anchor.workspace.World; + const boltComponentPositionProgram = anchor.workspace.ComponentPosition; + const boltComponentVelocityProgram = anchor.workspace.ComponentVelocity; + const boltComponentProgramOrigin = anchor.workspace.BoltComponent; + const systemSimpleMovement = anchor.workspace.SystemSimpleMovement.programId; + const systemFly = anchor.workspace.SystemFly.programId; + const applyVelocity = anchor.workspace.SystemApplyVelocity.programId; + let entity1; + let entity2; + let componentPositionEntity1; + let componentPositionEntity2; + let componentVelocityEntity1; + it("InitializeWorldsRegistry", () => + __awaiter(void 0, void 0, void 0, function* () { + const registryPda = FindWorldRegistryPda(worldProgram); + yield worldProgram.methods + .initializeRegistry() + .accounts({ + registry: registryPda, + payer: provider.wallet.publicKey, }) - .rpc(); + .rpc(); })); - it("InitializeNewWorld", () => __awaiter(void 0, void 0, void 0, function* () { - const registryPda = FindWorldRegistryPda(worldProgram); - const worldPda = FindWorldPda(worldProgram, new bn_js_1.default(0)); - yield worldProgram.methods - .initializeNewWorld() - .accounts({ - world: worldPda, - registry: registryPda, - payer: provider.wallet.publicKey, + it("InitializeNewWorld", () => + __awaiter(void 0, void 0, void 0, function* () { + const registryPda = FindWorldRegistryPda(worldProgram); + const worldPda = FindWorldPda(worldProgram, new bn_js_1.default(0)); + yield worldProgram.methods + .initializeNewWorld() + .accounts({ + world: worldPda, + registry: registryPda, + payer: provider.wallet.publicKey, }) - .rpc(); + .rpc(); })); - it("Add entity 1", () => __awaiter(void 0, void 0, void 0, function* () { - const worldPda = FindWorldPda(worldProgram, new bn_js_1.default(0)); - entity1 = FindEntityPda(worldProgram, new bn_js_1.default(0), new bn_js_1.default(0)); - yield worldProgram.methods - .addEntity() - .accounts({ - world: worldPda, - entity: entity1, - payer: provider.wallet.publicKey, + it("Add entity 1", () => + __awaiter(void 0, void 0, void 0, function* () { + const worldPda = FindWorldPda(worldProgram, new bn_js_1.default(0)); + entity1 = FindEntityPda( + worldProgram, + new bn_js_1.default(0), + new bn_js_1.default(0) + ); + yield worldProgram.methods + .addEntity() + .accounts({ + world: worldPda, + entity: entity1, + payer: provider.wallet.publicKey, }) - .rpc(); + .rpc(); })); - it("Add entity 2", () => __awaiter(void 0, void 0, void 0, function* () { - const worldPda = FindWorldPda(worldProgram, new bn_js_1.default(0)); - entity2 = FindEntityPda(worldProgram, new bn_js_1.default(0), new bn_js_1.default(1)); - yield worldProgram.methods - .addEntity() - .accounts({ - world: worldPda, - entity: entity2, - payer: provider.wallet.publicKey, + it("Add entity 2", () => + __awaiter(void 0, void 0, void 0, function* () { + const worldPda = FindWorldPda(worldProgram, new bn_js_1.default(0)); + entity2 = FindEntityPda( + worldProgram, + new bn_js_1.default(0), + new bn_js_1.default(1) + ); + yield worldProgram.methods + .addEntity() + .accounts({ + world: worldPda, + entity: entity2, + payer: provider.wallet.publicKey, }) - .rpc(); + .rpc(); })); - it("Add entity 3", () => __awaiter(void 0, void 0, void 0, function* () { - const worldPda = FindWorldPda(worldProgram, new bn_js_1.default(0)); - const entityPda = FindEntityPda(worldProgram, new bn_js_1.default(0), new bn_js_1.default(2)); - yield worldProgram.methods - .addEntity() - .accounts({ - world: worldPda, - entity: entityPda, - payer: provider.wallet.publicKey, + it("Add entity 3", () => + __awaiter(void 0, void 0, void 0, function* () { + const worldPda = FindWorldPda(worldProgram, new bn_js_1.default(0)); + const entityPda = FindEntityPda( + worldProgram, + new bn_js_1.default(0), + new bn_js_1.default(2) + ); + yield worldProgram.methods + .addEntity() + .accounts({ + world: worldPda, + entity: entityPda, + payer: provider.wallet.publicKey, }) - .rpc(); + .rpc(); })); - it("Initialize Original Component on Entity 1, trough the world instance", () => __awaiter(void 0, void 0, void 0, function* () { - let componentEntity1 = FindComponentPda(boltComponentProgramOrigin.programId, entity1, "origin-component"); - yield worldProgram.methods - .initializeComponent() - .accounts({ - payer: provider.wallet.publicKey, - data: componentEntity1, - componentProgram: boltComponentProgramOrigin.programId, - entity: entity1, + it("Initialize Original Component on Entity 1, trough the world instance", () => + __awaiter(void 0, void 0, void 0, function* () { + let componentEntity1 = FindComponentPda( + boltComponentProgramOrigin.programId, + entity1, + "origin-component" + ); + yield worldProgram.methods + .initializeComponent() + .accounts({ + payer: provider.wallet.publicKey, + data: componentEntity1, + componentProgram: boltComponentProgramOrigin.programId, + entity: entity1, }) - .rpc(); + .rpc(); })); - it("Initialize Original Component on Entity 2, trough the world instance", () => __awaiter(void 0, void 0, void 0, function* () { - let componentEntity2 = FindComponentPda(boltComponentProgramOrigin.programId, entity2, "origin-component"); - yield worldProgram.methods - .initializeComponent() - .accounts({ - payer: provider.wallet.publicKey, - data: componentEntity2, - componentProgram: boltComponentProgramOrigin.programId, - entity: entity2, + it("Initialize Original Component on Entity 2, trough the world instance", () => + __awaiter(void 0, void 0, void 0, function* () { + let componentEntity2 = FindComponentPda( + boltComponentProgramOrigin.programId, + entity2, + "origin-component" + ); + yield worldProgram.methods + .initializeComponent() + .accounts({ + payer: provider.wallet.publicKey, + data: componentEntity2, + componentProgram: boltComponentProgramOrigin.programId, + entity: entity2, }) - .rpc(); + .rpc(); })); - it("Initialize Position Component on Entity 1", () => __awaiter(void 0, void 0, void 0, function* () { - componentPositionEntity1 = FindComponentPda(boltComponentPositionProgram.programId, entity1, "component-position"); - console.log("Component Position E1: ", componentPositionEntity1.toBase58()); - yield worldProgram.methods - .initializeComponent() - .accounts({ - payer: provider.wallet.publicKey, - data: componentPositionEntity1, - componentProgram: boltComponentPositionProgram.programId, - entity: entity1, + it("Initialize Position Component on Entity 1", () => + __awaiter(void 0, void 0, void 0, function* () { + componentPositionEntity1 = FindComponentPda( + boltComponentPositionProgram.programId, + entity1, + "component-position" + ); + console.log( + "Component Position E1: ", + componentPositionEntity1.toBase58() + ); + yield worldProgram.methods + .initializeComponent() + .accounts({ + payer: provider.wallet.publicKey, + data: componentPositionEntity1, + componentProgram: boltComponentPositionProgram.programId, + entity: entity1, }) - .rpc(); + .rpc(); })); - it("Initialize Velocity Component on Entity 1", () => __awaiter(void 0, void 0, void 0, function* () { - componentVelocityEntity1 = FindComponentPda(boltComponentVelocityProgram.programId, entity1, "component-velocity"); - yield worldProgram.methods - .initializeComponent() - .accounts({ - payer: provider.wallet.publicKey, - data: componentVelocityEntity1, - componentProgram: boltComponentVelocityProgram.programId, - entity: entity1, + it("Initialize Velocity Component on Entity 1", () => + __awaiter(void 0, void 0, void 0, function* () { + componentVelocityEntity1 = FindComponentPda( + boltComponentVelocityProgram.programId, + entity1, + "component-velocity" + ); + yield worldProgram.methods + .initializeComponent() + .accounts({ + payer: provider.wallet.publicKey, + data: componentVelocityEntity1, + componentProgram: boltComponentVelocityProgram.programId, + entity: entity1, }) - .rpc(); + .rpc(); })); - it("Initialize Position Component on Entity 2", () => __awaiter(void 0, void 0, void 0, function* () { - componentPositionEntity2 = FindComponentPda(boltComponentPositionProgram.programId, entity2, "component-position"); - yield worldProgram.methods - .initializeComponent() - .accounts({ - payer: provider.wallet.publicKey, - data: componentPositionEntity2, - componentProgram: boltComponentPositionProgram.programId, - entity: entity2, + it("Initialize Position Component on Entity 2", () => + __awaiter(void 0, void 0, void 0, function* () { + componentPositionEntity2 = FindComponentPda( + boltComponentPositionProgram.programId, + entity2, + "component-position" + ); + yield worldProgram.methods + .initializeComponent() + .accounts({ + payer: provider.wallet.publicKey, + data: componentPositionEntity2, + componentProgram: boltComponentPositionProgram.programId, + entity: entity2, }) - .rpc(); + .rpc(); })); - it("Check Position on Entity 1 is default", () => __awaiter(void 0, void 0, void 0, function* () { - (0, chai_1.expect)((yield boltComponentPositionProgram.account.position.fetch(componentPositionEntity1)).x.toNumber()).to.equal(0); - (0, chai_1.expect)((yield boltComponentPositionProgram.account.position.fetch(componentPositionEntity1)).y.toNumber()).to.equal(0); - (0, chai_1.expect)((yield boltComponentPositionProgram.account.position.fetch(componentPositionEntity1)).z.toNumber()).to.equal(0); + it("Check Position on Entity 1 is default", () => + __awaiter(void 0, void 0, void 0, function* () { + (0, chai_1.expect)( + (yield boltComponentPositionProgram.account.position.fetch( + componentPositionEntity1 + )).x.toNumber() + ).to.equal(0); + (0, chai_1.expect)( + (yield boltComponentPositionProgram.account.position.fetch( + componentPositionEntity1 + )).y.toNumber() + ).to.equal(0); + (0, chai_1.expect)( + (yield boltComponentPositionProgram.account.position.fetch( + componentPositionEntity1 + )).z.toNumber() + ).to.equal(0); })); - it("Simple Movement System and Up direction on Entity 1", () => __awaiter(void 0, void 0, void 0, function* () { - const args = { - direction: Direction.Up, - }; - yield worldProgram.methods - .apply(serializeArgs(args)) // Move Up - .accounts({ - componentProgram: boltComponentPositionProgram.programId, - boltSystem: systemSimpleMovement, - boltComponent: componentPositionEntity1, + it("Simple Movement System and Up direction on Entity 1", () => + __awaiter(void 0, void 0, void 0, function* () { + const args = { + direction: Direction.Up, + }; + yield worldProgram.methods + .apply(serializeArgs(args)) // Move Up + .accounts({ + componentProgram: boltComponentPositionProgram.programId, + boltSystem: systemSimpleMovement, + boltComponent: componentPositionEntity1, }) - .rpc({ skipPreflight: true }); - (0, chai_1.expect)((yield boltComponentPositionProgram.account.position.fetch(componentPositionEntity1)).y.toNumber()).to.equal(1); - const componentData = yield boltComponentPositionProgram.account.position.fetch(componentPositionEntity1); - const x = componentData.x.toNumber(); - const y = componentData.y.toNumber(); - const z = componentData.z.toNumber(); - console.log("+-----------------------------+"); - console.log("| Movement System: Entity 1 |"); - console.log("+----------------+------------+"); - console.log("| Coordinate | Value |"); - console.log("+----------------+------------+"); - console.log(`| X Position | ${String(x).padEnd(10, " ")} |`); - console.log("| | |"); - console.log(`| Y Position | ${String(y).padEnd(10, " ")} |`); - console.log("| | |"); - console.log(`| Z Position | ${String(z).padEnd(10, " ")} |`); - console.log("+----------------+------------+"); - console.log("| |"); - console.log("+-----------------------------+"); + .rpc({ skipPreflight: true }); + (0, chai_1.expect)( + (yield boltComponentPositionProgram.account.position.fetch( + componentPositionEntity1 + )).y.toNumber() + ).to.equal(1); + const componentData = + yield boltComponentPositionProgram.account.position.fetch( + componentPositionEntity1 + ); + const x = componentData.x.toNumber(); + const y = componentData.y.toNumber(); + const z = componentData.z.toNumber(); + console.log("+-----------------------------+"); + console.log("| Movement System: Entity 1 |"); + console.log("+----------------+------------+"); + console.log("| Coordinate | Value |"); + console.log("+----------------+------------+"); + console.log(`| X Position | ${String(x).padEnd(10, " ")} |`); + console.log("| | |"); + console.log(`| Y Position | ${String(y).padEnd(10, " ")} |`); + console.log("| | |"); + console.log(`| Z Position | ${String(z).padEnd(10, " ")} |`); + console.log("+----------------+------------+"); + console.log("| |"); + console.log("+-----------------------------+"); })); - it("Simple Movement System and Right direction on Entity 1", () => __awaiter(void 0, void 0, void 0, function* () { - const args = { - direction: Direction.Right, - }; - yield worldProgram.methods - .apply(serializeArgs(args)) // Move Right - .accounts({ - componentProgram: boltComponentPositionProgram.programId, - boltSystem: systemSimpleMovement, - boltComponent: componentPositionEntity1, + it("Simple Movement System and Right direction on Entity 1", () => + __awaiter(void 0, void 0, void 0, function* () { + const args = { + direction: Direction.Right, + }; + yield worldProgram.methods + .apply(serializeArgs(args)) // Move Right + .accounts({ + componentProgram: boltComponentPositionProgram.programId, + boltSystem: systemSimpleMovement, + boltComponent: componentPositionEntity1, }) - .rpc({ skipPreflight: true }); - (0, chai_1.expect)((yield boltComponentPositionProgram.account.position.fetch(componentPositionEntity1)).y.toNumber()).to.equal(1); - (0, chai_1.expect)((yield boltComponentPositionProgram.account.position.fetch(componentPositionEntity1)).y.toNumber()).to.equal(1); - const componentData = yield boltComponentPositionProgram.account.position.fetch(componentPositionEntity1); - const x = componentData.x.toNumber(); - const y = componentData.y.toNumber(); - const z = componentData.z.toNumber(); - console.log("+-----------------------------+"); - console.log("| Movement System: Entity 1 |"); - console.log("+----------------+------------+"); - console.log("| Coordinate | Value |"); - console.log("+----------------+------------+"); - console.log(`| X Position | ${String(x).padEnd(10, " ")} |`); - console.log("| | |"); - console.log(`| Y Position | ${String(y).padEnd(10, " ")} |`); - console.log("| | |"); - console.log(`| Z Position | ${String(z).padEnd(10, " ")} |`); - console.log("+----------------+------------+"); - console.log("| |"); - console.log("+-----------------------------+"); + .rpc({ skipPreflight: true }); + (0, chai_1.expect)( + (yield boltComponentPositionProgram.account.position.fetch( + componentPositionEntity1 + )).y.toNumber() + ).to.equal(1); + (0, chai_1.expect)( + (yield boltComponentPositionProgram.account.position.fetch( + componentPositionEntity1 + )).y.toNumber() + ).to.equal(1); + const componentData = + yield boltComponentPositionProgram.account.position.fetch( + componentPositionEntity1 + ); + const x = componentData.x.toNumber(); + const y = componentData.y.toNumber(); + const z = componentData.z.toNumber(); + console.log("+-----------------------------+"); + console.log("| Movement System: Entity 1 |"); + console.log("+----------------+------------+"); + console.log("| Coordinate | Value |"); + console.log("+----------------+------------+"); + console.log(`| X Position | ${String(x).padEnd(10, " ")} |`); + console.log("| | |"); + console.log(`| Y Position | ${String(y).padEnd(10, " ")} |`); + console.log("| | |"); + console.log(`| Z Position | ${String(z).padEnd(10, " ")} |`); + console.log("+----------------+------------+"); + console.log("| |"); + console.log("+-----------------------------+"); })); - it("Fly System on Entity 1", () => __awaiter(void 0, void 0, void 0, function* () { - yield worldProgram.methods - .apply(Buffer.alloc(0)) // Move Up - .accounts({ - componentProgram: boltComponentPositionProgram.programId, - boltSystem: systemFly, - boltComponent: componentPositionEntity1, + it("Fly System on Entity 1", () => + __awaiter(void 0, void 0, void 0, function* () { + yield worldProgram.methods + .apply(Buffer.alloc(0)) // Move Up + .accounts({ + componentProgram: boltComponentPositionProgram.programId, + boltSystem: systemFly, + boltComponent: componentPositionEntity1, }) - .rpc(); - (0, chai_1.expect)((yield boltComponentPositionProgram.account.position.fetch(componentPositionEntity1)).z.toNumber()).to.equal(1); - const componentData = yield boltComponentPositionProgram.account.position.fetch(componentPositionEntity1); - const x = componentData.x.toNumber(); - const y = componentData.y.toNumber(); - const z = componentData.z.toNumber(); - console.log("+-----------------------------+"); - console.log("| Fly: Position Entity 1 |"); - console.log("+----------------+------------+"); - console.log("| Coordinate | Value |"); - console.log("+----------------+------------+"); - console.log(`| X Position | ${String(x).padEnd(10, " ")} |`); - console.log("| | |"); - console.log(`| Y Position | ${String(y).padEnd(10, " ")} |`); - console.log("| | |"); - console.log(`| Z Position | ${String(z).padEnd(10, " ")} |`); - console.log("+----------------+------------+"); - console.log("| |"); - console.log("+-----------------------------+"); + .rpc(); + (0, chai_1.expect)( + (yield boltComponentPositionProgram.account.position.fetch( + componentPositionEntity1 + )).z.toNumber() + ).to.equal(1); + const componentData = + yield boltComponentPositionProgram.account.position.fetch( + componentPositionEntity1 + ); + const x = componentData.x.toNumber(); + const y = componentData.y.toNumber(); + const z = componentData.z.toNumber(); + console.log("+-----------------------------+"); + console.log("| Fly: Position Entity 1 |"); + console.log("+----------------+------------+"); + console.log("| Coordinate | Value |"); + console.log("+----------------+------------+"); + console.log(`| X Position | ${String(x).padEnd(10, " ")} |`); + console.log("| | |"); + console.log(`| Y Position | ${String(y).padEnd(10, " ")} |`); + console.log("| | |"); + console.log(`| Z Position | ${String(z).padEnd(10, " ")} |`); + console.log("+----------------+------------+"); + console.log("| |"); + console.log("+-----------------------------+"); })); - it("Apply Velocity on Entity 1", () => __awaiter(void 0, void 0, void 0, function* () { - yield worldProgram.methods - .apply2(Buffer.alloc(0)) - .accounts({ - componentProgram1: boltComponentVelocityProgram.programId, - componentProgram2: boltComponentPositionProgram.programId, - boltSystem: applyVelocity, - boltComponent1: componentVelocityEntity1, - boltComponent2: componentPositionEntity1, + it("Apply Velocity on Entity 1", () => + __awaiter(void 0, void 0, void 0, function* () { + yield worldProgram.methods + .apply2(Buffer.alloc(0)) + .accounts({ + componentProgram1: boltComponentVelocityProgram.programId, + componentProgram2: boltComponentPositionProgram.programId, + boltSystem: applyVelocity, + boltComponent1: componentVelocityEntity1, + boltComponent2: componentPositionEntity1, }) - .remainingAccounts([ - { - pubkey: componentPositionEntity1, - isWritable: false, - isSigner: false, - }, + .remainingAccounts([ + { + pubkey: componentPositionEntity1, + isWritable: false, + isSigner: false, + }, ]) - .rpc(); - console.log("Component Velocity: ", componentVelocityEntity1.toBase58()); - let componentData = yield boltComponentVelocityProgram.account.velocity.fetch(componentVelocityEntity1); - let x = componentData.x.toNumber(); - let y = componentData.y.toNumber(); - let z = componentData.z.toNumber(); - const tmp = componentData.lastApplied.toNumber(); - console.log("+-----------------------------+"); - console.log("| Apply Velocity: Velocity Entity 1 |"); - console.log("+----------------+------------+"); - console.log("| Coordinate | Value |"); - console.log("+----------------+------------+"); - console.log(`| X Position | ${String(x).padEnd(10, " ")} |`); - console.log("| | |"); - console.log(`| Y Position | ${String(y).padEnd(10, " ")} |`); - console.log("| | |"); - console.log(`| Z Position | ${String(z).padEnd(10, " ")} |`); - console.log("| | |"); - console.log(`| Timestamp | ${String(tmp).padEnd(10, " ")} |`); - console.log("+----------------+------------+"); - console.log("| |"); - console.log("+-----------------------------+"); - let positionData = yield boltComponentPositionProgram.account.position.fetch(componentPositionEntity1); - x = positionData.x.toNumber(); - y = positionData.y.toNumber(); - z = positionData.z.toNumber(); - console.log("+-----------------------------+"); - console.log("| Apply Velocity: Position Entity 1 |"); - console.log("+----------------+------------+"); - console.log("| Coordinate | Value |"); - console.log("+----------------+------------+"); - console.log(`| X Position | ${String(x).padEnd(10, " ")} |`); - console.log("| | |"); - console.log(`| Y Position | ${String(y).padEnd(10, " ")} |`); - console.log("| | |"); - console.log(`| Z Position | ${String(z).padEnd(10, " ")} |`); - console.log("+----------------+------------+"); - console.log("| |"); - console.log("+-----------------------------+"); + .rpc(); + console.log("Component Velocity: ", componentVelocityEntity1.toBase58()); + let componentData = + yield boltComponentVelocityProgram.account.velocity.fetch( + componentVelocityEntity1 + ); + let x = componentData.x.toNumber(); + let y = componentData.y.toNumber(); + let z = componentData.z.toNumber(); + const tmp = componentData.lastApplied.toNumber(); + console.log("+-----------------------------+"); + console.log("| Apply Velocity: Velocity Entity 1 |"); + console.log("+----------------+------------+"); + console.log("| Coordinate | Value |"); + console.log("+----------------+------------+"); + console.log(`| X Position | ${String(x).padEnd(10, " ")} |`); + console.log("| | |"); + console.log(`| Y Position | ${String(y).padEnd(10, " ")} |`); + console.log("| | |"); + console.log(`| Z Position | ${String(z).padEnd(10, " ")} |`); + console.log("| | |"); + console.log(`| Timestamp | ${String(tmp).padEnd(10, " ")} |`); + console.log("+----------------+------------+"); + console.log("| |"); + console.log("+-----------------------------+"); + let positionData = + yield boltComponentPositionProgram.account.position.fetch( + componentPositionEntity1 + ); + x = positionData.x.toNumber(); + y = positionData.y.toNumber(); + z = positionData.z.toNumber(); + console.log("+-----------------------------+"); + console.log("| Apply Velocity: Position Entity 1 |"); + console.log("+----------------+------------+"); + console.log("| Coordinate | Value |"); + console.log("+----------------+------------+"); + console.log(`| X Position | ${String(x).padEnd(10, " ")} |`); + console.log("| | |"); + console.log(`| Y Position | ${String(y).padEnd(10, " ")} |`); + console.log("| | |"); + console.log(`| Z Position | ${String(z).padEnd(10, " ")} |`); + console.log("+----------------+------------+"); + console.log("| |"); + console.log("+-----------------------------+"); })); - // Utils - function FindWorldRegistryPda(program) { - return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("registry")], program.programId)[0]; - } - function FindWorldPda(program, id) { - return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("world"), id.toBuffer("le", 8)], program.programId)[0]; - } - function FindEntityPda(program, worldId, entityId) { - return web3_js_1.PublicKey.findProgramAddressSync([ - Buffer.from("entity"), - worldId.toBuffer("be", 8), - entityId.toBuffer("be", 8), - ], program.programId)[0]; - } - function FindComponentPda(program, entity, seed = "component") { - return web3_js_1.PublicKey.findProgramAddressSync([Buffer.from(seed), entity.toBytes()], program)[0]; - } + // Utils + function FindWorldRegistryPda(program) { + return web3_js_1.PublicKey.findProgramAddressSync( + [Buffer.from("registry")], + program.programId + )[0]; + } + function FindWorldPda(program, id) { + return web3_js_1.PublicKey.findProgramAddressSync( + [Buffer.from("world"), id.toBuffer("le", 8)], + program.programId + )[0]; + } + function FindEntityPda(program, worldId, entityId) { + return web3_js_1.PublicKey.findProgramAddressSync( + [ + Buffer.from("entity"), + worldId.toBuffer("be", 8), + entityId.toBuffer("be", 8), + ], + program.programId + )[0]; + } + function FindComponentPda(program, entity, seed = "component") { + return web3_js_1.PublicKey.findProgramAddressSync( + [Buffer.from(seed), entity.toBytes()], + program + )[0]; + } });