Skip to content

Commit

Permalink
Export types
Browse files Browse the repository at this point in the history
  • Loading branch information
ash-vd authored and alber70g committed Aug 28, 2023
1 parent c32556a commit 3803545
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 7 deletions.
22 changes: 18 additions & 4 deletions packages/libs/client/etc/client.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,9 @@ export { ChainId }
// @public
export const createClient: ICreateClient;

// Warning: (ae-forgotten-export) The symbol "IEckoSignFunction" needs to be exported by the entry point index.d.ts
//
// @public
export function createEckoWalletQuicksign(): IEckoSignFunction;

// Warning: (ae-forgotten-export) The symbol "IEckoSignSingleFunction" needs to be exported by the entry point index.d.ts
//
// @public
export function createEckoWalletSign(): IEckoSignSingleFunction;

Expand Down Expand Up @@ -102,6 +98,16 @@ export { ICommand }

export { ICommandResult }

// @public
export interface ICommonEckoFunctions {
// (undocumented)
connect: (networkId: string) => Promise<boolean>;
// (undocumented)
isConnected: (networkId: string) => Promise<boolean>;
// (undocumented)
isInstalled: () => boolean;
}

// @public
export interface IContinuationPayloadObject {
// (undocumented)
Expand All @@ -123,6 +129,14 @@ export interface ICreateClient {
}) => string): IClient;
}

// @public
export interface IEckoSignFunction extends ISignFunction, ICommonEckoFunctions {
}

// @public
export interface IEckoSignSingleFunction extends ISingleSignFunction, ICommonEckoFunctions {
}

// @public
export interface IExecutionPayloadObject {
// (undocumented)
Expand Down
4 changes: 2 additions & 2 deletions packages/libs/client/src/signing/ISignFunction.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { ICommand, IUnsignedCommand } from '@kadena/types';

/**
* Interface to use when writing a singing function that accepts multiple transactions
* Interface to use when writing a signing function that accepts a single transaction
* @public
*/
export interface ISingleSignFunction {
(transaction: IUnsignedCommand): Promise<ICommand | IUnsignedCommand>;
}

/**
* Interface to use when writing a singing function that accepts multiple transactions
* Interface to use when writing a signing function that accepts multiple transactions
* @public
*/
export interface ISignFunction extends ISingleSignFunction {
Expand Down
13 changes: 12 additions & 1 deletion packages/libs/client/src/signing/eckoWallet/eckoTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,27 @@ import { ISignFunction, ISingleSignFunction } from '../ISignFunction';

export type EckoStatus = 'success' | 'fail';

/**
* Interface that describes the common functions to be used with Ecko Wallet
* @public
*/
export interface ICommonEckoFunctions {
isInstalled: () => boolean;
isConnected: (networkId: string) => Promise<boolean>;
connect: (networkId: string) => Promise<boolean>;
}

/**
* Interface to use when writing a signing function for Ecko Wallet that accepts a single transaction
* @public
*/
export interface IEckoSignSingleFunction
extends ISingleSignFunction,
ICommonEckoFunctions {}

/**
* Interface to use when writing a signing function for Ecko Wallet that accepts multiple transactions
* @public
*/
export interface IEckoSignFunction
extends ISignFunction,
ICommonEckoFunctions {}
Expand Down
5 changes: 5 additions & 0 deletions packages/libs/client/src/signing/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
export {
ICommonEckoFunctions,
IEckoSignSingleFunction,
IEckoSignFunction,
} from './eckoWallet/eckoTypes';
export { TWalletConnectChainId } from './walletconnect/walletConnectTypes';
export { ISingleSignFunction, ISignFunction } from './ISignFunction';

Expand Down

0 comments on commit 3803545

Please sign in to comment.