Skip to content

Commit

Permalink
Merge pull request #112 from ainize-team/release/1.1.3
Browse files Browse the repository at this point in the history
Upgrade version to 1.1.3
  • Loading branch information
yoojinko authored May 7, 2024
2 parents 78a7ee1 + 60b0f4a commit bb9110f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ainize-team/ainize-js",
"version": "1.1.2",
"version": "1.1.3",
"main": "dist/ainize.js",
"types": "dist/ainize.d.ts",
"scripts": {
Expand Down Expand Up @@ -42,7 +42,7 @@
"typescript": "^4.6.3"
},
"dependencies": {
"@ainblockchain/ain-js": "^1.9.0",
"@ainblockchain/ain-js": "^1.10.0",
"axios": "^0.26.1",
"express": "^4.18.2",
"fast-json-stable-stringify": "^2.1.0",
Expand Down
7 changes: 4 additions & 3 deletions src/ain.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Ain from "@ainblockchain/ain-js";
import { getBlockChainEndpoint } from "./constants";
import { getBlockChainAPIEndpoint, getBlockChainEventEndpoint } from "./constants";
import { TransactionBody } from "@ainblockchain/ain-util";
import { txResult } from "./types/type";
import { Signer } from "@ainblockchain/ain-js/lib/signer/signer";
Expand All @@ -18,8 +18,9 @@ export default class AinModule {
}

initAin(chainId: 0 | 1) {
const blockchainEndpoint = getBlockChainEndpoint(chainId);
this.ain = new Ain(blockchainEndpoint, chainId);
const blockchainAPIEndpoint = getBlockChainAPIEndpoint(chainId);
const blockchainEventEndpoint = getBlockChainEventEndpoint(chainId);
this.ain = new Ain(blockchainAPIEndpoint,blockchainEventEndpoint, chainId);
}

createAccount() {
Expand Down
6 changes: 5 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { appBillingConfig } from "./types/type"

export const getBlockChainEndpoint = (chainId: number) =>{
export const getBlockChainAPIEndpoint = (chainId: number) =>{
return chainId === 1 ? "https://mainnet-api.ainetwork.ai" : "https://testnet-api.ainetwork.ai"
}

export const getBlockChainEventEndpoint = (chainId: number) =>{
return chainId === 1 ? "https://mainnet-event.ainetwork.ai" : "https://testnet-event.ainetwork.ai"
}

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# yarn lockfile v1


"@ainblockchain/ain-js@^1.9.0":
version "1.9.0"
resolved "https://registry.yarnpkg.com/@ainblockchain/ain-js/-/ain-js-1.9.0.tgz#3d04271149f5788bfd1913b604bc6c391327c10b"
integrity sha512-+JVumqje2h0zMIfnqO8kJMq8V3kAzk/ML67nP92qCww7cYvhl3MjX/mUWDUoEb9x5bEHPEulu7VVJvsn8aLrMA==
"@ainblockchain/ain-js@^1.10.0":
version "1.10.0"
resolved "https://registry.yarnpkg.com/@ainblockchain/ain-js/-/ain-js-1.10.0.tgz#2ab91ee9c5f083ef8830e8db528b69c18264aefa"
integrity sha512-4fmL7vaLBesY2de3aTtJTpjT0MO5ezeQSUlZcU5bjm5aY9LCFfCxSy3vkYrAROC7KstNODSfWjzMlpoc9afrWA==
dependencies:
"@ainblockchain/ain-util" "^1.1.9"
"@types/node" "^12.7.3"
Expand Down

0 comments on commit bb9110f

Please sign in to comment.