@ada-anvil/sdk-client
Table of contents
Classes
Type Aliases
- BalanceByPolicies
- CForgeClient
- CForgeRouter
- ConnectWalletOptions
- DefaultClientPlugins
- ExchangeIOs
- ExchangeRouter
- MarketplaceIOs
- MarketplaceRouter
- OnAccountChange
- ProcedureType
- ServiceConfig
- ServiceProcedure
- SpoIOs
- SpoRouter
- StakingIOs
- StakingRouter
- TrpcOpts
- WalletIOs
- WalletRouter
- inferServiceIOs
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
Name | Type |
---|---|
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
Name | Type |
---|---|
info? | WalletInfo |
Returns
void
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
<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
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
<[...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
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