export type ChainId = 'eip155:1' | 'eip155:42161' | 'eip155:8453' | 'eip155:81457' | 'eip155:98866' | 'eip155:999' | 'eip155:43114' | 'eip155:56' | 'eip155:5042' | 'eip155:1329' | 'eip155:11155111' | 'eip155:421614' | 'eip155:84532' | 'eip155:168587773' | 'eip155:98867' | 'eip155:998' | 'eip155:43113' | 'eip155:97' | 'eip155:5042002' | 'eip155:1328' | 'eip155:202110' | 'eip155:179205' | 'eip155:179202' | 'eip155:98865' | 'eip155:7887'; export type FaucetInput = {chain_id?: ChainId | undefined}; export type CreateApiApiV2AccountsAccountIdFaucetArgs = {body: FaucetInput}; export type CreateApiApiV2AccountsAccountIdFaucetOptions = {baseUrl?: string | undefined, ApiKeyId?: string | undefined, ApiSecretKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Sandbox Faucet * * POST /api/v2/accounts/{account_id}/faucet */ export const createApiApiV2AccountsAccountIdFaucet = async (args: CreateApiApiV2AccountsAccountIdFaucetArgs, options?: CreateApiApiV2AccountsAccountIdFaucetOptions) => { const {baseUrl = "https://api-enterprise.sbt.dinari.com", fetch: fetchFn = fetch, ApiKeyId, ApiSecretKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (ApiKeyId !== undefined) headers.set("X-API-Key-Id", ApiKeyId) if (ApiSecretKey !== undefined) headers.set("X-API-Secret-Key", ApiSecretKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/accounts/${encodeURIComponent(String(args.account_id))}/faucet${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 undefined };