@fairmint/canton-node-sdk
Version:
Canton Node SDK
24 lines • 909 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetActiveContracts = void 0;
const core_1 = require("../../../../../core");
const zod_1 = require("zod");
const endpoint = '/v2/state/active-contracts';
exports.GetActiveContracts = (0, core_1.createApiOperation)({
paramsSchema: zod_1.z.any(),
method: 'POST',
buildUrl: (_params, apiUrl) => `${apiUrl}${endpoint}`,
buildRequestData: async (params, client) => {
// If activeAtOffset is not specified, default to ledger end offset
if (params.activeAtOffset === undefined) {
const ledgerClient = client;
const ledgerEnd = await ledgerClient.getLedgerEnd(undefined);
return {
...params,
activeAtOffset: ledgerEnd.offset,
};
}
return params;
},
});
//# sourceMappingURL=get-active-contracts.js.map