Skip to content

Commit

Permalink
Merge branch 'feat/add_pepe_token_bsc' into feat/dynamic-token-list
Browse files Browse the repository at this point in the history
  • Loading branch information
quangdz1704 committed Nov 18, 2024
2 parents 2e59e29 + 11e029f commit ce4d585
Show file tree
Hide file tree
Showing 9 changed files with 222 additions and 334 deletions.
19 changes: 19 additions & 0 deletions chains/0x38.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,25 @@
"coinGeckoId": "binancecoin",
"bridgeTo": ["Oraichain"],
"coinImageUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/1839.png"
},
{
"coinDenom": "DOGE",
"coinMinimalDenom": "erc20:0xbA2aE424d960c26247Dd6c32edC70B295c744C43:Dogecoin",
"contractAddress": "0xbA2aE424d960c26247Dd6c32edC70B295c744C43",
"coinDecimals": 8,
"coinGeckoId": "dogecoin",
"bridgeTo": ["Oraichain"],
"coinImageUrl": "https://assets.coingecko.com/coins/images/5/standard/dogecoin.png?1696501409"
},
{
"coinDenom": "PEPE",
"coinMinimalDenom": "erc20:0x25d887Ce7a35172C62FeBFD67a1856F20FaEbB00:Pepe",
"contractAddress": "0x25d887Ce7a35172C62FeBFD67a1856F20FaEbB00",
"coinDecimals": 18,
"coinGeckoId": "pepe",
"bridgeTo": ["Oraichain"],
"prefixToken": "oraib",
"coinImageUrl": "https://assets.coingecko.com/coins/images/29850/standard/pepe-token.jpeg?1696528776"
}
],
"txExplorer": {
Expand Down
8 changes: 8 additions & 0 deletions chains/Oraichain.json
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,14 @@
"bridgeTo": ["ton"],
"coinDecimals": 9,
"coinImageUrl": "https://s2.coinmarketcap.com/static/img/coins/64x64/32195.png"
},
{
"coinDenom": "DOGE",
"coinGeckoId": "dogecoin",
"coinMinimalDenom": "factory/orai1wuvhex9xqs3r539mvc6mtm7n20fcj3qr2m0y9khx6n5vtlngfzes3k0rq9/DogeBNB",
"bridgeTo": ["0x38"],
"coinDecimals": 8,
"coinImageUrl": "https://assets.coingecko.com/coins/images/5/standard/dogecoin.png?1696501409"
}
]
}
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"npmClient": "yarn",
"version": "1.1.1",
"version": "1.2.0",
"command": {
"publish": {
"registry": "https://registry.npmjs.org/"
Expand Down
15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@
"node": ">=18.18.0"
},
"dependencies": {
"@cosmjs/amino": "^0.31.3",
"@cosmjs/cosmwasm-stargate": "^0.31.3",
"@cosmjs/crypto": "^0.31.3",
"@cosmjs/encoding": "^0.31.3",
"@cosmjs/proto-signing": "^0.31.3",
"@cosmjs/stargate": "^0.31.3",
"@cosmjs/tendermint-rpc": "^0.31.3"
"@cosmjs/amino": "0.32.4",
"@cosmjs/cosmwasm-stargate": "0.32.4",
"@cosmjs/crypto": "0.32.4",
"@cosmjs/encoding": "0.32.4",
"@cosmjs/proto-signing": "0.32.4",
"@cosmjs/stargate": "0.32.4",
"@cosmjs/tendermint-rpc": "0.32.4"
},
"devDependencies": {
"@eslint/js": "^9.7.0",
"@oraichain/cw-simulate": "^2.8.87",
"@types/eslint__js": "^8.42.3",
"@types/lodash": "^4.17.0",
"@types/node": "^20.11.30",
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oraichain/common",
"version": "1.1.5",
"version": "1.1.5-beta.1",
"main": "build/index.js",
"license": "MIT",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/examples/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oraichain/examples",
"version": "1.1.1",
"version": "1.2.0",
"main": "build/index.js",
"license": "MIT",
"scripts": {
Expand All @@ -10,7 +10,7 @@
"build/"
],
"dependencies": {
"@oraichain/common": "^1.1.1",
"@oraichain/common": "^1.2.0",
"bech32": "^1.1.4",
"cosmjs-types": "^0.8.0",
"dotenv": "^16.4.5"
Expand Down
88 changes: 44 additions & 44 deletions packages/examples/src/cosmjs-stargate/query-custom-height.ts
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
import { StargateClient } from "@cosmjs/stargate";
import { ORAI } from "@oraichain/common";
import { assert } from "console";
import { setTimeout } from "timers/promises";
// import { StargateClient } from "@cosmjs/stargate";
// import { ORAI } from "@oraichain/common";
// import { assert } from "console";
// import { setTimeout } from "timers/promises";

(async () => {
const rpc = "https://rpc.orai.io";
const { account: distributionAccount } = await fetch(
"https://lcd.orai.io/cosmos/auth/v1beta1/module_accounts/distribution"
).then((data) => data.json());
// (async () => {
// const rpc = "https://rpc.orai.io";
// const { account: distributionAccount } = await fetch(
// "https://lcd.orai.io/cosmos/auth/v1beta1/module_accounts/distribution"
// ).then((data) => data.json());

const { address } = distributionAccount.base_account;
const stargateClient = await StargateClient.connect(rpc);
const latestHeight = await stargateClient.getHeight();
const { amount: distrBalance } = await stargateClient.getBalance(
address,
ORAI
);
const stargateClientTenHeightBefore = await StargateClient.connect(rpc, {
desiredHeight: latestHeight - 10
});
const stargateClientDesiredFiveHeightBefore = await StargateClient.connect(
rpc,
{
desiredHeight: latestHeight - 5
}
);
// const { address } = distributionAccount.base_account;
// const stargateClient = await StargateClient.connect(rpc);
// const latestHeight = await stargateClient.getHeight();
// const { amount: distrBalance } = await stargateClient.getBalance(
// address,
// ORAI
// );
// const stargateClientTenHeightBefore = await StargateClient.connect(rpc, {
// desiredHeight: latestHeight - 10
// });
// const stargateClientDesiredFiveHeightBefore = await StargateClient.connect(
// rpc,
// {
// desiredHeight: latestHeight - 5
// }
// );

// query balance of distribution module at latest, 10 and 5 heights before that
const { amount: distrBalanceTenBefore } =
await stargateClientTenHeightBefore.getBalance(address, ORAI);
const { amount: distrBalanceFiveBefore } =
await stargateClientDesiredFiveHeightBefore.getBalance(address, ORAI);
// // query balance of distribution module at latest, 10 and 5 heights before that
// const { amount: distrBalanceTenBefore } =
// await stargateClientTenHeightBefore.getBalance(address, ORAI);
// const { amount: distrBalanceFiveBefore } =
// await stargateClientDesiredFiveHeightBefore.getBalance(address, ORAI);

// after several blocks, the balances 10 heights before should stay the same, proving that we can query states at a specific height
await setTimeout(2000);
const { amount: distrBalanceTenBeforeAgain } =
await stargateClientTenHeightBefore.getBalance(address, ORAI);
assert(distrBalanceTenBeforeAgain === distrBalanceTenBefore);
assert(distrBalanceTenBeforeAgain !== distrBalance);
assert(distrBalanceTenBeforeAgain !== distrBalanceFiveBefore);
console.log(
distrBalance,
distrBalanceTenBefore,
distrBalanceTenBeforeAgain,
distrBalanceFiveBefore
);
})();
// // after several blocks, the balances 10 heights before should stay the same, proving that we can query states at a specific height
// await setTimeout(2000);
// const { amount: distrBalanceTenBeforeAgain } =
// await stargateClientTenHeightBefore.getBalance(address, ORAI);
// assert(distrBalanceTenBeforeAgain === distrBalanceTenBefore);
// assert(distrBalanceTenBeforeAgain !== distrBalance);
// assert(distrBalanceTenBeforeAgain !== distrBalanceFiveBefore);
// console.log(
// distrBalance,
// distrBalanceTenBefore,
// distrBalanceTenBeforeAgain,
// distrBalanceFiveBefore
// );
// })();
50 changes: 25 additions & 25 deletions packages/examples/src/cosmwasm-stargate/basic-custom-height.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import dotenv from "dotenv";
import { ORAI_TOKEN_CONTRACTS } from "@oraichain/common";
import { SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate";
import assert from "assert";
dotenv.config();
// import dotenv from "dotenv";
// import { ORAI_TOKEN_CONTRACTS } from "@oraichain/common";
// import { SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate";
// import assert from "assert";
// dotenv.config();

(async () => {
const oldStatus = await queryCheckpointByIndex(process.env.RPC, 36975367);
const newStatus = await queryCheckpointByIndex(process.env.RPC, 36975369);
// (async () => {
// const oldStatus = await queryCheckpointByIndex(process.env.RPC, 36975367);
// const newStatus = await queryCheckpointByIndex(process.env.RPC, 36975369);

assert(oldStatus !== newStatus);
})();
// assert(oldStatus !== newStatus);
// })();

async function queryCheckpointByIndex(
rpc: string,
height: number
): Promise<string> {
const client = await SigningCosmWasmClient.connect(rpc, height);
// client.setQueryClientWithHeight(36975367);
const result = await client.queryContractSmart(
"orai12sxqkgsystjgd9faa48ghv3zmkfqc6qu05uy20mvv730vlzkpvls5zqxuz",
{
checkpoint_by_index: { index: 13 }
}
);
console.log(result.status);
return result.status;
}
// async function queryCheckpointByIndex(
// rpc: string,
// height: number
// ): Promise<string> {
// const client = await SigningCosmWasmClient.connect(rpc, height);
// // client.setQueryClientWithHeight(36975367);
// const result = await client.queryContractSmart(
// "orai12sxqkgsystjgd9faa48ghv3zmkfqc6qu05uy20mvv730vlzkpvls5zqxuz",
// {
// checkpoint_by_index: { index: 13 }
// }
// );
// console.log(result.status);
// return result.status;
// }
Loading

0 comments on commit ce4d585

Please sign in to comment.