-
Notifications
You must be signed in to change notification settings - Fork 195
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 bec0bc4
Showing
8 changed files
with
194 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
26 changes: 26 additions & 0 deletions
26
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,26 @@ | ||
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 { limit, startAfter } = this.params; | ||
|
||
const query: any = { get_all_lending_rates: {} }; | ||
if (limit !== undefined) { | ||
query.get_all_lending_rates.limit = limit; | ||
} | ||
if (startAfter !== undefined) { | ||
query.get_all_lending_rates.start_after = startAfter; | ||
} | ||
|
||
return toBase64(query); | ||
} | ||
} |
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