Skip to content

Commit

Permalink
Merge pull request #26 from oraichain/chore/update-sdk
Browse files Browse the repository at this point in the history
update margin vamm sdk
  • Loading branch information
trung2891 authored Apr 19, 2024
2 parents dbe6010 + fecfb49 commit f4679b6
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 3 deletions.
Binary file modified packages/contracts-build/data/margined_engine.wasm
Binary file not shown.
Binary file modified packages/contracts-build/data/margined_fee_pool.wasm
Binary file not shown.
Binary file modified packages/contracts-build/data/margined_insurance_fund.wasm
Binary file not shown.
Binary file modified packages/contracts-build/data/margined_pricefeed.wasm
Binary file not shown.
Binary file modified packages/contracts-build/data/margined_vamm.wasm
Binary file not shown.
4 changes: 2 additions & 2 deletions packages/contracts-build/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@oraichain/oraimargin-contracts-build",
"version": "1.1.2",
"version": "1.1.3",
"main": "build/index.js",
"files": [
"build/",
"data/"
],
"license": "MIT",
"dependencies": {
"@oraichain/oraimargin-contracts-sdk": "^1.1.1"
"@oraichain/oraimargin-contracts-sdk": "^1.1.2"
},
"scripts": {
"build": "tsc -p tsconfig.json"
Expand Down
2 changes: 1 addition & 1 deletion packages/contracts-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oraichain/oraimargin-contracts-sdk",
"version": "1.1.1",
"version": "1.1.2",
"main": "build/index.js",
"files": [
"build/"
Expand Down
51 changes: 51 additions & 0 deletions packages/contracts-sdk/src/MarginedVamm.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,21 @@ export interface MarginedVammInterface extends MarginedVammReadOnlyInterface {
fluctuationLimitRatio?: Uint128;
liquidityMultiplier: Uint128;
}, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
repegPrice: ({
newPrice
}: {
newPrice?: Uint128;
}, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
addWhitelist: ({
address
}: {
address: string;
}, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
removeWhitelist: ({
address
}: {
address: string;
}, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
}
export class MarginedVammClient extends MarginedVammQueryClient implements MarginedVammInterface {
client: SigningCosmWasmClient;
Expand All @@ -354,6 +369,9 @@ export class MarginedVammClient extends MarginedVammQueryClient implements Margi
this.settleFunding = this.settleFunding.bind(this);
this.setOpen = this.setOpen.bind(this);
this.migrateLiquidity = this.migrateLiquidity.bind(this);
this.repegPrice = this.repegPrice.bind(this);
this.addWhitelist = this.addWhitelist.bind(this);
this.removeWhitelist = this.removeWhitelist.bind(this);
}

updateConfig = async ({
Expand Down Expand Up @@ -478,4 +496,37 @@ export class MarginedVammClient extends MarginedVammQueryClient implements Margi
}
}, _fee, _memo, _funds);
};
repegPrice = async ({
newPrice
}: {
newPrice?: Uint128;
}, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
repeg_price: {
new_price: newPrice
}
}, _fee, _memo, _funds);
};
addWhitelist = async ({
address
}: {
address: string;
}, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
add_whitelist: {
address
}
}, _fee, _memo, _funds);
};
removeWhitelist = async ({
address
}: {
address: string;
}, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
remove_whitelist: {
address
}
}, _fee, _memo, _funds);
};
}
12 changes: 12 additions & 0 deletions packages/contracts-sdk/src/MarginedVamm.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ export type ExecuteMsg = {
fluctuation_limit_ratio?: Uint128 | null;
liquidity_multiplier: Uint128;
};
} | {
repeg_price: {
new_price?: Uint128 | null;
};
} | {
add_whitelist: {
address: string;
};
} | {
remove_whitelist: {
address: string;
};
};
export type QueryMsg = {
config: {};
Expand Down

0 comments on commit f4679b6

Please sign in to comment.