accounts
Version:
Tempo Accounts SDK
34 lines • 1.6 kB
TypeScript
import * as Schema from './Schema.js';
/** Provider RPC request id metadata. */
export type Id = string | number | null;
/** Transport metadata attached to a parsed provider request when present. */
export type Metadata = {
/** Transport or JSON-RPC request id. */
id?: Id | undefined;
/** JSON-RPC version. */
jsonrpc?: '2.0' | undefined;
/** Origin that sent the request, when supplied by the transport. */
origin?: string | undefined;
};
/** Parsed provider request with method-correlated decoded params. */
export type ProviderRequest<method extends Schema.Request['method'] = Schema.Request['method']> = Extract<Schema.Request, {
method: method;
}> & Metadata;
/** Parses an unknown value into a typed provider request envelope. */
export declare function parse<const method extends Schema.Request['method']>(value: unknown, options: parse.OptionsWithMethod<method>): ProviderRequest<method>;
export declare function parse(value: unknown, options?: parse.Options | undefined): ProviderRequest;
export declare namespace parse {
/** Options for {@link parse}. */
type Options = {
/** Expected RPC method. */
method?: Schema.Request['method'] | undefined;
/** Enforce wallet-only parameter policy, such as access-key limits. */
strict?: boolean | undefined;
};
/** Options for {@link parse} when narrowing to a specific method. */
type OptionsWithMethod<method extends Schema.Request['method']> = Options & {
/** Expected RPC method. */
method: method;
};
}
//# sourceMappingURL=ProviderRequest.d.ts.map