UNPKG

@bridgesplit/rwa-token-sdk

Version:

RWA Token SDK for the development of permissioned tokens on SVM blockchains.

22 lines 1.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getDataRegistryPda = exports.getDataRegistryProgram = exports.dataRegistryProgramId = void 0; const anchor_1 = require("@coral-xyz/anchor"); const idls_1 = require("../programs/idls"); const web3_js_1 = require("@solana/web3.js"); exports.dataRegistryProgramId = new web3_js_1.PublicKey("dataeP5X1e7XsWN1ovDSEDP5cqaEUnKBmHE5iZhXPVw"); /** * Returns the data registry program as a typed anchor program. * @param provider - Solana anchor provider. * @returns Typed solana program to be used for transaction building. */ const getDataRegistryProgram = (provider) => new anchor_1.Program(idls_1.DataRegistryIdl, provider); exports.getDataRegistryProgram = getDataRegistryProgram; /** * Retrieves the data registry pda public key for a specific asset mint. * @param assetMint - The string representation of the asset's mint address. * @returns The data registry pda. */ const getDataRegistryPda = (assetMint) => web3_js_1.PublicKey.findProgramAddressSync([new web3_js_1.PublicKey(assetMint).toBuffer()], exports.dataRegistryProgramId)[0]; exports.getDataRegistryPda = getDataRegistryPda; //# sourceMappingURL=utils.js.map