diff --git a/packages/proto-signing/src/signer.ts b/packages/proto-signing/src/signer.ts new file mode 100644 index 00000000..a5aca75b --- /dev/null +++ b/packages/proto-signing/src/signer.ts @@ -0,0 +1,22 @@ +import { AccountData, OfflineSigner as OfflineAminoSigner, StdSignature } from "@cosmjs/launchpad"; + +import { cosmos } from "./codec"; + +export interface DirectSignResponse { + /** + * The sign doc that was signed. + * This may be different from the input signDoc when the signer modifies it as part of the signing process. + */ + readonly signed: cosmos.tx.v1beta1.ISignDoc; + readonly signature: StdSignature; +} + +export interface OfflineDirectSigner { + readonly getAccounts: () => Promise; + readonly signDirect: ( + signerAddress: string, + signDoc: cosmos.tx.v1beta1.ISignDoc, + ) => Promise; +} + +export type OfflineSigner = OfflineAminoSigner | OfflineDirectSigner; diff --git a/packages/proto-signing/types/signer.d.ts b/packages/proto-signing/types/signer.d.ts new file mode 100644 index 00000000..dc2d9e98 --- /dev/null +++ b/packages/proto-signing/types/signer.d.ts @@ -0,0 +1,18 @@ +import { AccountData, OfflineSigner as OfflineAminoSigner, StdSignature } from "@cosmjs/launchpad"; +import { cosmos } from "./codec"; +export interface DirectSignResponse { + /** + * The sign doc that was signed. + * This may be different from the input signDoc when the signer modifies it as part of the signing process. + */ + readonly signed: cosmos.tx.v1beta1.ISignDoc; + readonly signature: StdSignature; +} +export interface OfflineDirectSigner { + readonly getAccounts: () => Promise; + readonly signDirect: ( + signerAddress: string, + signDoc: cosmos.tx.v1beta1.ISignDoc, + ) => Promise; +} +export declare type OfflineSigner = OfflineAminoSigner | OfflineDirectSigner;