-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from nolus-protocol/v2.0.0
V2.0.0 - cosmos-sdk v0.47 and nolus-money-market v0.4 compatibility
- Loading branch information
Showing
21 changed files
with
209 additions
and
175 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
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
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,34 @@ | ||
import { CosmWasmClient } from '@cosmjs/cosmwasm-stargate'; | ||
import { getProtocolsMsg, getProtocolMsg } from '../messages'; | ||
import { Protocol } from '../types'; | ||
|
||
/** | ||
* The Admin contract is a contract that governs the storing and migration process of all smart contracts on the blockchain. | ||
* | ||
* Usage: | ||
* | ||
* ```ts | ||
* import { NolusClient, NolusContracts } from '@nolus/nolusjs'; | ||
* | ||
* const cosm = await NolusClient.getInstance().getCosmWasmClient(); | ||
* adminInstance = new NolusContracts.Admin(cosm, adminContractAddress); | ||
* ``` | ||
* | ||
*/ | ||
export class Admin { | ||
private cosmWasmClient!: CosmWasmClient; | ||
private _contractAddress: string; | ||
|
||
constructor(cosmWasmClient: CosmWasmClient, contractAddress: string) { | ||
this.cosmWasmClient = cosmWasmClient; | ||
this._contractAddress = contractAddress; | ||
} | ||
|
||
public async getProtocols(): Promise<string[]> { | ||
return await this.cosmWasmClient.queryContractSmart(this._contractAddress, getProtocolsMsg()); | ||
} | ||
|
||
public async getProtocol(protocol: string): Promise<Protocol> { | ||
return await this.cosmWasmClient.queryContractSmart(this._contractAddress, getProtocolMsg(protocol)); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export const getProtocolsMsg = () => { | ||
return { | ||
protocols: {}, | ||
}; | ||
}; | ||
|
||
export const getProtocolMsg = (protocolName: string) => { | ||
return { | ||
protocol: { | ||
protocol: protocolName, | ||
}, | ||
}; | ||
}; |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export interface Asset { | ||
amount: string; | ||
ticker: string; | ||
ticker?: string; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
import { OraclePriceConfig } from './OraclePriceConfig'; | ||
|
||
export interface OracleConfig { | ||
config: { | ||
base_asset: string; | ||
price_config: OraclePriceConfig; | ||
}; | ||
owner: string; | ||
base_asset: string; | ||
price_config: OraclePriceConfig; | ||
} |
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,6 @@ | ||
import { ProtocolContracts } from './ProtocolContracts'; | ||
|
||
export interface Protocol { | ||
contracts: ProtocolContracts; | ||
network: string; | ||
} |
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,6 @@ | ||
export interface ProtocolContracts { | ||
leaser: string; | ||
lpp: string; | ||
oracle: string; | ||
profit: string; | ||
} |
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
Oops, something went wrong.