Skip to content

Commit

Permalink
chore: update oraiswap v3 sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
vuonghuuhung committed Sep 30, 2024
1 parent 835a928 commit fca1e4f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
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/oraidex-contracts-sdk",
"version": "1.0.53-beta.1",
"version": "1.0.53-beta.2",
"main": "build/index.js",
"files": [
"build/",
Expand Down
9 changes: 8 additions & 1 deletion packages/contracts-sdk/src/OraiswapV3.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@

import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate";
import { Coin, StdFee } from "@cosmjs/amino";
import {Percentage, InstantiateMsg, ExecuteMsg, Addr, Liquidity, SqrtPrice, TokenAmount, Binary, Expiration, Timestamp, Uint64, AssetInfo, PoolKey, FeeTier, SwapHop, NftExtensionMsg, QueryMsg, MigrateMsg, FeeGrowth, AllNftInfoResponse, OwnerOfResponse, Approval, NftInfoResponse, Position, PositionIncentives, ArrayOfPosition, TokensResponse, ApprovedForAllResponse, Boolean, ArrayOfFeeTier, ArrayOfLiquidityTick, LiquidityTick, Uint32, NumTokensResponse, Pool, IncentiveRecord, ArrayOfPoolWithPoolKey, PoolWithPoolKey, Uint128, ArrayOfAsset, Asset, ArrayOfPositionTick, PositionTick, QuoteResult, Tick, TickIncentive, ArrayOfTupleOfUint16AndUint64} from "./OraiswapV3.types";
import {Addr, Percentage, InstantiateMsg, ExecuteMsg, Liquidity, SqrtPrice, TokenAmount, Binary, Expiration, Timestamp, Uint64, AssetInfo, PoolKey, FeeTier, SwapHop, NftExtensionMsg, QueryMsg, MigrateMsg, FeeGrowth, AllNftInfoResponse, OwnerOfResponse, Approval, NftInfoResponse, Position, PositionIncentives, ArrayOfPosition, TokensResponse, ApprovedForAllResponse, Boolean, ArrayOfFeeTier, ArrayOfLiquidityTick, LiquidityTick, Uint32, NumTokensResponse, Pool, IncentiveRecord, ArrayOfPoolWithPoolKey, PoolWithPoolKey, Uint128, ArrayOfAsset, Asset, ArrayOfPositionTick, PositionTick, QuoteResult, Tick, TickIncentive, ArrayOfTupleOfUint16AndUint64} from "./OraiswapV3.types";
export interface OraiswapV3ReadOnlyInterface {
contractAddress: string;
admin: () => Promise<Addr>;
protocolFee: () => Promise<Percentage>;
incentivesFundManager: () => Promise<Addr>;
position: ({
index,
ownerId
Expand Down Expand Up @@ -205,6 +206,7 @@ export class OraiswapV3QueryClient implements OraiswapV3ReadOnlyInterface {
this.contractAddress = contractAddress;
this.admin = this.admin.bind(this);
this.protocolFee = this.protocolFee.bind(this);
this.incentivesFundManager = this.incentivesFundManager.bind(this);
this.position = this.position.bind(this);
this.positions = this.positions.bind(this);
this.allPosition = this.allPosition.bind(this);
Expand Down Expand Up @@ -243,6 +245,11 @@ export class OraiswapV3QueryClient implements OraiswapV3ReadOnlyInterface {
protocol_fee: {}
});
};
incentivesFundManager = async (): Promise<Addr> => {
return this.client.queryContractSmart(this.contractAddress, {
incentives_fund_manager: {}
});
};
position = async ({
index,
ownerId
Expand Down
5 changes: 4 additions & 1 deletion packages/contracts-sdk/src/OraiswapV3.types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export type Addr = string;
export type Percentage = number;
export interface InstantiateMsg {
incentives_fund_manager: Addr;
protocol_fee: Percentage;
}
export type ExecuteMsg = {
Expand Down Expand Up @@ -132,7 +134,6 @@ export type ExecuteMsg = {
index: number;
};
};
export type Addr = string;
export type Liquidity = string;
export type SqrtPrice = string;
export type TokenAmount = string;
Expand Down Expand Up @@ -180,6 +181,8 @@ export type QueryMsg = {
admin: {};
} | {
protocol_fee: {};
} | {
incentives_fund_manager: {};
} | {
position: {
index: number;
Expand Down

0 comments on commit fca1e4f

Please sign in to comment.