@bridgesplit/rwa-token-sdk
Version:
RWA Token SDK for the development of permissioned tokens on SVM blockchains.
71 lines • 3.25 kB
JavaScript
;
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());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DataRegistry = void 0;
const data_registry_1 = require("../data-registry");
/**
* Represents the client for Data Registry for an RWA.
*/
class DataRegistry {
constructor(rwaClient) {
this.rwaClient = rwaClient;
}
/**
* Asynchronously generates instructions to update asset information.
* @returns A Promise that resolves to the instructions to update asset information.
*/
setupDataAccount(createDataAccountArgs) {
return __awaiter(this, void 0, void 0, function* () {
const createDataAccountIx = yield (0, data_registry_1.getCreateDataAccountIx)(createDataAccountArgs, this.rwaClient.provider);
return createDataAccountIx;
});
}
/**
* Asynchronously generates instructions to update asset information.
* @returns A Promise that resolves to the instructions to update asset information.
*/
updateAssetsDataAccountInfoIxns(updateArgs) {
return __awaiter(this, void 0, void 0, function* () {
const updateIx = yield (0, data_registry_1.getUpdateDataAccountIx)(updateArgs, this.rwaClient.provider);
return updateIx;
});
}
/**
* Asynchronously generates instructions to delete asset information.
* @returns A Promise that resolves to the instructions to delete asset information.
*/
deleteAssetsDataAccountInfoIxns(deleteArgs) {
return __awaiter(this, void 0, void 0, function* () {
const deleteIx = yield (0, data_registry_1.getDeleteDataAccountIx)(deleteArgs, this.rwaClient.provider);
return deleteIx;
});
}
/**
* Asynchronously generates instructions to update asset information.
* @returns A Promise that resolves to the instructions to update asset information.
*/
delegateDataRegistry(delegateDataRegistryArgs) {
return __awaiter(this, void 0, void 0, function* () {
const delegateIx = yield (0, data_registry_1.getDelegateDataRegistryIx)(delegateDataRegistryArgs, this.rwaClient.provider);
return delegateIx;
});
}
/**
* Retrieves the data registry pda account for a specific asset mint.
* @param assetMint - The string representation of the asset's mint address.
* @returns The data registry pda as a public key.
*/
getDataRegistryPda(assetMint) {
return (0, data_registry_1.getDataRegistryPda)(assetMint);
}
}
exports.DataRegistry = DataRegistry;
//# sourceMappingURL=DataRegistry.js.map