export type JsonNodePublic = unknown; export type ConsentContractPublic = {to?: Array | undefined, jwtProperties?: JsonNodePublic | undefined, start?: string | undefined, until?: string | undefined, when?: string | undefined, only?: Array | undefined, description?: string | undefined, jpath?: string | undefined}; export type CreateOrUpdateConsentContractRequestPublic = {consentContract: ConsentContractPublic, metadata?: Record | undefined}; export type CreateApiApiGraphchainChainConsentcontractsArgs = {chain: string, body: CreateOrUpdateConsentContractRequestPublic}; export type CreateApiApiGraphchainChainConsentcontractsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Allowed user roles:
  • sdzAdmin
  • sdzUser


create a consent contract * * POST /api/graphchain/{chain}/consentcontracts */ export const createApiApiGraphchainChainConsentcontracts = async (args: CreateApiApiGraphchainChainConsentcontractsArgs, options?: CreateApiApiGraphchainChainConsentcontractsOptions) => { const {baseUrl = "https://api.burstiq.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/api/graphchain/${encodeURIComponent(String(args.chain))}/consentcontracts${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };