Change some typings

This commit is contained in:
Thunnini 2022-12-12 17:50:40 +09:00
parent 1ea85324aa
commit 7ae09a0c11
3 changed files with 29 additions and 21 deletions

View File

@ -21,8 +21,12 @@ export interface IcnsVerificationResponse {
value: {
errors: Error[];
data: {
// JSON string
verifying_msg: string;
signature: number[];
// Base64 encoded
public_key: string;
// Base64 encoded
signature: string;
algorithm: string;
};
};

View File

@ -54,7 +54,7 @@ export class KeplrWallet implements Wallet {
getKey(chainId: string): Promise<{
readonly name: string;
readonly pubKey: Uint8Array;
readonly address: Uint8Array;
readonly bech32Address: string;
}> {
return this.keplr.getKey(chainId);
}
@ -77,15 +77,17 @@ export class KeplrWallet implements Wallet {
owner: string,
username: string,
addressChainIds: string[],
): Promise<{
chainId: string;
bech32Prefix: string;
bech32Address: string;
addressHash: "cosmos" | "ethereum";
pubKey: Uint8Array;
signatureSalt: number;
signature: Uint8Array;
}> {
): Promise<
{
chainId: string;
bech32Prefix: string;
bech32Address: string;
addressHash: "cosmos" | "ethereum";
pubKey: Uint8Array;
signatureSalt: number;
signature: Uint8Array;
}[]
> {
// TODO: Update @keplr-wallet/types
return (this.keplr as any).signICNSAdr36(
chainId,

View File

@ -10,7 +10,7 @@ export interface Wallet {
getKey(chainId: string): Promise<{
readonly name: string;
readonly pubKey: Uint8Array;
readonly address: Uint8Array;
readonly bech32Address: string;
}>;
signAmino(
chainId: string,
@ -25,13 +25,15 @@ export interface Wallet {
owner: string,
username: string,
addressChainIds: string[],
): Promise<{
chainId: string;
bech32Prefix: string;
bech32Address: string;
addressHash: "cosmos" | "ethereum";
pubKey: Uint8Array;
signatureSalt: number;
signature: Uint8Array;
}>;
): Promise<
{
chainId: string;
bech32Prefix: string;
bech32Address: string;
addressHash: "cosmos" | "ethereum";
pubKey: Uint8Array;
signatureSalt: number;
signature: Uint8Array;
}[]
>;
}