Skip to content

Commit

Permalink
Merge pull request #88 from kaiachain/dev
Browse files Browse the repository at this point in the history
version up web3rpc v1.2.1
  • Loading branch information
Sotatek-TanHoang authored Feb 3, 2025
2 parents fe839b8 + b808edb commit bae4262
Show file tree
Hide file tree
Showing 10 changed files with 160 additions and 7 deletions.
3 changes: 3 additions & 0 deletions ethers-ext/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Ethers.js Extension for Kaia offers:
> **_NOTE:_**
> If the import path has no version sub-path (`@kaiachain/ethers-ext`), ethers v5 will be used by default.
> **_NOTE:_**
> @kaiachain/ethers-ext@^1.2.0 recommends node 22 or later if you have issues with ES Module resolution.
- **Don't**: Mixing ethers v6 and ethers-ext for ethers v5

```js
Expand Down
3 changes: 3 additions & 0 deletions js-ext-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Sub-components of Klaytn JavaScript SDKs.

> **_NOTE:_**
> @kaiachain/js-ext-core@^1.2.0 recommends node 22 or later if you have issues with ES Module resolution.
For dApp developers and blockchain users, use the SDKs like [@kaiachain/ethers-ext](https://www.npmjs.com/package/@kaiachain/ethers-ext) and [@kaiachain/web3js-ext](https://www.npmjs.com/package/@kaiachain/web3js-ext).

- `FieldSetFactory` to easily build custom RLP-encodable types
Expand Down
3 changes: 3 additions & 0 deletions web3js-ext/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Web3.js Extension for kaia offers:

## Install

> **_NOTE:_**
> @kaiachain/web3js-ext@^1.2.0 recommends node 22 or later if you have issues with ES Module resolution.
### Node.js

- Install
Expand Down
12 changes: 10 additions & 2 deletions web3js-ext/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion web3rpc/sdk/client/java/java-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inputSpec: ../../../rpc-specs/namespaces/all-except-eth.yaml
groupId: io.kaia
description: RPC API SDK for kaia blockchain node
artifactId: web3rpc-java
artifactVersion: v1.2.0
artifactVersion: v1.2.1
library: retrofit2
templateDir: ./template
globalProperties:
Expand Down
2 changes: 1 addition & 1 deletion web3rpc/sdk/client/javascript/javascript-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ generatorName: web3rpc-javascript
outputDir: ./openapi
inputSpec: ../../../rpc-specs/namespaces/all-except-eth.yaml
projectName: "@kaiachain/web3rpc"
projectVersion: "1.2.0"
projectVersion: "1.2.1"
templateDir: ./template
sortParamsByRequiredFlag: false
globalProperties:
Expand Down
19 changes: 16 additions & 3 deletions web3rpc/sdk/client/javascript/javascript-generate.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
set -e

CURRENT_FILE_DIR=$(cd "$( dirname "$0" )" && pwd)
PROJECT_DIR=$(cd "$CURRENT_FILE_DIR" && cd ../../.. && pwd )
CURRENT_FILE_DIR=$(cd "$(dirname "$0")" && pwd)
PROJECT_DIR=$(cd "$CURRENT_FILE_DIR" && cd ../../.. && pwd)

cd "${CURRENT_FILE_DIR}"
rm -rf "${CURRENT_FILE_DIR}/openapi"
Expand All @@ -22,7 +22,20 @@ cp .openapi-generator-ignore "${CURRENT_FILE_DIR}/openapi"
sh "${PROJECT_DIR}"/bin/web3rpc-openapi-generator-cli generate -c "${CURRENT_FILE_DIR}/javascript-config.yaml"

cd "${CURRENT_FILE_DIR}/openapi"
# override openapi-generator build output
rm .babelrc
cp -rf ../openapi-override/* .
# set version of openapi as defined in javascript-config.yaml
YAML_FILE="../javascript-config.yaml"
PROJECT_VERSION=$(grep 'projectVersion:' "$YAML_FILE" | sed -E 's/^projectVersion: "?([^"]+)"?/\1/')
if [ -n "$PROJECT_VERSION" ]; then
npm version $PROJECT_VERSION
else
echo "projectVersion not found in the file."
exit -1
fi
yarn install
yarn build
yarn link

cd "${CURRENT_FILE_DIR}/opensdk"
Expand All @@ -32,4 +45,4 @@ yarn link

cd "${CURRENT_FILE_DIR}/openapi-test"
yarn link opensdk-javascript
#yarn link web3rpc-javascript
#yarn link web3rpc-javascript
33 changes: 33 additions & 0 deletions web3rpc/sdk/client/javascript/openapi-override/babelrc-cjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"presets": [
"@babel/preset-env"
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-json-strings",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-proposal-function-sent",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-throw-expressions",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-logical-assignment-operators",
"@babel/plugin-proposal-optional-chaining",
[
"@babel/plugin-proposal-pipeline-operator",
{
"proposal": "minimal"
}
],
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-do-expressions",
"@babel/plugin-proposal-function-bind"
]
}
38 changes: 38 additions & 0 deletions web3rpc/sdk/client/javascript/openapi-override/babelrc-esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"presets": [
[
"@babel/preset-env",
{
"modules": false
}
]
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-json-strings",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-proposal-function-sent",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-throw-expressions",
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-logical-assignment-operators",
"@babel/plugin-proposal-optional-chaining",
[
"@babel/plugin-proposal-pipeline-operator",
{
"proposal": "minimal"
}
],
"@babel/plugin-proposal-nullish-coalescing-operator",
"@babel/plugin-proposal-do-expressions",
"@babel/plugin-proposal-function-bind"
]
}
52 changes: 52 additions & 0 deletions web3rpc/sdk/client/javascript/openapi-override/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"name": "@kaiachain/web3rpc",
"description": "JS API client generated by OpenAPI Generator",
"license": "Apache 2.0",
"main": "dist/esm/index.js",
"sideEffects": false,
"exports": {
"import": "./dist/esm/index.js",
"default": "./dist/cjs/index.js"
},
"scripts": {
"build:esm": "babel src -d dist/esm --config-file ./babelrc-esm.json",
"build:cjs": "babel src -d dist/cjs --config-file ./babelrc-cjs.json",
"build": "npm run build:esm && npm run build:cjs",
"prepare": "npm run build",
"test": "mocha --require @babel/register --recursive"
},
"browser": {
"fs": false
},
"dependencies": {
"@babel/cli": "^7.0.0",
"superagent": "^5.3.0"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-decorators": "^7.0.0",
"@babel/plugin-proposal-do-expressions": "^7.0.0",
"@babel/plugin-proposal-export-default-from": "^7.0.0",
"@babel/plugin-proposal-export-namespace-from": "^7.0.0",
"@babel/plugin-proposal-function-bind": "^7.0.0",
"@babel/plugin-proposal-function-sent": "^7.0.0",
"@babel/plugin-proposal-json-strings": "^7.0.0",
"@babel/plugin-proposal-logical-assignment-operators": "^7.0.0",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.0.0",
"@babel/plugin-proposal-numeric-separator": "^7.0.0",
"@babel/plugin-proposal-optional-chaining": "^7.0.0",
"@babel/plugin-proposal-pipeline-operator": "^7.0.0",
"@babel/plugin-proposal-throw-expressions": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-syntax-import-meta": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/register": "^7.0.0",
"expect.js": "^0.3.1",
"mocha": "^8.0.1",
"sinon": "^7.2.0"
},
"files": [
"dist"
]
}

0 comments on commit bae4262

Please sign in to comment.