diff --git a/packages/contracts-build/data/coharvest-bid-pool.wasm b/packages/contracts-build/data/coharvest-bid-pool.wasm deleted file mode 100644 index 45b2c567..00000000 Binary files a/packages/contracts-build/data/coharvest-bid-pool.wasm and /dev/null differ diff --git a/packages/contracts-build/data/cw20-staking-proxy-snapshot.wasm b/packages/contracts-build/data/cw20-staking-proxy-snapshot.wasm index 62d24e07..68d43ede 100644 Binary files a/packages/contracts-build/data/cw20-staking-proxy-snapshot.wasm and b/packages/contracts-build/data/cw20-staking-proxy-snapshot.wasm differ diff --git a/packages/contracts-build/data/cw20-staking.wasm b/packages/contracts-build/data/cw20-staking.wasm index 6b638ea4..cc733ac1 100644 Binary files a/packages/contracts-build/data/cw20-staking.wasm and b/packages/contracts-build/data/cw20-staking.wasm differ diff --git a/packages/contracts-build/data/oraidex-listing-contract.wasm b/packages/contracts-build/data/oraidex-listing-contract.wasm index 87a21939..a08fd817 100644 Binary files a/packages/contracts-build/data/oraidex-listing-contract.wasm and b/packages/contracts-build/data/oraidex-listing-contract.wasm differ diff --git a/packages/contracts-build/data/oraiswap-converter.wasm b/packages/contracts-build/data/oraiswap-converter.wasm index 5b3f70fe..458c13ee 100644 Binary files a/packages/contracts-build/data/oraiswap-converter.wasm and b/packages/contracts-build/data/oraiswap-converter.wasm differ diff --git a/packages/contracts-build/data/oraiswap-factory.wasm b/packages/contracts-build/data/oraiswap-factory.wasm index b964b2b9..a9ab9501 100644 Binary files a/packages/contracts-build/data/oraiswap-factory.wasm and b/packages/contracts-build/data/oraiswap-factory.wasm differ diff --git a/packages/contracts-build/data/oraiswap-limit-order.wasm b/packages/contracts-build/data/oraiswap-limit-order.wasm index a3095e8e..465cf550 100644 Binary files a/packages/contracts-build/data/oraiswap-limit-order.wasm and b/packages/contracts-build/data/oraiswap-limit-order.wasm differ diff --git a/packages/contracts-build/data/oraiswap-oracle.wasm b/packages/contracts-build/data/oraiswap-oracle.wasm index 4706aefe..abec5398 100644 Binary files a/packages/contracts-build/data/oraiswap-oracle.wasm and b/packages/contracts-build/data/oraiswap-oracle.wasm differ diff --git a/packages/contracts-build/data/oraiswap-pair.wasm b/packages/contracts-build/data/oraiswap-pair.wasm index c2670966..1d47fd8c 100644 Binary files a/packages/contracts-build/data/oraiswap-pair.wasm and b/packages/contracts-build/data/oraiswap-pair.wasm differ diff --git a/packages/contracts-build/data/oraiswap-rewarder.wasm b/packages/contracts-build/data/oraiswap-rewarder.wasm index a1f0d1cb..b17b702b 100644 Binary files a/packages/contracts-build/data/oraiswap-rewarder.wasm and b/packages/contracts-build/data/oraiswap-rewarder.wasm differ diff --git a/packages/contracts-build/data/oraiswap-router.wasm b/packages/contracts-build/data/oraiswap-router.wasm index 02570caa..70cd94d3 100644 Binary files a/packages/contracts-build/data/oraiswap-router.wasm and b/packages/contracts-build/data/oraiswap-router.wasm differ diff --git a/packages/contracts-build/data/oraiswap-staking.wasm b/packages/contracts-build/data/oraiswap-staking.wasm index fc3cb2fd..1c490225 100644 Binary files a/packages/contracts-build/data/oraiswap-staking.wasm and b/packages/contracts-build/data/oraiswap-staking.wasm differ diff --git a/packages/contracts-build/data/oraiswap-token.wasm b/packages/contracts-build/data/oraiswap-token.wasm index 4a2694fd..5f5c5332 100644 Binary files a/packages/contracts-build/data/oraiswap-token.wasm and b/packages/contracts-build/data/oraiswap-token.wasm differ diff --git a/packages/contracts-build/data/oraiswap_converter.wasm b/packages/contracts-build/data/oraiswap_converter.wasm deleted file mode 100644 index ee37fadd..00000000 Binary files a/packages/contracts-build/data/oraiswap_converter.wasm and /dev/null differ diff --git a/packages/contracts-build/data/oraiswap_factory.wasm b/packages/contracts-build/data/oraiswap_factory.wasm deleted file mode 100644 index 16fe80d7..00000000 Binary files a/packages/contracts-build/data/oraiswap_factory.wasm and /dev/null differ diff --git a/packages/contracts-build/data/oraiswap_limit_order.wasm b/packages/contracts-build/data/oraiswap_limit_order.wasm deleted file mode 100644 index f4ce5b38..00000000 Binary files a/packages/contracts-build/data/oraiswap_limit_order.wasm and /dev/null differ diff --git a/packages/contracts-build/data/oraiswap_oracle.wasm b/packages/contracts-build/data/oraiswap_oracle.wasm deleted file mode 100644 index 494d4247..00000000 Binary files a/packages/contracts-build/data/oraiswap_oracle.wasm and /dev/null differ diff --git a/packages/contracts-build/data/oraiswap_pair.wasm b/packages/contracts-build/data/oraiswap_pair.wasm deleted file mode 100644 index 300d55c8..00000000 Binary files a/packages/contracts-build/data/oraiswap_pair.wasm and /dev/null differ diff --git a/packages/contracts-build/data/oraiswap_rewarder.wasm b/packages/contracts-build/data/oraiswap_rewarder.wasm deleted file mode 100644 index 12cae8eb..00000000 Binary files a/packages/contracts-build/data/oraiswap_rewarder.wasm and /dev/null differ diff --git a/packages/contracts-build/data/oraiswap_router.wasm b/packages/contracts-build/data/oraiswap_router.wasm deleted file mode 100644 index 4685e042..00000000 Binary files a/packages/contracts-build/data/oraiswap_router.wasm and /dev/null differ diff --git a/packages/contracts-build/data/oraiswap_staking.wasm b/packages/contracts-build/data/oraiswap_staking.wasm deleted file mode 100644 index fbe2364f..00000000 Binary files a/packages/contracts-build/data/oraiswap_staking.wasm and /dev/null differ diff --git a/packages/contracts-build/data/oraiswap_token.wasm b/packages/contracts-build/data/oraiswap_token.wasm deleted file mode 100644 index 4a0396dd..00000000 Binary files a/packages/contracts-build/data/oraiswap_token.wasm and /dev/null differ diff --git a/packages/contracts-build/package.json b/packages/contracts-build/package.json index 269c75d1..6fc8b2fe 100644 --- a/packages/contracts-build/package.json +++ b/packages/contracts-build/package.json @@ -1,6 +1,6 @@ { "name": "@oraichain/oraidex-contracts-build", - "version": "1.0.29", + "version": "1.0.30", "main": "build/index.js", "license": "MIT", "scripts": { diff --git a/packages/contracts-build/src/index.ts b/packages/contracts-build/src/index.ts index 6e4586dd..d0d19b1c 100644 --- a/packages/contracts-build/src/index.ts +++ b/packages/contracts-build/src/index.ts @@ -3,14 +3,14 @@ import { readFileSync } from "fs"; import path from "path"; export type ContractName = - | "oraiswap_token" + | "oraiswap-token" | "oraiswap_limit_order" - | "oraiswap_pair" - | "oraiswap_oracle" + | "oraiswap-pair" + | "oraiswap-oracle" | "oraiswap_converter" - | "oraiswap_factory" + | "oraiswap-factory" | "oraiswap_rewarder" - | "oraiswap_router" + | "oraiswap-router" | "oraiswap_staking" | "oraidex-listing-contract"; diff --git a/packages/contracts-sdk/package.json b/packages/contracts-sdk/package.json index e1f720b2..13198e25 100644 --- a/packages/contracts-sdk/package.json +++ b/packages/contracts-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@oraichain/oraidex-contracts-sdk", - "version": "1.0.40", + "version": "1.0.41", "main": "build/index.js", "files": [ "build/", diff --git a/packages/contracts-sdk/src/CoharvestBidPool.client.ts b/packages/contracts-sdk/src/CoharvestBidPool.client.ts deleted file mode 100644 index 6b9af373..00000000 --- a/packages/contracts-sdk/src/CoharvestBidPool.client.ts +++ /dev/null @@ -1,446 +0,0 @@ -/** -* This file was automatically generated by @oraichain/ts-codegen@0.35.8. -* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, -* and run the @oraichain/ts-codegen generate command to regenerate this file. -*/ - -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { Coin, StdFee } from "@cosmjs/amino"; -import {AssetInfo, Addr, Uint128, Decimal, Binary, Cw20ReceiveMsg} from "./types"; -import {InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, ArrayOfBid, Bid, ArrayOfBidPool, BidPool, BiddingInfoResponse, BiddingInfo, DistributionInfo, ArrayOfUint64, Config, EstimateAmountReceiveOfBidResponse, Uint64} from "./CoharvestBidPool.types"; -export interface CoharvestBidPoolReadOnlyInterface { - contractAddress: string; - config: () => Promise; - bid: ({ - idx - }: { - idx: number; - }) => Promise; - biddingInfo: ({ - round - }: { - round: number; - }) => Promise; - lastRoundId: () => Promise; - bidPool: ({ - round, - slot - }: { - round: number; - slot: number; - }) => Promise; - allBidPoolInRound: ({ - round - }: { - round: number; - }) => Promise; - allBidInRound: ({ - limit, - round, - startAfter - }: { - limit?: number; - round: number; - startAfter?: number; - }) => Promise; - bidsIdxByUser: ({ - round, - user - }: { - round: number; - user: Addr; - }) => Promise; - bidsByUser: ({ - round, - user - }: { - round: number; - user: Addr; - }) => Promise; - estimateAmountReceiveOfBid: ({ - exchangeRate, - idx, - round - }: { - exchangeRate: Decimal; - idx: number; - round: number; - }) => Promise; - estimateAmountReceive: ({ - bidAmount, - exchangeRate, - round, - slot - }: { - bidAmount: Uint128; - exchangeRate: Decimal; - round: number; - slot: number; - }) => Promise; - numbersBidInRound: ({ - round - }: { - round: number; - }) => Promise; -} -export class CoharvestBidPoolQueryClient implements CoharvestBidPoolReadOnlyInterface { - client: CosmWasmClient; - contractAddress: string; - - constructor(client: CosmWasmClient, contractAddress: string) { - this.client = client; - this.contractAddress = contractAddress; - this.config = this.config.bind(this); - this.bid = this.bid.bind(this); - this.biddingInfo = this.biddingInfo.bind(this); - this.lastRoundId = this.lastRoundId.bind(this); - this.bidPool = this.bidPool.bind(this); - this.allBidPoolInRound = this.allBidPoolInRound.bind(this); - this.allBidInRound = this.allBidInRound.bind(this); - this.bidsIdxByUser = this.bidsIdxByUser.bind(this); - this.bidsByUser = this.bidsByUser.bind(this); - this.estimateAmountReceiveOfBid = this.estimateAmountReceiveOfBid.bind(this); - this.estimateAmountReceive = this.estimateAmountReceive.bind(this); - this.numbersBidInRound = this.numbersBidInRound.bind(this); - } - - config = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - config: {} - }); - }; - bid = async ({ - idx - }: { - idx: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - bid: { - idx - } - }); - }; - biddingInfo = async ({ - round - }: { - round: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - bidding_info: { - round - } - }); - }; - lastRoundId = async (): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - last_round_id: {} - }); - }; - bidPool = async ({ - round, - slot - }: { - round: number; - slot: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - bid_pool: { - round, - slot - } - }); - }; - allBidPoolInRound = async ({ - round - }: { - round: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - all_bid_pool_in_round: { - round - } - }); - }; - allBidInRound = async ({ - limit, - round, - startAfter - }: { - limit?: number; - round: number; - startAfter?: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - all_bid_in_round: { - limit, - round, - start_after: startAfter - } - }); - }; - bidsIdxByUser = async ({ - round, - user - }: { - round: number; - user: Addr; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - bids_idx_by_user: { - round, - user - } - }); - }; - bidsByUser = async ({ - round, - user - }: { - round: number; - user: Addr; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - bids_by_user: { - round, - user - } - }); - }; - estimateAmountReceiveOfBid = async ({ - exchangeRate, - idx, - round - }: { - exchangeRate: Decimal; - idx: number; - round: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - estimate_amount_receive_of_bid: { - exchange_rate: exchangeRate, - idx, - round - } - }); - }; - estimateAmountReceive = async ({ - bidAmount, - exchangeRate, - round, - slot - }: { - bidAmount: Uint128; - exchangeRate: Decimal; - round: number; - slot: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - estimate_amount_receive: { - bid_amount: bidAmount, - exchange_rate: exchangeRate, - round, - slot - } - }); - }; - numbersBidInRound = async ({ - round - }: { - round: number; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - numbers_bid_in_round: { - round - } - }); - }; -} -export interface CoharvestBidPoolInterface extends CoharvestBidPoolReadOnlyInterface { - contractAddress: string; - sender: string; - receive: ({ - amount, - msg, - sender - }: { - amount: Uint128; - msg: Binary; - sender: string; - }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; - updateConfig: ({ - distributionToken, - maxSlot, - minDepositAmount, - owner, - premiumRatePerSlot, - underlyingToken - }: { - distributionToken?: AssetInfo; - maxSlot?: number; - minDepositAmount?: Uint128; - owner?: Addr; - premiumRatePerSlot?: Decimal; - underlyingToken?: AssetInfo; - }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; - createNewRound: ({ - endTime, - startTime, - totalBidThreshold, - totalDistribution - }: { - endTime: number; - startTime: number; - totalBidThreshold: Uint128; - totalDistribution: Uint128; - }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; - finalizeBiddingRoundResult: ({ - exchangeRate, - round - }: { - exchangeRate: Decimal; - round: number; - }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; - distribute: ({ - limit, - round, - startAfter - }: { - limit?: number; - round: number; - startAfter?: number; - }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; - submitBid: ({ - premiumSlot, - round - }: { - premiumSlot: number; - round: number; - }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; -} -export class CoharvestBidPoolClient extends CoharvestBidPoolQueryClient implements CoharvestBidPoolInterface { - client: SigningCosmWasmClient; - sender: string; - contractAddress: string; - - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { - super(client, contractAddress); - this.client = client; - this.sender = sender; - this.contractAddress = contractAddress; - this.receive = this.receive.bind(this); - this.updateConfig = this.updateConfig.bind(this); - this.createNewRound = this.createNewRound.bind(this); - this.finalizeBiddingRoundResult = this.finalizeBiddingRoundResult.bind(this); - this.distribute = this.distribute.bind(this); - this.submitBid = this.submitBid.bind(this); - } - - receive = async ({ - amount, - msg, - sender - }: { - amount: Uint128; - msg: Binary; - sender: string; - }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - receive: { - amount, - msg, - sender - } - }, _fee, _memo, _funds); - }; - updateConfig = async ({ - distributionToken, - maxSlot, - minDepositAmount, - owner, - premiumRatePerSlot, - underlyingToken - }: { - distributionToken?: AssetInfo; - maxSlot?: number; - minDepositAmount?: Uint128; - owner?: Addr; - premiumRatePerSlot?: Decimal; - underlyingToken?: AssetInfo; - }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - update_config: { - distribution_token: distributionToken, - max_slot: maxSlot, - min_deposit_amount: minDepositAmount, - owner, - premium_rate_per_slot: premiumRatePerSlot, - underlying_token: underlyingToken - } - }, _fee, _memo, _funds); - }; - createNewRound = async ({ - endTime, - startTime, - totalBidThreshold, - totalDistribution - }: { - endTime: number; - startTime: number; - totalBidThreshold: Uint128; - totalDistribution: Uint128; - }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - create_new_round: { - end_time: endTime, - start_time: startTime, - total_bid_threshold: totalBidThreshold, - total_distribution: totalDistribution - } - }, _fee, _memo, _funds); - }; - finalizeBiddingRoundResult = async ({ - exchangeRate, - round - }: { - exchangeRate: Decimal; - round: number; - }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - finalize_bidding_round_result: { - exchange_rate: exchangeRate, - round - } - }, _fee, _memo, _funds); - }; - distribute = async ({ - limit, - round, - startAfter - }: { - limit?: number; - round: number; - startAfter?: number; - }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - distribute: { - limit, - round, - start_after: startAfter - } - }, _fee, _memo, _funds); - }; - submitBid = async ({ - premiumSlot, - round - }: { - premiumSlot: number; - round: number; - }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - submit_bid: { - premium_slot: premiumSlot, - round - } - }, _fee, _memo, _funds); - }; -} \ No newline at end of file diff --git a/packages/contracts-sdk/src/CoharvestBidPool.types.ts b/packages/contracts-sdk/src/CoharvestBidPool.types.ts deleted file mode 100644 index 885440b7..00000000 --- a/packages/contracts-sdk/src/CoharvestBidPool.types.ts +++ /dev/null @@ -1,152 +0,0 @@ -import {AssetInfo, Addr, Uint128, Decimal, Binary, Cw20ReceiveMsg} from "./types"; -export interface InstantiateMsg { - distribution_token: AssetInfo; - max_slot: number; - min_deposit_amount: Uint128; - owner: Addr; - premium_rate_per_slot: Decimal; - underlying_token: AssetInfo; -} -export type ExecuteMsg = { - receive: Cw20ReceiveMsg; -} | { - update_config: { - distribution_token?: AssetInfo | null; - max_slot?: number | null; - min_deposit_amount?: Uint128 | null; - owner?: Addr | null; - premium_rate_per_slot?: Decimal | null; - underlying_token?: AssetInfo | null; - }; -} | { - create_new_round: { - end_time: number; - start_time: number; - total_bid_threshold: Uint128; - total_distribution: Uint128; - }; -} | { - finalize_bidding_round_result: { - exchange_rate: Decimal; - round: number; - }; -} | { - distribute: { - limit?: number | null; - round: number; - start_after?: number | null; - }; -} | { - submit_bid: { - premium_slot: number; - round: number; - }; -}; -export type QueryMsg = { - config: {}; -} | { - bid: { - idx: number; - }; -} | { - bidding_info: { - round: number; - }; -} | { - last_round_id: {}; -} | { - bid_pool: { - round: number; - slot: number; - }; -} | { - all_bid_pool_in_round: { - round: number; - }; -} | { - all_bid_in_round: { - limit?: number | null; - round: number; - start_after?: number | null; - }; -} | { - bids_idx_by_user: { - round: number; - user: Addr; - }; -} | { - bids_by_user: { - round: number; - user: Addr; - }; -} | { - estimate_amount_receive_of_bid: { - exchange_rate: Decimal; - idx: number; - round: number; - }; -} | { - estimate_amount_receive: { - bid_amount: Uint128; - exchange_rate: Decimal; - round: number; - slot: number; - }; -} | { - numbers_bid_in_round: { - round: number; - }; -}; -export interface MigrateMsg {} -export type ArrayOfBid = Bid[]; -export interface Bid { - amount: Uint128; - amount_received: Uint128; - bidder: Addr; - idx: number; - is_distributed: boolean; - premium_slot: number; - residue_bid: Uint128; - round: number; - timestamp: number; -} -export type ArrayOfBidPool = BidPool[]; -export interface BidPool { - index_snapshot: Decimal; - premium_rate: Decimal; - received_per_token: Decimal; - slot: number; - total_bid_amount: Uint128; -} -export interface BiddingInfoResponse { - bid_info: BiddingInfo; - distribution_info: DistributionInfo; -} -export interface BiddingInfo { - end_time: number; - round: number; - start_time: number; - total_bid_amount: Uint128; - total_bid_matched: Uint128; -} -export interface DistributionInfo { - actual_distributed: Uint128; - exchange_rate: Decimal; - is_released: boolean; - num_bids_distributed: number; - total_distribution: Uint128; -} -export type ArrayOfUint64 = number[]; -export interface Config { - distribution_token: AssetInfo; - max_slot: number; - min_deposit_amount: Uint128; - owner: Addr; - premium_rate_per_slot: Decimal; - underlying_token: AssetInfo; -} -export interface EstimateAmountReceiveOfBidResponse { - receive: Uint128; - residue_bid: Uint128; -} -export type Uint64 = number; \ No newline at end of file diff --git a/packages/contracts-sdk/src/Cw20Staking.client.ts b/packages/contracts-sdk/src/Cw20Staking.client.ts index f1588d85..2aafb150 100644 --- a/packages/contracts-sdk/src/Cw20Staking.client.ts +++ b/packages/contracts-sdk/src/Cw20Staking.client.ts @@ -6,8 +6,8 @@ import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; import { Coin, StdFee } from "@cosmjs/amino"; -import {Addr, Uint128, Binary, AssetInfo, Cw20ReceiveMsg, Asset, RewardMsg, Decimal} from "./types"; -import {InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, ConfigResponse, ArrayOfQueryPoolInfoResponse, QueryPoolInfoResponse, PoolInfoResponse, LockInfosResponse, LockInfoResponse, RewardInfoResponse, RewardInfoResponseItem, ArrayOfRewardInfoResponse, RewardsPerSecResponse, StakedBalanceAtHeightResponse, TotalStakedAtHeightResponse} from "./Cw20Staking.types"; +import {Addr, Uint128, Binary, AssetInfo, Cw20ReceiveMsg, Asset, RewardMsg, Decimal, RewardInfoResponseItem} from "./types"; +import {InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, ConfigResponse, ArrayOfQueryPoolInfoResponse, QueryPoolInfoResponse, PoolInfoResponse, LockInfosResponse, LockInfoResponse, RewardInfoResponse, ArrayOfRewardInfoResponse, RewardsPerSecResponse, StakedBalanceAtHeightResponse, TotalStakedAtHeightResponse} from "./Cw20Staking.types"; export interface Cw20StakingReadOnlyInterface { contractAddress: string; config: () => Promise; @@ -273,6 +273,11 @@ export interface Cw20StakingInterface extends Cw20StakingReadOnlyInterface { stakerAddrs: Addr[]; stakingToken?: Addr; }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; + restake: ({ + stakingToken + }: { + stakingToken: Addr; + }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; } export class Cw20StakingClient extends Cw20StakingQueryClient implements Cw20StakingInterface { client: SigningCosmWasmClient; @@ -293,6 +298,7 @@ export class Cw20StakingClient extends Cw20StakingQueryClient implements Cw20Sta this.unbond = this.unbond.bind(this); this.withdraw = this.withdraw.bind(this); this.withdrawOthers = this.withdrawOthers.bind(this); + this.restake = this.restake.bind(this); } receive = async ({ @@ -418,4 +424,15 @@ export class Cw20StakingClient extends Cw20StakingQueryClient implements Cw20Sta } }, _fee, _memo, _funds); }; + restake = async ({ + stakingToken + }: { + stakingToken: Addr; + }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + restake: { + staking_token: stakingToken + } + }, _fee, _memo, _funds); + }; } \ No newline at end of file diff --git a/packages/contracts-sdk/src/Cw20Staking.types.ts b/packages/contracts-sdk/src/Cw20Staking.types.ts index 47c2e14e..09e2f6a8 100644 --- a/packages/contracts-sdk/src/Cw20Staking.types.ts +++ b/packages/contracts-sdk/src/Cw20Staking.types.ts @@ -1,4 +1,4 @@ -import {Addr, Uint128, Binary, AssetInfo, Cw20ReceiveMsg, Asset, RewardMsg, Decimal} from "./types"; +import {Addr, Uint128, Binary, AssetInfo, Cw20ReceiveMsg, Asset, RewardMsg, Decimal, RewardInfoResponseItem} from "./types"; export interface InstantiateMsg { owner?: Addr | null; rewarder: Addr; @@ -43,6 +43,10 @@ export type ExecuteMsg = { staker_addrs: Addr[]; staking_token?: Addr | null; }; +} | { + restake: { + staking_token: Addr; + }; }; export type QueryMsg = { config: {}; @@ -118,12 +122,6 @@ export interface RewardInfoResponse { reward_infos: RewardInfoResponseItem[]; staker_addr: Addr; } -export interface RewardInfoResponseItem { - bond_amount: Uint128; - pending_reward: Uint128; - pending_withdraw: Asset[]; - staking_token: Addr; -} export type ArrayOfRewardInfoResponse = RewardInfoResponse[]; export interface RewardsPerSecResponse { assets: Asset[]; diff --git a/packages/contracts-sdk/src/OraiswapLimitOrder.client.ts b/packages/contracts-sdk/src/OraiswapLimitOrder.client.ts index 6ddabbd9..3a2bb615 100644 --- a/packages/contracts-sdk/src/OraiswapLimitOrder.client.ts +++ b/packages/contracts-sdk/src/OraiswapLimitOrder.client.ts @@ -6,8 +6,8 @@ import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; import { Coin, StdFee } from "@cosmjs/amino"; -import {Uint128, Binary, Addr, AssetInfo, Decimal, Cw20ReceiveMsg, Asset} from "./types"; -import {InstantiateMsg, ExecuteMsg, OrderDirection, QueryMsg, OrderFilter, MigrateMsg, ContractInfoResponse, LastOrderIdResponse, OrderStatus, OrderResponse, OrderBookResponse, OrderBookMatchableResponse, OrderBooksResponse, OrdersResponse, SimulateMarketOrderResponse, TickResponse, TicksResponse} from "./OraiswapLimitOrder.types"; +import {Addr, Uint128, Binary, AssetInfo, Decimal, Cw20ReceiveMsg, Asset} from "./types"; +import {InstantiateMsg, ExecuteMsg, OrderDirection, QueryMsg, OrderFilter, MigrateMsg, ContractInfoResponse, LastOrderIdResponse, OrderStatus, OrderResponse, OrderBookResponse, OrderBookMatchableResponse, OrderBooksResponse, OrdersResponse, TickResponse, TicksResponse} from "./OraiswapLimitOrder.types"; export interface OraiswapLimitOrderReadOnlyInterface { contractAddress: string; contractInfo: () => Promise; @@ -77,22 +77,6 @@ export interface OraiswapLimitOrderReadOnlyInterface { }: { assetInfos: AssetInfo[]; }) => Promise; - midPrice: ({ - assetInfos - }: { - assetInfos: AssetInfo[]; - }) => Promise; - simulateMarketOrder: ({ - assetInfos, - direction, - offerAmount, - slippage - }: { - assetInfos: AssetInfo[]; - direction: OrderDirection; - offerAmount: Uint128; - slippage?: Decimal; - }) => Promise; } export class OraiswapLimitOrderQueryClient implements OraiswapLimitOrderReadOnlyInterface { client: CosmWasmClient; @@ -110,8 +94,6 @@ export class OraiswapLimitOrderQueryClient implements OraiswapLimitOrderReadOnly this.ticks = this.ticks.bind(this); this.lastOrderId = this.lastOrderId.bind(this); this.orderBookMatchable = this.orderBookMatchable.bind(this); - this.midPrice = this.midPrice.bind(this); - this.simulateMarketOrder = this.simulateMarketOrder.bind(this); } contractInfo = async (): Promise => { @@ -246,37 +228,6 @@ export class OraiswapLimitOrderQueryClient implements OraiswapLimitOrderReadOnly } }); }; - midPrice = async ({ - assetInfos - }: { - assetInfos: AssetInfo[]; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - mid_price: { - asset_infos: assetInfos - } - }); - }; - simulateMarketOrder = async ({ - assetInfos, - direction, - offerAmount, - slippage - }: { - assetInfos: AssetInfo[]; - direction: OrderDirection; - offerAmount: Uint128; - slippage?: Decimal; - }): Promise => { - return this.client.queryContractSmart(this.contractAddress, { - simulate_market_order: { - asset_infos: assetInfos, - direction, - offer_amount: offerAmount, - slippage - } - }); - }; } export interface OraiswapLimitOrderInterface extends OraiswapLimitOrderReadOnlyInterface { contractAddress: string; @@ -290,8 +241,6 @@ export interface OraiswapLimitOrderInterface extends OraiswapLimitOrderReadOnlyI msg: Binary; sender: string; }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; - pause: (_fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; - unpause: (_fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; updateAdmin: ({ admin }: { @@ -299,15 +248,12 @@ export interface OraiswapLimitOrderInterface extends OraiswapLimitOrderReadOnlyI }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; updateConfig: ({ commissionRate, - rewardAddress + rewardAddress, + spreadAddress }: { commissionRate?: string; rewardAddress?: Addr; - }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; - updateOperator: ({ - operator - }: { - operator?: string; + spreadAddress?: Addr; }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; createOrderBookPair: ({ baseCoinInfo, @@ -320,15 +266,6 @@ export interface OraiswapLimitOrderInterface extends OraiswapLimitOrderReadOnlyI quoteCoinInfo: AssetInfo; spread?: Decimal; }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; - updateOrderbookPair: ({ - assetInfos, - minQuoteCoinAmount, - spread - }: { - assetInfos: AssetInfo[]; - minQuoteCoinAmount?: Uint128; - spread?: Decimal; - }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; submitOrder: ({ assets, direction @@ -336,32 +273,25 @@ export interface OraiswapLimitOrderInterface extends OraiswapLimitOrderReadOnlyI assets: Asset[]; direction: OrderDirection; }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; - submitMarketOrder: ({ + cancelOrder: ({ assetInfos, - direction, - slippage + orderId }: { assetInfos: AssetInfo[]; - direction: OrderDirection; - slippage?: Decimal; + orderId: number; }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; - cancelOrder: ({ + executeOrderBookPair: ({ assetInfos, - orderId + limit }: { assetInfos: AssetInfo[]; - orderId: number; + limit?: number; }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; removeOrderBookPair: ({ assetInfos }: { assetInfos: AssetInfo[]; }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; - withdrawToken: ({ - asset - }: { - asset: Asset; - }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; } export class OraiswapLimitOrderClient extends OraiswapLimitOrderQueryClient implements OraiswapLimitOrderInterface { client: SigningCosmWasmClient; @@ -374,18 +304,13 @@ export class OraiswapLimitOrderClient extends OraiswapLimitOrderQueryClient impl this.sender = sender; this.contractAddress = contractAddress; this.receive = this.receive.bind(this); - this.pause = this.pause.bind(this); - this.unpause = this.unpause.bind(this); this.updateAdmin = this.updateAdmin.bind(this); this.updateConfig = this.updateConfig.bind(this); - this.updateOperator = this.updateOperator.bind(this); this.createOrderBookPair = this.createOrderBookPair.bind(this); - this.updateOrderbookPair = this.updateOrderbookPair.bind(this); this.submitOrder = this.submitOrder.bind(this); - this.submitMarketOrder = this.submitMarketOrder.bind(this); this.cancelOrder = this.cancelOrder.bind(this); + this.executeOrderBookPair = this.executeOrderBookPair.bind(this); this.removeOrderBookPair = this.removeOrderBookPair.bind(this); - this.withdrawToken = this.withdrawToken.bind(this); } receive = async ({ @@ -405,16 +330,6 @@ export class OraiswapLimitOrderClient extends OraiswapLimitOrderQueryClient impl } }, _fee, _memo, _funds); }; - pause = async (_fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - pause: {} - }, _fee, _memo, _funds); - }; - unpause = async (_fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - unpause: {} - }, _fee, _memo, _funds); - }; updateAdmin = async ({ admin }: { @@ -428,26 +343,18 @@ export class OraiswapLimitOrderClient extends OraiswapLimitOrderQueryClient impl }; updateConfig = async ({ commissionRate, - rewardAddress + rewardAddress, + spreadAddress }: { commissionRate?: string; rewardAddress?: Addr; + spreadAddress?: Addr; }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { commission_rate: commissionRate, - reward_address: rewardAddress - } - }, _fee, _memo, _funds); - }; - updateOperator = async ({ - operator - }: { - operator?: string; - }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - update_operator: { - operator + reward_address: rewardAddress, + spread_address: spreadAddress } }, _fee, _memo, _funds); }; @@ -471,23 +378,6 @@ export class OraiswapLimitOrderClient extends OraiswapLimitOrderQueryClient impl } }, _fee, _memo, _funds); }; - updateOrderbookPair = async ({ - assetInfos, - minQuoteCoinAmount, - spread - }: { - assetInfos: AssetInfo[]; - minQuoteCoinAmount?: Uint128; - spread?: Decimal; - }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - update_orderbook_pair: { - asset_infos: assetInfos, - min_quote_coin_amount: minQuoteCoinAmount, - spread - } - }, _fee, _memo, _funds); - }; submitOrder = async ({ assets, direction @@ -502,34 +392,31 @@ export class OraiswapLimitOrderClient extends OraiswapLimitOrderQueryClient impl } }, _fee, _memo, _funds); }; - submitMarketOrder = async ({ + cancelOrder = async ({ assetInfos, - direction, - slippage + orderId }: { assetInfos: AssetInfo[]; - direction: OrderDirection; - slippage?: Decimal; + orderId: number; }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { - submit_market_order: { + cancel_order: { asset_infos: assetInfos, - direction, - slippage + order_id: orderId } }, _fee, _memo, _funds); }; - cancelOrder = async ({ + executeOrderBookPair = async ({ assetInfos, - orderId + limit }: { assetInfos: AssetInfo[]; - orderId: number; + limit?: number; }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { - cancel_order: { + execute_order_book_pair: { asset_infos: assetInfos, - order_id: orderId + limit } }, _fee, _memo, _funds); }; @@ -544,15 +431,4 @@ export class OraiswapLimitOrderClient extends OraiswapLimitOrderQueryClient impl } }, _fee, _memo, _funds); }; - withdrawToken = async ({ - asset - }: { - asset: Asset; - }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { - return await this.client.execute(this.sender, this.contractAddress, { - withdraw_token: { - asset - } - }, _fee, _memo, _funds); - }; } \ No newline at end of file diff --git a/packages/contracts-sdk/src/OraiswapLimitOrder.types.ts b/packages/contracts-sdk/src/OraiswapLimitOrder.types.ts index 41355ffe..a78bce7a 100644 --- a/packages/contracts-sdk/src/OraiswapLimitOrder.types.ts +++ b/packages/contracts-sdk/src/OraiswapLimitOrder.types.ts @@ -1,18 +1,14 @@ -import {Uint128, Binary, Addr, AssetInfo, Decimal, Cw20ReceiveMsg, Asset} from "./types"; +import {Addr, Uint128, Binary, AssetInfo, Decimal, Cw20ReceiveMsg, Asset} from "./types"; export interface InstantiateMsg { - admin?: string | null; + admin?: Addr | null; commission_rate?: string | null; name?: string | null; - operator?: string | null; - reward_address: string; + reward_address?: Addr | null; + spread_address?: Addr | null; version?: string | null; } export type ExecuteMsg = { receive: Cw20ReceiveMsg; -} | { - pause: {}; -} | { - unpause: {}; } | { update_admin: { admin: Addr; @@ -21,10 +17,7 @@ export type ExecuteMsg = { update_config: { commission_rate?: string | null; reward_address?: Addr | null; - }; -} | { - update_operator: { - operator?: string | null; + spread_address?: Addr | null; }; } | { create_order_book_pair: { @@ -33,35 +26,24 @@ export type ExecuteMsg = { quote_coin_info: AssetInfo; spread?: Decimal | null; }; -} | { - update_orderbook_pair: { - asset_infos: [AssetInfo, AssetInfo]; - min_quote_coin_amount?: Uint128 | null; - spread?: Decimal | null; - }; } | { submit_order: { assets: [Asset, Asset]; direction: OrderDirection; }; -} | { - submit_market_order: { - asset_infos: [AssetInfo, AssetInfo]; - direction: OrderDirection; - slippage?: Decimal | null; - }; } | { cancel_order: { asset_infos: [AssetInfo, AssetInfo]; order_id: number; }; } | { - remove_order_book_pair: { + execute_order_book_pair: { asset_infos: [AssetInfo, AssetInfo]; + limit?: number | null; }; } | { - withdraw_token: { - asset: Asset; + remove_order_book_pair: { + asset_infos: [AssetInfo, AssetInfo]; }; }; export type OrderDirection = "buy" | "sell"; @@ -112,17 +94,6 @@ export type QueryMsg = { order_book_matchable: { asset_infos: [AssetInfo, AssetInfo]; }; -} | { - mid_price: { - asset_infos: [AssetInfo, AssetInfo]; - }; -} | { - simulate_market_order: { - asset_infos: [AssetInfo, AssetInfo]; - direction: OrderDirection; - offer_amount: Uint128; - slippage?: Decimal | null; - }; }; export type OrderFilter = ("tick" | "none") | { bidder: string; @@ -132,11 +103,7 @@ export type OrderFilter = ("tick" | "none") | { export interface MigrateMsg {} export interface ContractInfoResponse { admin: Addr; - commission_rate: string; - is_paused: boolean; name: string; - operator?: Addr | null; - reward_address: Addr; version: string; } export interface LastOrderIdResponse { @@ -168,10 +135,6 @@ export interface OrderBooksResponse { export interface OrdersResponse { orders: OrderResponse[]; } -export interface SimulateMarketOrderResponse { - receive: Uint128; - refunds: Uint128; -} export interface TickResponse { price: Decimal; total_orders: number; diff --git a/packages/contracts-sdk/src/OraiswapRewarder.client.ts b/packages/contracts-sdk/src/OraiswapRewarder.client.ts index 69ce17da..0f2c2117 100644 --- a/packages/contracts-sdk/src/OraiswapRewarder.client.ts +++ b/packages/contracts-sdk/src/OraiswapRewarder.client.ts @@ -6,15 +6,15 @@ import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; import { Coin, StdFee } from "@cosmjs/amino"; -import {Addr, Uint128} from "./types"; +import {Addr, AssetInfo, Uint128} from "./types"; import {InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, ConfigResponse, DistributionInfoResponse, RewardAmountPerSecondResponse} from "./OraiswapRewarder.types"; export interface OraiswapRewarderReadOnlyInterface { contractAddress: string; config: () => Promise; distributionInfo: ({ - stakingToken + assetInfo }: { - stakingToken: Addr; + assetInfo: AssetInfo; }) => Promise; rewardAmountPerSec: ({ stakingToken @@ -40,13 +40,13 @@ export class OraiswapRewarderQueryClient implements OraiswapRewarderReadOnlyInte }); }; distributionInfo = async ({ - stakingToken + assetInfo }: { - stakingToken: Addr; + assetInfo: AssetInfo; }): Promise => { return this.client.queryContractSmart(this.contractAddress, { distribution_info: { - staking_token: stakingToken + asset_info: assetInfo } }); }; diff --git a/packages/contracts-sdk/src/OraiswapRewarder.types.ts b/packages/contracts-sdk/src/OraiswapRewarder.types.ts index ae083564..151090ca 100644 --- a/packages/contracts-sdk/src/OraiswapRewarder.types.ts +++ b/packages/contracts-sdk/src/OraiswapRewarder.types.ts @@ -1,4 +1,4 @@ -import {Addr, Uint128} from "./types"; +import {Addr, AssetInfo, Uint128} from "./types"; export interface InstantiateMsg { distribution_interval?: number | null; staking_contract: Addr; @@ -18,7 +18,7 @@ export type QueryMsg = { config: {}; } | { distribution_info: { - staking_token: Addr; + asset_info: AssetInfo; }; } | { reward_amount_per_sec: { diff --git a/packages/contracts-sdk/src/OraiswapStaking.client.ts b/packages/contracts-sdk/src/OraiswapStaking.client.ts index 4ca04706..e31e6d98 100644 --- a/packages/contracts-sdk/src/OraiswapStaking.client.ts +++ b/packages/contracts-sdk/src/OraiswapStaking.client.ts @@ -6,8 +6,8 @@ import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; import { Coin, StdFee } from "@cosmjs/amino"; -import {Addr, Uint128, Binary, AssetInfo, Decimal, Cw20ReceiveMsg, Asset, RewardMsg} from "./types"; -import {InstantiateMsg, ExecuteMsg, QueryMsg, OldStoreType, MigrateMsg, ConfigResponse, ArrayOfQueryPoolInfoResponse, QueryPoolInfoResponse, PoolInfoResponse, RewardInfoResponse, RewardInfoResponseItem, ArrayOfRewardInfoResponse, RewardsPerSecResponse} from "./OraiswapStaking.types"; +import {Addr, Uint128, Binary, AssetInfo, Decimal, Cw20ReceiveMsg, Asset, RewardMsg, RewardInfoResponseItem} from "./types"; +import {InstantiateMsg, ExecuteMsg, QueryMsg, OldStoreType, MigrateMsg, AllStakersResponse, StakerResponse, ConfigResponse, ArrayOfQueryPoolInfoResponse, QueryPoolInfoResponse, PoolInfoResponse, RewardInfoResponse, ArrayOfRewardInfoResponse, RewardsPerSecResponse} from "./OraiswapStaking.types"; export interface OraiswapStakingReadOnlyInterface { contractAddress: string; config: () => Promise; @@ -45,6 +45,7 @@ export interface OraiswapStakingReadOnlyInterface { }: { storeType: OldStoreType; }) => Promise; + allStakers: () => Promise; } export class OraiswapStakingQueryClient implements OraiswapStakingReadOnlyInterface { client: CosmWasmClient; @@ -60,6 +61,7 @@ export class OraiswapStakingQueryClient implements OraiswapStakingReadOnlyInterf this.rewardInfos = this.rewardInfos.bind(this); this.getPoolsInformation = this.getPoolsInformation.bind(this); this.queryOldStore = this.queryOldStore.bind(this); + this.allStakers = this.allStakers.bind(this); } config = async (): Promise => { @@ -139,6 +141,11 @@ export class OraiswapStakingQueryClient implements OraiswapStakingReadOnlyInterf } }); }; + allStakers = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_stakers: {} + }); + }; } export interface OraiswapStakingInterface extends OraiswapStakingReadOnlyInterface { contractAddress: string; @@ -220,6 +227,11 @@ export interface OraiswapStakingInterface extends OraiswapStakingReadOnlyInterfa stakerAddr: Addr; stakingToken: Addr; }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; + migrateStore: ({ + assetInfo + }: { + assetInfo: AssetInfo; + }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; } export class OraiswapStakingClient extends OraiswapStakingQueryClient implements OraiswapStakingInterface { client: SigningCosmWasmClient; @@ -242,6 +254,7 @@ export class OraiswapStakingClient extends OraiswapStakingQueryClient implements this.withdrawOthers = this.withdrawOthers.bind(this); this.autoStake = this.autoStake.bind(this); this.autoStakeHook = this.autoStakeHook.bind(this); + this.migrateStore = this.migrateStore.bind(this); } receive = async ({ @@ -398,4 +411,15 @@ export class OraiswapStakingClient extends OraiswapStakingQueryClient implements } }, _fee, _memo, _funds); }; + migrateStore = async ({ + assetInfo + }: { + assetInfo: AssetInfo; + }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + migrate_store: { + asset_info: assetInfo + } + }, _fee, _memo, _funds); + }; } \ No newline at end of file diff --git a/packages/contracts-sdk/src/OraiswapStaking.types.ts b/packages/contracts-sdk/src/OraiswapStaking.types.ts index c6aff79e..d10e652e 100644 --- a/packages/contracts-sdk/src/OraiswapStaking.types.ts +++ b/packages/contracts-sdk/src/OraiswapStaking.types.ts @@ -1,4 +1,4 @@ -import {Addr, Uint128, Binary, AssetInfo, Decimal, Cw20ReceiveMsg, Asset, RewardMsg} from "./types"; +import {Addr, Uint128, Binary, AssetInfo, Decimal, Cw20ReceiveMsg, Asset, RewardMsg, RewardInfoResponseItem} from "./types"; export interface InstantiateMsg { base_denom?: string | null; factory_addr: Addr; @@ -58,6 +58,10 @@ export type ExecuteMsg = { staker_addr: Addr; staking_token: Addr; }; +} | { + migrate_store: { + asset_info: AssetInfo; + }; }; export type QueryMsg = { config: {}; @@ -87,6 +91,8 @@ export type QueryMsg = { query_old_store: { store_type: OldStoreType; }; +} | { + all_stakers: {}; }; export type OldStoreType = { pools: {}; @@ -106,6 +112,13 @@ export type OldStoreType = { rewards_per_sec: {}; }; export interface MigrateMsg {} +export interface AllStakersResponse { + stakers: StakerResponse[]; +} +export interface StakerResponse { + in_pools: Addr[]; + staker_addr: Addr; +} export interface ConfigResponse { base_denom: string; factory_addr: Addr; @@ -130,13 +143,6 @@ export interface RewardInfoResponse { reward_infos: RewardInfoResponseItem[]; staker_addr: Addr; } -export interface RewardInfoResponseItem { - bond_amount: Uint128; - pending_reward: Uint128; - pending_withdraw: Asset[]; - should_migrate?: boolean | null; - staking_token: Addr; -} export type ArrayOfRewardInfoResponse = RewardInfoResponse[]; export interface RewardsPerSecResponse { assets: Asset[]; diff --git a/packages/contracts-sdk/src/ProxySnapshot.client.ts b/packages/contracts-sdk/src/ProxySnapshot.client.ts index 2a4434f5..36b854c6 100644 --- a/packages/contracts-sdk/src/ProxySnapshot.client.ts +++ b/packages/contracts-sdk/src/ProxySnapshot.client.ts @@ -6,22 +6,67 @@ import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; import { Coin, StdFee } from "@cosmjs/amino"; -import {Addr, Uint128} from "./types"; -import {InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, ConfigResponse, Duration, ConfigTokenStakingResponse, StakedBalanceAtHeightResponse, TotalStakedAtHeightResponse} from "./ProxySnapshot.types"; +import {Addr, Uint128, Binary, AssetInfo, Cw20ReceiveMsg, Asset, RewardMsg, Decimal, RewardInfoResponseItem} from "./types"; +import {InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, ConfigResponse, ArrayOfQueryPoolInfoResponse, QueryPoolInfoResponse, PoolInfoResponse, LockInfosResponse, LockInfoResponse, RewardInfoResponse, ArrayOfRewardInfoResponse, RewardsPerSecResponse, StakedBalanceAtHeightResponse, TotalStakedAtHeightResponse} from "./ProxySnapshot.types"; export interface ProxySnapshotReadOnlyInterface { contractAddress: string; - getConfig: () => Promise; config: () => Promise; + poolInfo: ({ + stakingToken + }: { + stakingToken: Addr; + }) => Promise; + rewardsPerSec: ({ + stakingToken + }: { + stakingToken: Addr; + }) => Promise; + rewardInfo: ({ + stakerAddr, + stakingToken + }: { + stakerAddr: Addr; + stakingToken?: Addr; + }) => Promise; + rewardInfos: ({ + limit, + order, + stakingToken, + startAfter + }: { + limit?: number; + order?: number; + stakingToken: Addr; + startAfter?: Addr; + }) => Promise; + getPoolsInformation: () => Promise; + lockInfos: ({ + limit, + order, + stakerAddr, + stakingToken, + startAfter + }: { + limit?: number; + order?: number; + stakerAddr: Addr; + stakingToken: Addr; + startAfter?: number; + }) => Promise; stakedBalanceAtHeight: ({ address, + assetKey, height }: { address: string; + assetKey: Addr; height?: number; }) => Promise; totalStakedAtHeight: ({ + assetKey, height }: { + assetKey: Addr; height?: number; }) => Promise; } @@ -32,43 +77,133 @@ export class ProxySnapshotQueryClient implements ProxySnapshotReadOnlyInterface constructor(client: CosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; - this.getConfig = this.getConfig.bind(this); this.config = this.config.bind(this); + this.poolInfo = this.poolInfo.bind(this); + this.rewardsPerSec = this.rewardsPerSec.bind(this); + this.rewardInfo = this.rewardInfo.bind(this); + this.rewardInfos = this.rewardInfos.bind(this); + this.getPoolsInformation = this.getPoolsInformation.bind(this); + this.lockInfos = this.lockInfos.bind(this); this.stakedBalanceAtHeight = this.stakedBalanceAtHeight.bind(this); this.totalStakedAtHeight = this.totalStakedAtHeight.bind(this); } - getConfig = async (): Promise => { + config = async (): Promise => { return this.client.queryContractSmart(this.contractAddress, { - get_config: {} + config: {} }); }; - config = async (): Promise => { + poolInfo = async ({ + stakingToken + }: { + stakingToken: Addr; + }): Promise => { return this.client.queryContractSmart(this.contractAddress, { - config: {} + pool_info: { + staking_token: stakingToken + } + }); + }; + rewardsPerSec = async ({ + stakingToken + }: { + stakingToken: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rewards_per_sec: { + staking_token: stakingToken + } + }); + }; + rewardInfo = async ({ + stakerAddr, + stakingToken + }: { + stakerAddr: Addr; + stakingToken?: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + reward_info: { + staker_addr: stakerAddr, + staking_token: stakingToken + } + }); + }; + rewardInfos = async ({ + limit, + order, + stakingToken, + startAfter + }: { + limit?: number; + order?: number; + stakingToken: Addr; + startAfter?: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + reward_infos: { + limit, + order, + staking_token: stakingToken, + start_after: startAfter + } + }); + }; + getPoolsInformation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_pools_information: {} + }); + }; + lockInfos = async ({ + limit, + order, + stakerAddr, + stakingToken, + startAfter + }: { + limit?: number; + order?: number; + stakerAddr: Addr; + stakingToken: Addr; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + lock_infos: { + limit, + order, + staker_addr: stakerAddr, + staking_token: stakingToken, + start_after: startAfter + } }); }; stakedBalanceAtHeight = async ({ address, + assetKey, height }: { address: string; + assetKey: Addr; height?: number; }): Promise => { return this.client.queryContractSmart(this.contractAddress, { staked_balance_at_height: { address, + asset_key: assetKey, height } }); }; totalStakedAtHeight = async ({ + assetKey, height }: { + assetKey: Addr; height?: number; }): Promise => { return this.client.queryContractSmart(this.contractAddress, { total_staked_at_height: { + asset_key: assetKey, height } }); @@ -77,14 +212,71 @@ export class ProxySnapshotQueryClient implements ProxySnapshotReadOnlyInterface export interface ProxySnapshotInterface extends ProxySnapshotReadOnlyInterface { contractAddress: string; sender: string; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; updateConfig: ({ - assetKey, owner, - stakingContract + rewarder }: { - assetKey?: Addr; owner?: Addr; - stakingContract?: Addr; + rewarder?: Addr; + }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; + updateUnbondingPeriod: ({ + stakingToken, + unbondingPeriod + }: { + stakingToken: Addr; + unbondingPeriod: number; + }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; + registerAsset: ({ + stakingToken, + unbondingPeriod + }: { + stakingToken: Addr; + unbondingPeriod?: number; + }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; + updateRewardsPerSec: ({ + assets, + stakingToken + }: { + assets: Asset[]; + stakingToken: Addr; + }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; + depositReward: ({ + rewards + }: { + rewards: RewardMsg[]; + }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; + unbond: ({ + amount, + stakingToken + }: { + amount: Uint128; + stakingToken: Addr; + }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; + withdraw: ({ + stakingToken + }: { + stakingToken?: Addr; + }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; + withdrawOthers: ({ + stakerAddrs, + stakingToken + }: { + stakerAddrs: Addr[]; + stakingToken?: Addr; + }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; + restake: ({ + stakingToken + }: { + stakingToken: Addr; }, _fee?: number | StdFee | "auto", _memo?: string, _funds?: Coin[]) => Promise; } export class ProxySnapshotClient extends ProxySnapshotQueryClient implements ProxySnapshotInterface { @@ -97,23 +289,149 @@ export class ProxySnapshotClient extends ProxySnapshotQueryClient implements Pro this.client = client; this.sender = sender; this.contractAddress = contractAddress; + this.receive = this.receive.bind(this); this.updateConfig = this.updateConfig.bind(this); + this.updateUnbondingPeriod = this.updateUnbondingPeriod.bind(this); + this.registerAsset = this.registerAsset.bind(this); + this.updateRewardsPerSec = this.updateRewardsPerSec.bind(this); + this.depositReward = this.depositReward.bind(this); + this.unbond = this.unbond.bind(this); + this.withdraw = this.withdraw.bind(this); + this.withdrawOthers = this.withdrawOthers.bind(this); + this.restake = this.restake.bind(this); } + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, _fee, _memo, _funds); + }; updateConfig = async ({ - assetKey, owner, - stakingContract + rewarder }: { - assetKey?: Addr; owner?: Addr; - stakingContract?: Addr; + rewarder?: Addr; }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { - asset_key: assetKey, owner, - staking_contract: stakingContract + rewarder + } + }, _fee, _memo, _funds); + }; + updateUnbondingPeriod = async ({ + stakingToken, + unbondingPeriod + }: { + stakingToken: Addr; + unbondingPeriod: number; + }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_unbonding_period: { + staking_token: stakingToken, + unbonding_period: unbondingPeriod + } + }, _fee, _memo, _funds); + }; + registerAsset = async ({ + stakingToken, + unbondingPeriod + }: { + stakingToken: Addr; + unbondingPeriod?: number; + }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_asset: { + staking_token: stakingToken, + unbonding_period: unbondingPeriod + } + }, _fee, _memo, _funds); + }; + updateRewardsPerSec = async ({ + assets, + stakingToken + }: { + assets: Asset[]; + stakingToken: Addr; + }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_rewards_per_sec: { + assets, + staking_token: stakingToken + } + }, _fee, _memo, _funds); + }; + depositReward = async ({ + rewards + }: { + rewards: RewardMsg[]; + }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deposit_reward: { + rewards + } + }, _fee, _memo, _funds); + }; + unbond = async ({ + amount, + stakingToken + }: { + amount: Uint128; + stakingToken: Addr; + }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + unbond: { + amount, + staking_token: stakingToken + } + }, _fee, _memo, _funds); + }; + withdraw = async ({ + stakingToken + }: { + stakingToken?: Addr; + }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw: { + staking_token: stakingToken + } + }, _fee, _memo, _funds); + }; + withdrawOthers = async ({ + stakerAddrs, + stakingToken + }: { + stakerAddrs: Addr[]; + stakingToken?: Addr; + }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw_others: { + staker_addrs: stakerAddrs, + staking_token: stakingToken + } + }, _fee, _memo, _funds); + }; + restake = async ({ + stakingToken + }: { + stakingToken: Addr; + }, _fee: number | StdFee | "auto" = "auto", _memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + restake: { + staking_token: stakingToken } }, _fee, _memo, _funds); }; diff --git a/packages/contracts-sdk/src/ProxySnapshot.types.ts b/packages/contracts-sdk/src/ProxySnapshot.types.ts index 403a9a28..09e2f6a8 100644 --- a/packages/contracts-sdk/src/ProxySnapshot.types.ts +++ b/packages/contracts-sdk/src/ProxySnapshot.types.ts @@ -1,44 +1,130 @@ -import {Addr, Uint128} from "./types"; +import {Addr, Uint128, Binary, AssetInfo, Cw20ReceiveMsg, Asset, RewardMsg, Decimal, RewardInfoResponseItem} from "./types"; export interface InstantiateMsg { - asset_key: Addr; owner?: Addr | null; - staking_contract: Addr; + rewarder: Addr; } export type ExecuteMsg = { + receive: Cw20ReceiveMsg; +} | { update_config: { - asset_key?: Addr | null; owner?: Addr | null; - staking_contract?: Addr | null; + rewarder?: Addr | null; + }; +} | { + update_unbonding_period: { + staking_token: Addr; + unbonding_period: number; + }; +} | { + register_asset: { + staking_token: Addr; + unbonding_period?: number | null; + }; +} | { + update_rewards_per_sec: { + assets: Asset[]; + staking_token: Addr; + }; +} | { + deposit_reward: { + rewards: RewardMsg[]; + }; +} | { + unbond: { + amount: Uint128; + staking_token: Addr; + }; +} | { + withdraw: { + staking_token?: Addr | null; + }; +} | { + withdraw_others: { + staker_addrs: Addr[]; + staking_token?: Addr | null; + }; +} | { + restake: { + staking_token: Addr; }; }; export type QueryMsg = { - get_config: {}; -} | { config: {}; +} | { + pool_info: { + staking_token: Addr; + }; +} | { + rewards_per_sec: { + staking_token: Addr; + }; +} | { + reward_info: { + staker_addr: Addr; + staking_token?: Addr | null; + }; +} | { + reward_infos: { + limit?: number | null; + order?: number | null; + staking_token: Addr; + start_after?: Addr | null; + }; +} | { + get_pools_information: {}; +} | { + lock_infos: { + limit?: number | null; + order?: number | null; + staker_addr: Addr; + staking_token: Addr; + start_after?: number | null; + }; } | { staked_balance_at_height: { address: string; + asset_key: Addr; height?: number | null; }; } | { total_staked_at_height: { + asset_key: Addr; height?: number | null; }; }; export interface MigrateMsg {} export interface ConfigResponse { - asset_key: Addr; owner: Addr; - staking_contract: Addr; + rewarder: Addr; } -export type Duration = { - height: number; -} | { - time: number; -}; -export interface ConfigTokenStakingResponse { - token_address: Addr; - unstaking_duration?: Duration | null; +export type ArrayOfQueryPoolInfoResponse = QueryPoolInfoResponse[]; +export interface QueryPoolInfoResponse { + asset_key: string; + pool_info: PoolInfoResponse; +} +export interface PoolInfoResponse { + pending_reward: Uint128; + reward_index: Decimal; + staking_token: Addr; + total_bond_amount: Uint128; + unbonding_period?: number | null; +} +export interface LockInfosResponse { + lock_infos: LockInfoResponse[]; + staker_addr: Addr; + staking_token: Addr; +} +export interface LockInfoResponse { + amount: Uint128; + unlock_time: number; +} +export interface RewardInfoResponse { + reward_infos: RewardInfoResponseItem[]; + staker_addr: Addr; +} +export type ArrayOfRewardInfoResponse = RewardInfoResponse[]; +export interface RewardsPerSecResponse { + assets: Asset[]; } export interface StakedBalanceAtHeightResponse { balance: Uint128; diff --git a/packages/contracts-sdk/src/index.ts b/packages/contracts-sdk/src/index.ts index 772a966b..b2e7e292 100644 --- a/packages/contracts-sdk/src/index.ts +++ b/packages/contracts-sdk/src/index.ts @@ -1,5 +1,3 @@ -export * as CoharvestBidPoolTypes from './CoharvestBidPool.types'; -export * from './CoharvestBidPool.client'; export * as Cw20StakingTypes from './Cw20Staking.types'; export * from './Cw20Staking.client'; export * as OraidexListingContractTypes from './OraidexListingContract.types'; diff --git a/packages/contracts-sdk/src/types.ts b/packages/contracts-sdk/src/types.ts index 4ae9cd61..4742ff0a 100644 --- a/packages/contracts-sdk/src/types.ts +++ b/packages/contracts-sdk/src/types.ts @@ -1,3 +1,6 @@ +export type Addr = string; +export type Uint128 = string; +export type Binary = string; export type AssetInfo = { token: { contract_addr: Addr; @@ -7,10 +10,6 @@ export type AssetInfo = { denom: string; }; }; -export type Addr = string; -export type Uint128 = string; -export type Decimal = string; -export type Binary = string; export interface Cw20ReceiveMsg { amount: Uint128; msg: Binary; @@ -24,6 +23,7 @@ export interface RewardMsg { staking_token: Addr; total_accumulation_amount: Uint128; } +export type Decimal = string; export type Logo = { url: string; } | { @@ -50,4 +50,10 @@ export interface PairInfo { contract_addr: Addr; liquidity_token: Addr; oracle_addr: Addr; +} +export interface RewardInfoResponseItem { + bond_amount: Uint128; + pending_reward: Uint128; + pending_withdraw: Asset[]; + staking_token: Addr; } \ No newline at end of file diff --git a/packages/universal-swap/tests/index.spec.ts b/packages/universal-swap/tests/index.spec.ts index 8bb97b59..523bd22c 100644 --- a/packages/universal-swap/tests/index.spec.ts +++ b/packages/universal-swap/tests/index.spec.ts @@ -67,13 +67,13 @@ describe("test universal swap handler functions", () => { }); let oraiPort: string; let lpId: number; - let channel = "channel-29"; - let ibcTransferAmount = "100000000"; - let initialBalanceAmount = "10000000000000"; - let airiIbcDenom: string = "oraib0x7e2A35C746F2f7C240B664F1Da4DD100141AE71F"; - let bobAddress = "orai1ur2vsjrjarygawpdwtqteaazfchvw4fg6uql76"; - let oraiAddress = "orai12zyu8w93h0q2lcnt50g3fn0w3yqnhy4fvawaqz"; - let cosmosSenderAddress = bech32.encode("cosmos", bech32.decode(oraiAddress).words); + const channel = "channel-29"; + const ibcTransferAmount = "100000000"; + const initialBalanceAmount = "10000000000000"; + const airiIbcDenom: string = "oraib0x7e2A35C746F2f7C240B664F1Da4DD100141AE71F"; + const bobAddress = "orai1ur2vsjrjarygawpdwtqteaazfchvw4fg6uql76"; + const oraiAddress = "orai12zyu8w93h0q2lcnt50g3fn0w3yqnhy4fvawaqz"; + const cosmosSenderAddress = bech32.encode("cosmos", bech32.decode(oraiAddress).words); let ics20Contract: CwIcs20LatestClient; let factoryContract: OraiswapFactoryClient; @@ -89,12 +89,12 @@ describe("test universal swap handler functions", () => { // deploy oracle addr const { codeId: pairCodeId } = await client.upload( testSenderAddress, - readFileSync(oraidexArtifacts.getContractDir("oraiswap_pair")), + readFileSync(oraidexArtifacts.getContractDir("oraiswap-pair")), "auto" ); const { codeId: lpCodeId } = await client.upload( testSenderAddress, - readFileSync(oraidexArtifacts.getContractDir("oraiswap_token")), + readFileSync(oraidexArtifacts.getContractDir("oraiswap-token")), "auto" ); lpId = lpCodeId; @@ -103,7 +103,7 @@ describe("test universal swap handler functions", () => { testSenderAddress, {}, "oraiswap-oracle", - "oraiswap_oracle" + "oraiswap-oracle" ); // deploy factory contract oracleContract = new OraiswapOracleClient(client, testSenderAddress, oracleAddress); @@ -117,7 +117,7 @@ describe("test universal swap handler functions", () => { token_code_id: lpCodeId }, "oraiswap-factory", - "oraiswap_factory" + "oraiswap-factory" ); const { contractAddress: routerAddress } = await oraidexArtifacts.deployContract( client, @@ -127,13 +127,13 @@ describe("test universal swap handler functions", () => { factory_addr_v2: factoryAddress }, "oraiswap-router", - "oraiswap_router" + "oraiswap-router" ); factoryContract = new OraiswapFactoryClient(client, testSenderAddress, factoryAddress); routerContract = new OraiswapRouterClient(client, testSenderAddress, routerAddress); ics20Contract = await deployIcs20Token(client, { swap_router_contract: routerAddress }); oraiPort = "wasm." + ics20Contract.contractAddress; - let cosmosPort: string = "transfer"; + const cosmosPort: string = "transfer"; airiToken = await deployToken(client, { decimals: 6, symbol: "AIRI", @@ -145,7 +145,7 @@ describe("test universal swap handler functions", () => { bech32Prefix: "cosmos" }); - let newPacketData = { + const newPacketData = { src: { port_id: cosmosPort, channel_id: channel @@ -585,7 +585,7 @@ describe("test universal swap handler functions", () => { [oraichainTokens.find((t) => t.coinGeckoId === "airight")!, 10000000], [oraichainTokens.find((t) => t.coinGeckoId === "oraichain-token")!, 0] ])("test-universal-swap-getBalanceIBCOraichain-ibc-%", async (token: TokenItemType, expectedBalance: number) => { - let mockToken = { ...token }; + const mockToken = { ...token }; if (mockToken.contractAddress) { if (mockToken.coinGeckoId === "airight") mockToken.contractAddress = airiToken.contractAddress; } diff --git a/packages/universal-swap/tests/test-common.ts b/packages/universal-swap/tests/test-common.ts index 75c69b4b..013e52b5 100644 --- a/packages/universal-swap/tests/test-common.ts +++ b/packages/universal-swap/tests/test-common.ts @@ -37,7 +37,7 @@ export const deployToken = async ( initial_balances }, "token", - "oraiswap_token" + "oraiswap-token" ) ).contractAddress ); diff --git a/yarn.lock b/yarn.lock index 60eb8411..3cc97ab0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1254,6 +1254,13 @@ resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== +"@babel/runtime@7.20.13": + version "7.20.13" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.13.tgz#7055ab8a7cff2b8f6058bf6ae45ff84ad2aded4b" + integrity sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA== + dependencies: + regenerator-runtime "^0.13.11" + "@babel/runtime@^7.0.0": version "7.23.1" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.1.tgz#72741dc4d413338a91dcb044a86f3c0bc402646d" @@ -10145,6 +10152,11 @@ globby@11.1.0, globby@^11.0.1, globby@^11.0.2, globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" +google-protobuf@^3.14.0, google-protobuf@^3.21.0: + version "3.21.2" + resolved "https://registry.yarnpkg.com/google-protobuf/-/google-protobuf-3.21.2.tgz#4580a2bea8bbb291ee579d1fefb14d6fa3070ea4" + integrity sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA== + gopd@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c"