From 5b2e3270fd7f5bf0fe7dd5a1d87ae9c42b00e531 Mon Sep 17 00:00:00 2001 From: akaster99 Date: Tue, 7 May 2024 09:31:36 +0900 Subject: [PATCH 1/3] ain-js version update --- package.json | 2 +- src/ain.ts | 7 ++++--- src/constants.ts | 6 +++++- yarn.lock | 8 ++++---- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 7feb51b..e26feb1 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/ain.ts b/src/ain.ts index 8b6c3fc..7b1ef2a 100644 --- a/src/ain.ts +++ b/src/ain.ts @@ -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"; @@ -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() { diff --git a/src/constants.ts b/src/constants.ts index cecbed1..3297640 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,9 +1,13 @@ 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" } + export const Path = { app: (appName: string): any => { return { diff --git a/yarn.lock b/yarn.lock index 20ddc49..b39b1ef 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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" From d0907841f814867a33871352764e4d6d2a2b7fbf Mon Sep 17 00:00:00 2001 From: akaster99 Date: Tue, 7 May 2024 10:12:42 +0900 Subject: [PATCH 2/3] intent --- src/constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/constants.ts b/src/constants.ts index 3297640..bc9f189 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -3,11 +3,11 @@ import { appBillingConfig } from "./types/type" 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" } - export const Path = { app: (appName: string): any => { return { From 60b0f4aa98a11641e1fc3db5144e44b3cb1e8fd1 Mon Sep 17 00:00:00 2001 From: yoojinko Date: Tue, 7 May 2024 01:15:09 +0000 Subject: [PATCH 3/3] Upgrade version to 1.1.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e26feb1..0f1f866 100644 --- a/package.json +++ b/package.json @@ -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": {