@effectai/sdk
Version:
Effect Network Javscript/Typescript SDK (for [https://effect.network](https://effect.network))
18 lines • 689 B
JavaScript
import { getIpfsResource, } from "../../../exports";
import { UInt128 } from "@wharfkit/antelope";
export const getCampaignById = async ({ client, id, }) => {
const { contracts } = client.network.config.efx;
const response = await client.provider.v1.chain.get_table_rows({
table: "campaign",
code: contracts.tasks,
scope: contracts.tasks,
lower_bound: UInt128.from(id),
upper_bound: UInt128.from(id),
limit: 1,
});
const [campaign] = response.rows;
const { field_1: hash } = campaign.content;
campaign.info = await getIpfsResource({ client, hash });
return campaign;
};
//# sourceMappingURL=getCampaignById.js.map