-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add lending rate query for neptune service
- Loading branch information
1 parent
60704a2
commit ee7c941
Showing
8 changed files
with
191 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { AssetInfo } from './types.js' | ||
|
||
export function getDenom(assetInfo: AssetInfo): string | undefined { | ||
if ('native_token' in assetInfo) { | ||
return assetInfo.native_token.denom | ||
} | ||
|
||
return assetInfo.token.contract_addr | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
export * from './queries' | ||
export * from './transformer' | ||
export * from './types' | ||
export * from './service' | ||
export * from './types.js' | ||
export * from './service.js' | ||
export * from './transformer.js' | ||
export * from './queries/index.js' | ||
|
||
export const NEPTUNE_PRICE_CONTRACT = 'inj1u6cclz0qh5tep9m2qayry9k97dm46pnlqf8nre' |
6 changes: 3 additions & 3 deletions
6
packages/sdk-ts/src/client/wasm/neptune/queries/QueryGetPrices.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/sdk-ts/src/client/wasm/neptune/queries/QueryLendingRates.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { BaseWasmQuery } from '../../BaseWasmQuery.js'; | ||
import { toBase64 } from '../../../../utils/index.js'; | ||
import { AssetInfo } from '../types.js'; | ||
|
||
export declare namespace QueryGetAllLendingRates { | ||
export interface Params { | ||
limit?: number; | ||
startAfter?: AssetInfo; | ||
} | ||
} | ||
|
||
export class QueryGetAllLendingRates extends BaseWasmQuery<QueryGetAllLendingRates.Params> { | ||
toPayload() { | ||
const payload = { | ||
get_all_lending_rates: { | ||
...(this.params.limit !== undefined ? { limit: this.params.limit } : {}), | ||
...(this.params.startAfter ? { start_after: this.params.startAfter } : {}), | ||
}, | ||
}; | ||
|
||
return toBase64(payload); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export { QueryGetPrices } from './QueryGetPrices' | ||
export { QueryGetPrices } from './QueryGetPrices.js' | ||
export { QueryGetAllLendingRates } from './QueryLendingRates.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters