@ada-anvil/sdk-server
Table of contents
Classes
Type Aliases
- CForgeClient
- CForgeRouter
- DefaultServerPlugins
- ExchangeIOs
- ExchangeRouter
- MarketplaceIOs
- MarketplaceRouter
- ProcedureType
- ServiceConfig
- ServiceProcedure
- SpoIOs
- SpoRouter
- StakingIOs
- StakingRouter
- TrpcOpts
- WalletIOs
- WalletRouter
- inferServiceIOs
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
| Name | Type |
|---|---|
Type | extends ProcedureType = ProcedureType |
Name | extends string = string |
Input | any |
Resp | unknown |
Type declaration
| Name | Type |
|---|---|
input | { _output: Input ; parse: (input: any) => Input } |
input._output | Input |
input.parse | (input: any) => Input |
name | Name |
resolver | (req: { ctx: any ; input: Input }) => Resp |
type | Type |
ServiceProcedure
Ƭ ServiceProcedure<T>: BuildProcedure<T["type"], ProcedureConfig<T>, inferServiceIOs<T>["output"]>
Type parameters
| Name | Type |
|---|---|
T | extends 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
| Name | Type |
|---|---|
apiKey? | string |
baseUrl | string |
fetchAdapter | FetchEsque |
WalletIOs
Ƭ WalletIOs: ConcatServices<[...typeof configs], "IOs">
WalletRouter
Ƭ WalletRouter: typeof walletRouter
inferServiceIOs
Ƭ inferServiceIOs<T>: Object
Type parameters
| Name | Type |
|---|---|
T | extends ServiceConfig |
Type declaration
| Name | Type |
|---|---|
input | T["input"][``"_output"``] |
name | T["name"] |
output | T["resolver"] extends (input: any) => infer O ? Awaited<O> : never |
type | T["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
| Name | Type |
|---|---|
P | extends readonly Plugin<string, boolean, Record<string, any>>[] |
Parameters
| Name | Type |
|---|---|
«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
| Name | Type |
|---|---|
input | RequestInfo | URL |
init? | RequestInit |
Returns
Promise<Response>
parseTrpcFetchUrl
▸ parseTrpcFetchUrl(url): string
Convert /{service}.{method} to /{service}/{method}
Parameters
| Name | Type |
|---|---|
url | string | Request | URL |
Returns
string