API Report File for "@kadena/client"
Do not edit this file. It is a report generated by API Extractor.
import { ChainId } from '@kadena/types';
import Client from '@walletconnect/sign-client';
import { ICap } from '@kadena/types';
import { ICommand } from '@kadena/types';
import { ICommandResult } from '@kadena/chainweb-node-client';
import { IExecPayload } from '@kadena/types';
import { ILocalCommandResult } from '@kadena/chainweb-node-client';
import { ILocalOptions } from '@kadena/chainweb-node-client';
import { IPollResponse } from '@kadena/chainweb-node-client';
import { IPreflightResult } from '@kadena/chainweb-node-client';
import { IUnsignedCommand } from '@kadena/types';
import { LocalRequestBody } from '@kadena/chainweb-node-client';
import { LocalResponse } from '@kadena/chainweb-node-client';
import { SessionTypes } from '@walletconnect/types';
export { ChainId }
// @public
export const createClient: ICreateClient;
// @public
export const createTransaction: (pactCommand: Partial<IPactCommand>) => IUnsignedCommand;
// @public
export const createTransactionBuilder: (initial?: Partial<IPactCommand>) => ITransactionBuilder;
// @public
export function createWalletConnectQuicksign(client: Client, session: SessionTypes.Struct, walletConnectChainId: TWalletConnectChainId): ISignFunction;
// @public
export function createWalletConnectSign(client: Client, session: SessionTypes.Struct, walletConnectChainId: TWalletConnectChainId): ISingleSignFunction;
// @public (undocumented)
export interface IBaseClient {
createSpv: (transactionDescriptor: ITransactionDescriptor, targetChainId: ChainId) => Promise<string>;
getStatus: (transactionDescriptors: ITransactionDescriptor[] | ITransactionDescriptor) => Promise<IPollResponse>;
listen: (transactionDescriptor: ITransactionDescriptor) => Promise<ICommandResult>;
local: <T extends ILocalOptions>(transaction: LocalRequestBody, options?: T) => Promise<LocalResponse<T>>;
pollCreateSpv: (transactionDescriptor: ITransactionDescriptor, targetChainId: ChainId, options?: IPollOptions) => Promise<string>;
pollStatus: (transactionDescriptors: ITransactionDescriptor[] | ITransactionDescriptor, options?: IPollOptions) => IPollRequestPromise<ICommandResult>;
submit: ISubmit;
}
// @public
export interface IBuilder<TCommand> {
// Warning: (ae-forgotten-export) The symbol "ValidDataTypes" needs to be exported by the entry point index.d.ts
addData: (key: string, data: ValidDataTypes) => IBuilder<TCommand>;
// Warning: (ae-forgotten-export) The symbol "IAddKeyset" needs to be exported by the entry point index.d.ts
addKeyset: IAddKeyset<TCommand>;
// Warning: (ae-forgotten-export) The symbol "IAddSigner" needs to be exported by the entry point index.d.ts
addSigner: IAddSigner<TCommand>;
createTransaction: () => IUnsignedCommand;
getCommand: () => Partial<IPactCommand>;
setMeta: (meta: Partial<Omit<IPactCommand['meta'], 'sender'>> & {
senderAccount?: string;
}) => IBuilder<TCommand>;
setNetworkId: (id: string) => IBuilder<TCommand>;
// Warning: (ae-forgotten-export) The symbol "ISetNonce" needs to be exported by the entry point index.d.ts
setNonce: ISetNonce<TCommand>;
}
export { ICap }
// @beta @deprecated (undocumented)
export type ICapabilityItem = ICap;
// @public
export interface IClient extends IBaseClient {
dirtyRead: (transaction: IUnsignedCommand) => Promise<ICommandResult>;
// @deprecated
getPoll: (transactionDescriptors: ITransactionDescriptor[] | ITransactionDescriptor) => Promise<IPollResponse>;
preflight: (transaction: ICommand | IUnsignedCommand) => Promise<ILocalCommandResult>;
runPact: (code: string, data: Record<string, unknown>, option: INetworkOptions) => Promise<ICommandResult>;
// @deprecated
send: ISubmit;
signatureVerification: (transaction: ICommand) => Promise<ICommandResult>;
}
export { ICommand }
export { ICommandResult }
// @public
export interface IContinuationPayloadObject {
// (undocumented)
cont: {
pactId?: string;
step?: number;
rollback?: boolean;
data?: Record<string, unknown>;
proof?: string;
};
}
// @public (undocumented)
export interface ICreateClient {
(hostUrl: string): IClient;
(hostAddressGenerator?: (options: {
chainId: ChainId;
networkId: string;
}) => string): IClient;
}
// @public
export interface IExecutionPayloadObject {
// (undocumented)
exec: {
code?: string;
data?: Record<string, unknown>;
};
}
// @public (undocumented)
export interface INetworkOptions {
// (undocumented)
chainId: ChainId;
// (undocumented)
networkId: string;
}
// @public
export interface IPact {
// (undocumented)
builder: ITransactionBuilder;
// (undocumented)
modules: IPactModules;
}
// @public
export interface IPactCommand {
// (undocumented)
meta: {
chainId: ChainId;
sender?: string;
gasLimit?: number;
gasPrice?: number;
ttl?: number;
creationTime?: number;
};
// (undocumented)
networkId: string;
// (undocumented)
nonce: string;
// (undocumented)
payload: IExecutionPayloadObject | IContinuationPayloadObject;
// (undocumented)
signers: Array<{
pubKey: string;
address?: string;
scheme?: 'ED25519' | 'ETH';
clist?: ICap[];
}>;
}
// @public
export interface IPactModules {
}
// @public
export interface IPollOptions {
// (undocumented)
interval?: number;
// (undocumented)
onPoll?: (id: string) => void;
// (undocumented)
timeout?: number;
}
// @public (undocumented)
export type IPollRequestPromise<T> = Promise<Record<string, T>> & {
requests: Record<string, Promise<T>>;
};
export { IPollResponse }
export { IPreflightResult }
// @public
export interface IQuickSignRequestBody {
// (undocumented)
cmdSigDatas: IUnsignedQuicksignTransaction[];
}
// @public
export type IQuicksignResponse = IQuicksignResponseError | IQuicksignResponseOutcomes;
// @public
export interface IQuicksignResponseCommand {
// (undocumented)
cmd: string;
// (undocumented)
sigs: IQuicksignSigner[];
}
// @public
export interface IQuicksignResponseError {
// (undocumented)
error: {
type: 'reject';
} | {
type: 'emptyList';
} | {
type: 'other';
msg: string;
};
}
// @public
export interface IQuicksignResponseOutcomes {
// (undocumented)
responses: {
commandSigData: IQuicksignResponseCommand;
outcome: {
hash: string;
result: 'success';
} | {
msg: string;
result: 'failure';
} | {
result: 'noSig';
};
}[];
}
// @public
export type IQuicksignSig = string | null;
// @public
export interface IQuicksignSigner {
// (undocumented)
pubKey: string;
// (undocumented)
sig: IQuicksignSig;
}
// @public
export interface ISignBody {
// (undocumented)
caps: {
role: string;
description: string;
cap: ICap;
}[];
// (undocumented)
chainId: string;
// (undocumented)
code: string;
// (undocumented)
data: Record<string, unknown>;
// (undocumented)
gasLimit: number;
// (undocumented)
gasPrice: number;
// (undocumented)
networkId: string;
// (undocumented)
sender: string;
// (undocumented)
signingPubKey: string;
// (undocumented)
ttl: number;
}
// @public
export interface ISignFunction extends ISingleSignFunction {
// (undocumented)
(transactionList: IUnsignedCommand[]): Promise<(ICommand | IUnsignedCommand)[]>;
}
// @public
export interface ISingleSignFunction {
// (undocumented)
(transaction: IUnsignedCommand): Promise<ICommand | IUnsignedCommand>;
}
// @public
export function isSignedTransaction(command: IUnsignedCommand | ICommand): command is ICommand;
// @public (undocumented)
export interface ISubmit {
(transaction: ICommand): Promise<ITransactionDescriptor>;
(transactionList: ICommand[]): Promise<ITransactionDescriptor[]>;
}
// @public (undocumented)
export interface ITransactionBuilder {
// Warning: (ae-forgotten-export) The symbol "IContinuation" needs to be exported by the entry point index.d.ts
continuation: IContinuation;
// Warning: (ae-forgotten-export) The symbol "IExecution" needs to be exported by the entry point index.d.ts
execution: IExecution;
}
// @public
export interface ITransactionDescriptor {
// (undocumented)
chainId: ChainId;
// (undocumented)
networkId: string;
// (undocumented)
requestKey: string;
}
export { IUnsignedCommand }
// @public
export interface IUnsignedQuicksignTransaction {
// (undocumented)
cmd: string;
// (undocumented)
sigs: IQuicksignSigner[];
}
// @public
export const literal: <T extends string | Record<string, unknown>>(value: T) => () => T;
// @public
export const Pact: IPact;
// @public
export const readKeyset: (key: string) => () => string;
// @public
export const signWithChainweaver: ISignFunction;
// @public
export type TWalletConnectChainId = `kadena:${IPactCommand['networkId']}`;
// Warning: (ae-forgotten-export) The symbol "ExtractCapabilityType" needs to be exported by the entry point index.d.ts
//
// @public
export type WithCapability<TCode extends string & {
capability: unknown;
}> = ExtractCapabilityType<{
payload: {
funs: [TCode];
};
}>;
// (No @packageDocumentation comment for this package)
import { ChainId } from '@kadena/types';
import Client from '@walletconnect/sign-client';
import { ICap } from '@kadena/types';
import { ICommand } from '@kadena/types';
import { ICommandResult } from '@kadena/chainweb-node-client';
import { IExecPayload } from '@kadena/types';
import { ILocalCommandResult } from '@kadena/chainweb-node-client';
import { ILocalOptions } from '@kadena/chainweb-node-client';
import { IPollResponse } from '@kadena/chainweb-node-client';
import { IPreflightResult } from '@kadena/chainweb-node-client';
import { IUnsignedCommand } from '@kadena/types';
import { LocalRequestBody } from '@kadena/chainweb-node-client';
import { LocalResponse } from '@kadena/chainweb-node-client';
import { SessionTypes } from '@walletconnect/types';
export { ChainId }
// @public
export const createClient: ICreateClient;
// @public
export const createTransaction: (pactCommand: Partial<IPactCommand>) => IUnsignedCommand;
// @public
export const createTransactionBuilder: (initial?: Partial<IPactCommand>) => ITransactionBuilder;
// @public
export function createWalletConnectQuicksign(client: Client, session: SessionTypes.Struct, walletConnectChainId: TWalletConnectChainId): ISignFunction;
// @public
export function createWalletConnectSign(client: Client, session: SessionTypes.Struct, walletConnectChainId: TWalletConnectChainId): ISingleSignFunction;
// @public (undocumented)
export interface IBaseClient {
createSpv: (transactionDescriptor: ITransactionDescriptor, targetChainId: ChainId) => Promise<string>;
getStatus: (transactionDescriptors: ITransactionDescriptor[] | ITransactionDescriptor) => Promise<IPollResponse>;
listen: (transactionDescriptor: ITransactionDescriptor) => Promise<ICommandResult>;
local: <T extends ILocalOptions>(transaction: LocalRequestBody, options?: T) => Promise<LocalResponse<T>>;
pollCreateSpv: (transactionDescriptor: ITransactionDescriptor, targetChainId: ChainId, options?: IPollOptions) => Promise<string>;
pollStatus: (transactionDescriptors: ITransactionDescriptor[] | ITransactionDescriptor, options?: IPollOptions) => IPollRequestPromise<ICommandResult>;
submit: ISubmit;
}
// @public
export interface IBuilder<TCommand> {
// Warning: (ae-forgotten-export) The symbol "ValidDataTypes" needs to be exported by the entry point index.d.ts
addData: (key: string, data: ValidDataTypes) => IBuilder<TCommand>;
// Warning: (ae-forgotten-export) The symbol "IAddKeyset" needs to be exported by the entry point index.d.ts
addKeyset: IAddKeyset<TCommand>;
// Warning: (ae-forgotten-export) The symbol "IAddSigner" needs to be exported by the entry point index.d.ts
addSigner: IAddSigner<TCommand>;
createTransaction: () => IUnsignedCommand;
getCommand: () => Partial<IPactCommand>;
setMeta: (meta: Partial<Omit<IPactCommand['meta'], 'sender'>> & {
senderAccount?: string;
}) => IBuilder<TCommand>;
setNetworkId: (id: string) => IBuilder<TCommand>;
// Warning: (ae-forgotten-export) The symbol "ISetNonce" needs to be exported by the entry point index.d.ts
setNonce: ISetNonce<TCommand>;
}
export { ICap }
// @beta @deprecated (undocumented)
export type ICapabilityItem = ICap;
// @public
export interface IClient extends IBaseClient {
dirtyRead: (transaction: IUnsignedCommand) => Promise<ICommandResult>;
// @deprecated
getPoll: (transactionDescriptors: ITransactionDescriptor[] | ITransactionDescriptor) => Promise<IPollResponse>;
preflight: (transaction: ICommand | IUnsignedCommand) => Promise<ILocalCommandResult>;
runPact: (code: string, data: Record<string, unknown>, option: INetworkOptions) => Promise<ICommandResult>;
// @deprecated
send: ISubmit;
signatureVerification: (transaction: ICommand) => Promise<ICommandResult>;
}
export { ICommand }
export { ICommandResult }
// @public
export interface IContinuationPayloadObject {
// (undocumented)
cont: {
pactId?: string;
step?: number;
rollback?: boolean;
data?: Record<string, unknown>;
proof?: string;
};
}
// @public (undocumented)
export interface ICreateClient {
(hostUrl: string): IClient;
(hostAddressGenerator?: (options: {
chainId: ChainId;
networkId: string;
}) => string): IClient;
}
// @public
export interface IExecutionPayloadObject {
// (undocumented)
exec: {
code?: string;
data?: Record<string, unknown>;
};
}
// @public (undocumented)
export interface INetworkOptions {
// (undocumented)
chainId: ChainId;
// (undocumented)
networkId: string;
}
// @public
export interface IPact {
// (undocumented)
builder: ITransactionBuilder;
// (undocumented)
modules: IPactModules;
}
// @public
export interface IPactCommand {
// (undocumented)
meta: {
chainId: ChainId;
sender?: string;
gasLimit?: number;
gasPrice?: number;
ttl?: number;
creationTime?: number;
};
// (undocumented)
networkId: string;
// (undocumented)
nonce: string;
// (undocumented)
payload: IExecutionPayloadObject | IContinuationPayloadObject;
// (undocumented)
signers: Array<{
pubKey: string;
address?: string;
scheme?: 'ED25519' | 'ETH';
clist?: ICap[];
}>;
}
// @public
export interface IPactModules {
}
// @public
export interface IPollOptions {
// (undocumented)
interval?: number;
// (undocumented)
onPoll?: (id: string) => void;
// (undocumented)
timeout?: number;
}
// @public (undocumented)
export type IPollRequestPromise<T> = Promise<Record<string, T>> & {
requests: Record<string, Promise<T>>;
};
export { IPollResponse }
export { IPreflightResult }
// @public
export interface IQuickSignRequestBody {
// (undocumented)
cmdSigDatas: IUnsignedQuicksignTransaction[];
}
// @public
export type IQuicksignResponse = IQuicksignResponseError | IQuicksignResponseOutcomes;
// @public
export interface IQuicksignResponseCommand {
// (undocumented)
cmd: string;
// (undocumented)
sigs: IQuicksignSigner[];
}
// @public
export interface IQuicksignResponseError {
// (undocumented)
error: {
type: 'reject';
} | {
type: 'emptyList';
} | {
type: 'other';
msg: string;
};
}
// @public
export interface IQuicksignResponseOutcomes {
// (undocumented)
responses: {
commandSigData: IQuicksignResponseCommand;
outcome: {
hash: string;
result: 'success';
} | {
msg: string;
result: 'failure';
} | {
result: 'noSig';
};
}[];
}
// @public
export type IQuicksignSig = string | null;
// @public
export interface IQuicksignSigner {
// (undocumented)
pubKey: string;
// (undocumented)
sig: IQuicksignSig;
}
// @public
export interface ISignBody {
// (undocumented)
caps: {
role: string;
description: string;
cap: ICap;
}[];
// (undocumented)
chainId: string;
// (undocumented)
code: string;
// (undocumented)
data: Record<string, unknown>;
// (undocumented)
gasLimit: number;
// (undocumented)
gasPrice: number;
// (undocumented)
networkId: string;
// (undocumented)
sender: string;
// (undocumented)
signingPubKey: string;
// (undocumented)
ttl: number;
}
// @public
export interface ISignFunction extends ISingleSignFunction {
// (undocumented)
(transactionList: IUnsignedCommand[]): Promise<(ICommand | IUnsignedCommand)[]>;
}
// @public
export interface ISingleSignFunction {
// (undocumented)
(transaction: IUnsignedCommand): Promise<ICommand | IUnsignedCommand>;
}
// @public
export function isSignedTransaction(command: IUnsignedCommand | ICommand): command is ICommand;
// @public (undocumented)
export interface ISubmit {
(transaction: ICommand): Promise<ITransactionDescriptor>;
(transactionList: ICommand[]): Promise<ITransactionDescriptor[]>;
}
// @public (undocumented)
export interface ITransactionBuilder {
// Warning: (ae-forgotten-export) The symbol "IContinuation" needs to be exported by the entry point index.d.ts
continuation: IContinuation;
// Warning: (ae-forgotten-export) The symbol "IExecution" needs to be exported by the entry point index.d.ts
execution: IExecution;
}
// @public
export interface ITransactionDescriptor {
// (undocumented)
chainId: ChainId;
// (undocumented)
networkId: string;
// (undocumented)
requestKey: string;
}
export { IUnsignedCommand }
// @public
export interface IUnsignedQuicksignTransaction {
// (undocumented)
cmd: string;
// (undocumented)
sigs: IQuicksignSigner[];
}
// @public
export const literal: <T extends string | Record<string, unknown>>(value: T) => () => T;
// @public
export const Pact: IPact;
// @public
export const readKeyset: (key: string) => () => string;
// @public
export const signWithChainweaver: ISignFunction;
// @public
export type TWalletConnectChainId = `kadena:${IPactCommand['networkId']}`;
// Warning: (ae-forgotten-export) The symbol "ExtractCapabilityType" needs to be exported by the entry point index.d.ts
//
// @public
export type WithCapability<TCode extends string & {
capability: unknown;
}> = ExtractCapabilityType<{
payload: {
funs: [TCode];
};
}>;
// (No @packageDocumentation comment for this package)