@blockassetlabs/blaze
Version:
Blockasset Blaze
27 lines • 955 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.findIdentifierId = exports.findBlazeId = void 0;
const tslib_1 = require("tslib");
const anchor_1 = require("@project-serum/anchor");
const web3 = tslib_1.__importStar(require("@solana/web3.js"));
const constants_1 = require("./constants");
/**
* Finds the blaze id.
* @returns
*/
const findBlazeId = async (identifier) => {
return web3.PublicKey.findProgramAddress([
anchor_1.utils.bytes.utf8.encode(constants_1.BLAZE_PREFIX),
identifier.toArrayLike(Buffer, 'le', 8)
], constants_1.BLAZE_ADDRESS);
};
exports.findBlazeId = findBlazeId;
/**
* Finds the identifier id.
* @returns
*/
const findIdentifierId = async () => {
return web3.PublicKey.findProgramAddress([anchor_1.utils.bytes.utf8.encode(constants_1.IDENTIFIER_PREFIX)], constants_1.BLAZE_ADDRESS);
};
exports.findIdentifierId = findIdentifierId;
//# sourceMappingURL=pda.js.map