Skip to main content

@ada-anvil/sdk-client

Table of contents

Classes

Type Aliases

Variables

Functions

Type Aliases

BalanceByPolicies

Ƭ BalanceByPolicies: Object

Index signature

[key: string]: { [key: string]: number; }


CForgeClient

Ƭ CForgeClient: CreateTRPCProxyClient<CForgeRouter>


CForgeRouter

Ƭ CForgeRouter: ReturnType<typeof mergeRouters>


ConnectWalletOptions

Ƭ ConnectWalletOptions: Object

Type declaration

NameType
onAccountChange?OnAccountChange

DefaultClientPlugins

Ƭ DefaultClientPlugins: [...DefaultCorePlugins, ...typeof defaultClientPlugins]


ExchangeIOs

Ƭ ExchangeIOs: ConcatServices<[...typeof configs$4], "IOs">


ExchangeRouter

Ƭ ExchangeRouter: typeof exchangeRouter


MarketplaceIOs

Ƭ MarketplaceIOs: ConcatServices<[...typeof configs$3], "IOs">


MarketplaceRouter

Ƭ MarketplaceRouter: typeof marketplaceRouter


OnAccountChange

Ƭ OnAccountChange: (info?: WalletInfo) => void

Type declaration

▸ (info?): void

Parameters
NameType
info?WalletInfo
Returns

void


ProcedureType

Ƭ ProcedureType: typeof procedureTypes[number]


ServiceConfig

Ƭ ServiceConfig<Type, Name, Input, Resp>: Object

Type parameters

NameType
Typeextends ProcedureType = ProcedureType
Nameextends string = string
Inputany
Respunknown

Type declaration

NameType
input{ _output: Input ; parse: (input: any) => Input }
input._outputInput
input.parse(input: any) => Input
nameName
resolver(req: { ctx: any ; input: Input }) => Resp
typeType

ServiceProcedure

Ƭ ServiceProcedure<T>: BuildProcedure<T["type"], ProcedureConfig<T>, inferServiceIOs<T>["output"]>

Type parameters

NameType
Textends ServiceConfig

SpoIOs

Ƭ SpoIOs: ConcatServices<[...typeof configs$2], "IOs">


SpoRouter

Ƭ SpoRouter: typeof spoRouter


StakingIOs

Ƭ StakingIOs: ConcatServices<[...typeof configs$1], "IOs">


StakingRouter

Ƭ StakingRouter: typeof stakingRouter


TrpcOpts

Ƭ TrpcOpts: Object

Type declaration

NameType
apiKey?string
baseUrlstring
fetchAdapterFetchEsque

WalletIOs

Ƭ WalletIOs: ConcatServices<[...typeof configs], "IOs">


WalletRouter

Ƭ WalletRouter: typeof walletRouter


inferServiceIOs

Ƭ inferServiceIOs<T>: Object

Type parameters

NameType
Textends ServiceConfig

Type declaration

NameType
inputT["input"][``"_output"``]
nameT["name"]
outputT["resolver"] extends (input: any) => infer O ? Awaited<O> : never
typeT["type"]

Variables

anvil

Const anvil: Sdk<DefaultClientPlugins> & { create: typeof createClientInstance }


browserPlugin

Const browserPlugin: _ada_anvil_sdk_core.Plugin<"browser", true, { extensions: { access: "public" ; scope: "transient" ; service: typeof ExtensionsService } ; wallet: { access: "public" ; scope: "singleton" ; service: typeof WalletService } }>


clientPlugin

Const clientPlugin: Plugin<"client", true, { config: { access: "public" = "public"; scope: "container" = "container"; service: typeof ConfigService = ConfigService } ; exchange: { access: "public" = "public"; scope: "container" = "container"; service: typeof ExchangeService = ExchangeService } ; staking: { access: "public" = "public"; scope: "container" = "container"; service: typeof StakingService = StakingService } ; walletExt: { access: "public" = "public"; scope: "container" = "container"; service: typeof WalletExtService = WalletExtService } }>


commonPlugin

Const commonPlugin: _ada_anvil_sdk_core.Plugin<"common", true, { trpc: { access: "private" ; scope: "container" ; service: typeof TrpcService } }>


defaultClientPlugins

Const defaultClientPlugins: readonly [Plugin<"common", true, { trpc: { access: "private" ; scope: "container" ; service: typeof TrpcService } }>, Plugin<"browser", true, { extensions: { access: "public" ; scope: "transient" ; service: typeof ExtensionsService } ; wallet: { access: "public" ; scope: "singleton" ; service: typeof WalletService } }>, Plugin<"client", true, { config: { access: "public" = "public"; scope: "container" = "container"; service: typeof ConfigService = ConfigService } ; exchange: { access: "public" = "public"; scope: "container" = "container"; service: typeof ExchangeService = ExchangeService } ; staking: { access: "public" = "public"; scope: "container" = "container"; service: typeof StakingService = StakingService } ; walletExt: { access: "public" = "public"; scope: "container" = "container"; service: typeof WalletExtService = WalletExtService } }>]

Functions

createClientInstance

createClientInstance<P>(«destructured»?): Sdk<[...DefaultClientPlugins, ...P]>

Creates a new Anvil Client.

Type parameters

NameType
Pextends readonly Plugin<string, boolean, Record<string, any>>[]

Parameters

NameType
«destructured»Object
› plugins?[...{ [K in string | number | symbol]: P[K] }[]]

Returns

Sdk<[...DefaultClientPlugins, ...P]>


fetchAdapter

fetchAdapter(input, init?): Promise<Response>

Use this fetch adapter in trpc http links to parse the fetch url into a valid format

Parameters

NameType
inputRequestInfo | URL
init?RequestInit

Returns

Promise<Response>


parseTrpcFetchUrl

parseTrpcFetchUrl(url): string

Convert /{service}.{method} to /{service}/{method}

Parameters

NameType
urlstring | Request | URL

Returns

string