diff --git a/package-lock.json b/package-lock.json index 47f28a65..b3f645e0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@terra-money/feather.js", - "version": "2.0.0-beta.7", + "version": "2.0.0-beta.8", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index 2b863cd7..fea94bdf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@terra-money/feather.js", - "version": "2.0.0-beta.7", + "version": "2.0.0-beta.8", "description": "The JavaScript SDK for Terra and Feather chains", "license": "MIT", "author": "Terraform Labs, PTE.", diff --git a/src/client/lcd/api/TokenFactoryAPI.ts b/src/client/lcd/api/TokenFactoryAPI.ts index a771bdd8..d94be4d5 100644 --- a/src/client/lcd/api/TokenFactoryAPI.ts +++ b/src/client/lcd/api/TokenFactoryAPI.ts @@ -1,7 +1,7 @@ import { APIParams } from '../APIRequester'; import { LCDClient } from '../LCDClient'; import { BaseAPI } from './BaseAPI'; -import { QueryParamsResponse } from '@terra-money/terra.proto/cosmwasm/wasm/v1/query'; +import { QueryParamsResponse } from '@terra-money/terra.proto/osmosis/tokenfactory/v1beta1/query'; import { AccAddress } from '../../../core'; export interface DenomsFromCreatorResponse { @@ -14,40 +14,48 @@ export interface AuthorityMetadataResponse { }; } +export interface BeforeSendHookResponse { + before_send_hook: { + cosmwasm_address: AccAddress; + }; +} + export class TokenFactory extends BaseAPI { constructor(public lcd: LCDClient) { super(lcd.apiRequesters, lcd.config); } - public params( - chainID: string, - params: APIParams = {} - ): Promise { + public params(chainID: string): Promise { return this.getReqFromChainID(chainID).get( - `/osmosis/tokenfactory/v1beta1/params`, - params + `/osmosis/tokenfactory/v1beta1/params` ); } public denomsFromCreator( - creator: AccAddress, - params: APIParams = {} + creator: AccAddress ): Promise { const req = this.getReqFromAddress(creator); return req.get( - `/osmosis/tokenfactory/v1beta1/denoms_from_creator/${creator}`, - params + `/osmosis/tokenfactory/v1beta1/denoms_from_creator/${creator}` ); } - /* - The following request does not work yet because the endpoint - does recognize the url encoded denom. + public authorityMetadata( + chainID: string, + denom: string + ): Promise { + return this.getReqFromChainID(chainID).get( + `/osmosis/tokenfactory/v1beta1/denoms/${denom}/authority_metadata` + ); + } - public authorityMetadata(chainID: string, denom: string, params: APIParams = {}): Promise { - return this.getReqFromChainID(chainID) - .get(`/osmosis/tokenfactory/v1beta1/denoms/${denom}/authority_metadata`, params); - } - */ + public beforeSendHook( + chainID: string, + denom: string + ): Promise { + return this.getReqFromChainID(chainID).get( + `/osmosis/tokenfactory/v1beta1/denoms/${denom}/before_send_hook` + ); + } }