proto-signing: Add OfflineSigner and OfflineDirectSigner types
This commit is contained in:
parent
e9de27d7ee
commit
5b5a173f5a
22
packages/proto-signing/src/signer.ts
Normal file
22
packages/proto-signing/src/signer.ts
Normal file
@ -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 AccountData[]>;
|
||||
readonly signDirect: (
|
||||
signerAddress: string,
|
||||
signDoc: cosmos.tx.v1beta1.ISignDoc,
|
||||
) => Promise<DirectSignResponse>;
|
||||
}
|
||||
|
||||
export type OfflineSigner = OfflineAminoSigner | OfflineDirectSigner;
|
||||
18
packages/proto-signing/types/signer.d.ts
vendored
Normal file
18
packages/proto-signing/types/signer.d.ts
vendored
Normal file
@ -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 AccountData[]>;
|
||||
readonly signDirect: (
|
||||
signerAddress: string,
|
||||
signDoc: cosmos.tx.v1beta1.ISignDoc,
|
||||
) => Promise<DirectSignResponse>;
|
||||
}
|
||||
export declare type OfflineSigner = OfflineAminoSigner | OfflineDirectSigner;
|
||||
Loading…
Reference in New Issue
Block a user