Skip to content

Commit

Permalink
pumb oraichain common
Browse files Browse the repository at this point in the history
  • Loading branch information
haunv3 committed Jan 2, 2025
1 parent 01f51a7 commit ec8c2af
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 47 deletions.
2 changes: 1 addition & 1 deletion packages/oraiswap-v3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"dependencies": {
"@cosmjs/cosmwasm-stargate": "^0.32.4",
"@oraichain/oraidex-contracts-sdk": "^1.0.54",
"@oraichain/oraidex-common": "2.0.6"
"@oraichain/oraidex-common": "2.0.8"
}
}
4 changes: 2 additions & 2 deletions packages/oraiswap-v3/tests/helpers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ describe("test oraiswap-v3 helper functions", () => {
[3061221885126646n, 2786952634213000000000000n, 2621000184602367837078723n, 2731770006227000000000000n],
[3079921929921160n, 2871823670360000000000000n, 2621000184602367837078723n, 2786952634213000000000000n],
[3053349216741434n, 2944520552269000000000000n, 2621000184602367837078723n, 2871823670360000000000000n],
[3224297089568735n, 2959279283182000000000000n, 2621000184602367837078723n, 2944520552269000000000000n],
[3224297089568735n, 2959279283182000000000000n, 2621000184602367837078723n, 2944520552269000000000000n]
])("getX getY", (liquidity, upperSqrtPrice, currentSqrtPrice, lowerSqrtPrice) => {
const x = getX(liquidity, upperSqrtPrice, currentSqrtPrice, lowerSqrtPrice);
const y = getY(liquidity, upperSqrtPrice, currentSqrtPrice, lowerSqrtPrice);
Expand Down Expand Up @@ -573,7 +573,7 @@ describe("test oraiswap-v3 helper functions", () => {
contractAddress: "orai10ldgzued6zjp0mkqwsv2mux3ml50l97c74x8sg",
prefix: "orai",
coinGeckoId: "airight",
denom: "airi",
denom: "cw20:orai10ldgzued6zjp0mkqwsv2mux3ml50l97c74x8sg:AIRI",
bridgeNetworkIdentifier: undefined,
decimals: 6,
bridgeTo: ["0x38"],
Expand Down
6 changes: 3 additions & 3 deletions packages/universal-swap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oraichain/oraidex-universal-swap",
"version": "1.3.0",
"version": "1.3.1",
"main": "build/index.js",
"files": [
"build/"
Expand All @@ -11,12 +11,12 @@
},
"license": "MIT",
"dependencies": {
"@oraichain/oraidex-common": "2.0.6",
"@oraichain/oraidex-common": "2.0.8",
"@oraichain/oraidex-contracts-sdk": "^1.0.49",
"bech32": "1.1.4",
"ethers": "^5.0.15",
"tronweb": "5.3.2",
"@oraichain/common": "1.2.6",
"@oraichain/common": "1.2.8",
"ts-protoc-gen": "^0.15.0",
"@oraichain/osor-api-contracts-sdk": "^1.0.2",
"cosmjs-types": "^0.9.0"
Expand Down
10 changes: 7 additions & 3 deletions packages/universal-swap/tests/helper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ describe("test helper functions", () => {
it.each<[AmountDetails, string, Coin, number]>([
[
{
injective: "10000"
"cw20:orai19rtmkk6sn4tppvjmp5d5zj6gfsdykrl5rw2euu5gwur3luheuuusesqn49:INJ": "10000"
},
"injective-protocol",
coin(1000, INJECTIVE_ORAICHAIN_DENOM),
Expand All @@ -830,7 +830,7 @@ describe("test helper functions", () => {
[
{
[INJECTIVE_ORAICHAIN_DENOM]: "1000",
injective: "10000"
"cw20:orai19rtmkk6sn4tppvjmp5d5zj6gfsdykrl5rw2euu5gwur3luheuuusesqn49:INJ": "10000"
},
"injective-protocol",
coin(1000, INJECTIVE_ORAICHAIN_DENOM),
Expand All @@ -839,6 +839,9 @@ describe("test helper functions", () => {
[{}, "injective-protocol", coin(1000, INJECTIVE_ORAICHAIN_DENOM), 0]
])("test-generate-convert-msgs", async (currentBal: AmountDetails, tokenInfo, toSend, msgLength) => {
const token = getTokenOnOraichain(tokenInfo, oraidexCommon.oraichainTokens);

console.log({ token: oraidexCommon.oraichainTokens.filter((r) => r.coinGeckoId === "injective-protocol") });

const msg = universalHelper.generateConvertCw20Erc20Message(
currentBal,
token,
Expand All @@ -854,11 +857,12 @@ describe("test helper functions", () => {
it.each<[AmountDetails, string, number]>([
[{}, "cosmos", 0],
[{ [`${INJECTIVE_ORAICHAIN_DENOM}`]: "10" }, "injective-protocol", 1],
[{ injective: "10" }, "injective-protocol", 0]
[{ "cw20:orai19rtmkk6sn4tppvjmp5d5zj6gfsdykrl5rw2euu5gwur3luheuuusesqn49:INJ": "10" }, "injective-protocol", 0]
])(
"test-generateConvertErc20Cw20Message-should-return-correct-message-length",
(amountDetails, tokenInfo, expectedMessageLength) => {
const token = getTokenOnOraichain(tokenInfo, oraidexCommon.oraichainTokens);

const result = universalHelper.generateConvertErc20Cw20Message(
amountDetails,
token,
Expand Down
38 changes: 0 additions & 38 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3744,19 +3744,6 @@
resolved "https://registry.yarnpkg.com/@oraichain/common-contracts-sdk/-/common-contracts-sdk-1.0.31.tgz#595f93b168438d69d64896909b37855c9afc92fb"
integrity sha512-s8H20RXy5gCnu3DnM7L5ClQyj2mdQpbSBpZrXCpIAX9qY0LKsDdZG3sYaDQ8+VN333jz9Pp/qGWdFSYD+6PBsg==

"@oraichain/[email protected]":
version "1.2.7"
resolved "https://registry.yarnpkg.com/@oraichain/common/-/common-1.2.7.tgz#5063b20967eac14b5fc94e75f02afa6685565507"
integrity sha512-yOaEpjxtYwGkOxzSiqYwULfK0KSGdBj0ziQLZjQhM6yhW3MzTK70nAORW64ATKomSlBQFy9I/6MFsGkQBHiv3w==
dependencies:
"@keplr-wallet/types" "0.12.141"
axios "0.21.4"
axios-extensions "3.1.6"
bech32 "^1.1.4"
cosmjs-types "^0.9.0"
ethers "^5.5.1"
lodash "^4.17.21"

"@oraichain/[email protected]":
version "1.2.8"
resolved "https://registry.yarnpkg.com/@oraichain/common/-/common-1.2.8.tgz#af1e5766d78a4c8b080b7b0544eaceecf852996e"
Expand Down Expand Up @@ -3820,31 +3807,6 @@
resolved "https://registry.yarnpkg.com/@oraichain/immutable/-/immutable-4.3.9.tgz#ff8d5a7b39b5b01f3f72a902cffbfea32ccb20c3"
integrity sha512-INpHnhL970OCkR7I71Kssb2aLl2l4Y/x8W6FlyRO0KmC8GHjxc/hlNB1t44BiI7lkOYmcWMRQoC8dwParsp1RQ==

"@oraichain/[email protected]":
version "2.0.7"
resolved "https://registry.yarnpkg.com/@oraichain/oraidex-common/-/oraidex-common-2.0.7.tgz#0f26727ab256e0d56e6fec39950689c14ffca690"
integrity sha512-UKGb+S9b1UYmW0Rvlx/lyPOQ6ExRs+r3zD8FYdwScOgtP7LUxlMrDL5JFHi3Ief6/W0vR8IZVQw9/4CrBjbQ4w==
dependencies:
"@cosmjs/amino" "^0.32.4"
"@cosmjs/cosmwasm-stargate" "^0.32.4"
"@cosmjs/crypto" "^0.32.4"
"@cosmjs/proto-signing" "^0.32.4"
"@cosmjs/stargate" "^0.32.4"
"@cosmjs/tendermint-rpc" "^0.32.4"
"@ethersproject/providers" "^5.0.10"
"@injectivelabs/sdk-ts" "1.12.1"
"@keplr-wallet/types" "^0.11.38"
"@oraichain/common" "1.2.7"
"@oraichain/oraidex-contracts-sdk" latest
"@ton/core" "0.56.3"
"@ton/crypto" "3.3.0"
axios "1.7.2"
axios-extensions "3.1.7"
bignumber.js "^9.1.2"
cosmjs-types "^0.9.0"
ethers "^5.0.15"
tronweb "6.0.0-beta.4"

"@oraichain/oraidex-common@^1.1.34":
version "1.1.34"
resolved "https://registry.yarnpkg.com/@oraichain/oraidex-common/-/oraidex-common-1.1.34.tgz#257d25408450c438dc2bf0870fa8de9125af92ed"
Expand Down

0 comments on commit ec8c2af

Please sign in to comment.