Skip to main content

@ada-anvil/sdk-server

Table of contents

Classes

Type Aliases

Variables

Functions

Type Aliases

CForgeClient

Ƭ CForgeClient: CreateTRPCProxyClient<CForgeRouter>


CForgeRouter

Ƭ CForgeRouter: ReturnType<typeof mergeRouters>


DefaultServerPlugins

Ƭ DefaultServerPlugins: [...DefaultCorePlugins, ...typeof defaultServerPlugins]


ExchangeIOs

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


ExchangeRouter

Ƭ ExchangeRouter: typeof exchangeRouter


MarketplaceIOs

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


MarketplaceRouter

Ƭ MarketplaceRouter: typeof marketplaceRouter


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<DefaultServerPlugins> & { create: typeof createServerInstance }


commonPlugin

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


defaultServerPlugins

Const defaultServerPlugins: readonly [Plugin<"common", true, { trpc: { access: "private" ; scope: "container" ; service: typeof TrpcService } }>, Plugin<"server", 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 } }>]


serverPlugin

Const serverPlugin: Plugin<"server", 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

createServerInstance

createServerInstance<P>(«destructured»?): Sdk<[...DefaultServerPlugins, ...P]>

Creates a new Anvil Server instance.

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<[...DefaultServerPlugins, ...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