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: { value: {
errors: Error[]; errors: Error[];
data: { data: {
// JSON string
verifying_msg: string; verifying_msg: string;
signature: number[]; // Base64 encoded
public_key: string;
// Base64 encoded
signature: string;
algorithm: string; algorithm: string;
}; };
}; };

View File

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

View File

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