Skip to content

Commit

Permalink
fix: exports
Browse files Browse the repository at this point in the history
  • Loading branch information
bangjelkoski committed Sep 19, 2022
1 parent 0c98c3c commit a232ce7
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 114 deletions.
2 changes: 1 addition & 1 deletion packages/sdk-ts/src/client/chain/rest/ChainRestBankApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { BalancesResponse, DenomBalance } from './../types/bank-rest'
/**
* @category Chain Rest API
*/
export class ChainRestAuthApi extends BaseRestConsumer {
export class ChainRestBankApi extends BaseRestConsumer {
/**
* Get address's balance
*
Expand Down
1 change: 1 addition & 0 deletions packages/sdk-ts/src/client/chain/rest/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { ChainRestBankApi } from './ChainRestBankApi'
export { ChainRestAuthApi } from './ChainRestAuthApi'
export { ChainRestTendermintApi } from './ChainRestTendermintApi'
2 changes: 2 additions & 0 deletions packages/sdk-ts/src/client/chain/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export * from './auction'
export * from './auth-rest'
export * from './bank-rest'
export * from './tendermint-rest'
export * from './bank'
export * from './derivatives'
export * from './distribution'
Expand Down
6 changes: 2 additions & 4 deletions packages/sdk-ts/src/core/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export * from './modules'

// Not exported by default
// export * from './eip712'
// export * from './transaction'
export * from './eip712'
export * from './transaction'
11 changes: 5 additions & 6 deletions packages/sdk-ts/src/core/transaction/client/TxRestClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
TxInfo,
TxResultResponse,
} from '../types/tx-rest-client'
import { APIParams } from '../types/rest-client'
import { TxClient } from './TxClient'
import { TxClientBroadcastOptions, TxConcreteClient } from '../types/tx'

Expand All @@ -22,7 +21,7 @@ export class TxRestClient implements TxConcreteClient {
})
}

public async fetchTx(txHash: string, params: APIParams = {}) {
public async fetchTx(txHash: string, params: any = {}) {
try {
const response = await this.getRaw<TxResultResponse>(
`/cosmos/tx/v1beta1/txs/${txHash}`,
Expand Down Expand Up @@ -168,19 +167,19 @@ export class TxRestClient implements TxConcreteClient {

private async postRaw<T>(
endpoint: string,
params: URLSearchParams | APIParams = {},
params: URLSearchParams | any = {},
): Promise<T> {
return this.httpClient
.post<URLSearchParams | APIParams, { data: T }>(endpoint, params)
.post<URLSearchParams | any, { data: T }>(endpoint, params)
.then((d) => d.data)
}

private async getRaw<T>(
endpoint: string,
params: URLSearchParams | APIParams = {},
params: URLSearchParams | any = {},
): Promise<T> {
return this.httpClient
.get<URLSearchParams | APIParams, { data: T }>(endpoint, params)
.get<URLSearchParams | any, { data: T }>(endpoint, params)
.then((d) => d.data)
}
}
1 change: 1 addition & 0 deletions packages/sdk-ts/src/core/transaction/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './tx'
export * from './utils'
export * from './types'
export * from './client'
68 changes: 0 additions & 68 deletions packages/sdk-ts/src/core/transaction/types/block.ts

This file was deleted.

2 changes: 2 additions & 0 deletions packages/sdk-ts/src/core/transaction/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './tx'
export * from './tx-rest-client'
20 changes: 0 additions & 20 deletions packages/sdk-ts/src/core/transaction/types/rest-client.ts

This file was deleted.

30 changes: 15 additions & 15 deletions packages/sdk-ts/src/core/transaction/types/tx-rest-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@ import { Fee, ModeInfo } from '@injectivelabs/chain-api/cosmos/tx/v1beta1/tx_pb'
import { PublicKey } from '@injectivelabs/chain-api/tendermint/crypto/keys_pb'

/* eslint-disable camelcase */
export interface SignerInfo {
export interface RestSignerInfo {
public_key: PublicKey | null
mode_info: ModeInfo
sequence: string
}

export interface AuthInfo {
signer_infos: SignerInfo[]
export interface RestAuthInfo {
signer_infos: RestSignerInfo[]
fee: Fee
}

export interface TxBody {
export interface RestTxBody {
messages: any[]
memo: string
timeout_height: string
}

export interface Tx {
body: TxBody
auth_info: AuthInfo
export interface RestTx {
body: RestTxBody
auth_info: RestAuthInfo
signatures: string[]
}

export interface TxLog {
export interface RestTxLog {
msg_index: number
log: string
events: { type: string; attributes: { key: string; value: string }[] }[]
Expand All @@ -38,11 +38,11 @@ export interface TxInfoResponse {
code: number
data: string
raw_log: string
logs: TxLog[]
logs: RestTxLog[]
info: string
gas_wanted: string
gas_used: string
tx: Tx
tx: RestTx
timestamp: string
}

Expand All @@ -55,9 +55,9 @@ export interface TxInfo {
rawLog: string
gasWanted: string
gasUsed: string
logs: TxLog[]
logs: RestTxLog[]
info: string
tx: Tx
tx: RestTx
timestamp: string
}

Expand All @@ -68,12 +68,12 @@ export enum BroadcastMode {
}

export interface TxResultResponse {
tx: Tx
tx: RestTx
tx_response: TxInfoResponse
}

export interface TxResult {
tx: Tx
tx: RestTx
txResponse: TxInfo
}

Expand All @@ -83,7 +83,7 @@ export interface TxSearchResult {
}

export interface TxSearchResultParams {
txs: Tx
txs: RestTx[]
tx_responses: TxInfo
pagination: any
}
Expand Down

0 comments on commit a232ce7

Please sign in to comment.