diff --git a/package-lock.json b/package-lock.json index 85863ae3..47f28a65 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@terra-money/feather.js", - "version": "2.0.0-beta.5", + "version": "2.0.0-beta.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@terra-money/feather.js", - "version": "2.0.0-beta.5", + "version": "2.0.0-beta.7", "license": "MIT", "dependencies": { "@ethersproject/bytes": "^5.7.0", diff --git a/package.json b/package.json index 7825e7e5..2b863cd7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@terra-money/feather.js", - "version": "2.0.0-beta.5", + "version": "2.0.0-beta.7", "description": "The JavaScript SDK for Terra and Feather chains", "license": "MIT", "author": "Terraform Labs, PTE.", diff --git a/src/client/lcd/api/AuthAPI.ts b/src/client/lcd/api/AuthAPI.ts index d4b8a733..3c2f12dc 100644 --- a/src/client/lcd/api/AuthAPI.ts +++ b/src/client/lcd/api/AuthAPI.ts @@ -39,15 +39,31 @@ export class AuthAPI extends BaseAPI { * * @param address address of account to look up */ - public async moduleAccountInfo( + public async moduleAccountsInfo( chainID: string, params: APIParams = {} - ): Promise> { + ): Promise> { const { accounts } = await this.getReqFromChainID(chainID).get<{ accounts: Array; }>(`/cosmos/auth/v1beta1/module_accounts`, params); - return accounts.map((account: any) => Account.fromData(account)); + return accounts.map((account: any) => ModuleAccount.fromData(account)); + } + /** + * Query a specific module acccount information + * + * @param address address of account to look up + */ + public async moduleAccountInfo( + chainID: string, + moduleName: string, + params: APIParams = {} + ): Promise { + const { account } = await this.getReqFromChainID(chainID).get<{ + account: ModuleAccount.Data; + }>(`/cosmos/auth/v1beta1/module_accounts/${moduleName}`, params); + + return ModuleAccount.fromData(account); } /** * Looks up the account information using its Terra account address. If the account has diff --git a/src/core/ica/controller/v1/CosmosTx.ts b/src/core/ica/controller/v1/CosmosTx.ts index 66de526d..c1654119 100644 --- a/src/core/ica/controller/v1/CosmosTx.ts +++ b/src/core/ica/controller/v1/CosmosTx.ts @@ -31,7 +31,6 @@ export class CosmosTx extends JSONSerializable< public static fromData(data: CosmosTx.Data, _?: boolean): CosmosTx { _; - console.log('CosmosTx#fromData', data); const parsedData = Buffer.from(data, 'base64'); const { messages } = CosmosTx_pb.decode(parsedData); return new CosmosTx(messages.map(msg => Msg.fromProto(msg))); @@ -39,7 +38,6 @@ export class CosmosTx extends JSONSerializable< public toData(_?: boolean): CosmosTx.Data { _; - console.log('CosmosTx#toData', this.messages); const { messages } = this; const ct = CosmosTx_pb.encode({ @@ -51,13 +49,11 @@ export class CosmosTx extends JSONSerializable< public static fromProto(proto: CosmosTx.Proto, _?: boolean): CosmosTx { _; - console.log('CosmosTx#fromProto', proto); return new CosmosTx(proto.messages.map(msg => Msg.fromProto(msg))); } public toProto(_?: boolean): CosmosTx.Proto { _; - console.log('CosmosTx#toProto', this.messages); const { messages } = this; const ct = CosmosTx_pb.encode({ @@ -68,14 +64,12 @@ export class CosmosTx extends JSONSerializable< } public packAny(isClassic?: boolean): Any { - console.log('CosmosTx#packAny', this.messages); return Any.fromPartial({ value: this.toProto(isClassic) as any, }); } public static unpackAny(msgAny: Any, isClassic?: boolean): CosmosTx { - console.log('CosmosTx#unpackAny', msgAny); return CosmosTx.fromProto(CosmosTx_pb.decode(msgAny.value), isClassic); } }