Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #573 from jimni1222/readme
Browse files Browse the repository at this point in the history
Added troubleshooting contents in readme and deleted an unused file
  • Loading branch information
jimni1222 authored Jan 19, 2022
2 parents 927dd25 + 6b20757 commit 330503e
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 197 deletions.
59 changes: 58 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
# caver-js

caver-js is a JavaScript API library that allows developers to interact with a
Klaytn node using a HTTP or Websocket connection.
Klaytn node using a HTTP or Websocket connection.

**NOTE**
Kaikas Web Extension Wallet is recommended to be used with [features prior to common architecture](https://docs.klaytn.com/dapp/sdk/caver-js/v1.4.1). New features provided in caver-js v1.5.0 (introduced common architecrue) or later are currently not compatible with Kaikas.
Kaikas web extension wallet works fine with functions prior to common architecture, so please use [functions prior to common architecture](https://docs.klaytn.com/dapp/sdk/caver-js/v1.4.1).
Even in the latest version of caver-js, [functions prior to common architecture](https://docs.klaytn.com/dapp/sdk/caver-js/v1.4.1) are provided for backward compatibility. See [Trouble shooting and known issues](#connect-with-kaikas-web-extension) for more details.

## Table of contents

Expand All @@ -22,6 +27,7 @@ Klaytn node using a HTTP or Websocket connection.
* [Error Code Improvement](#error-code-improvement)
* [Sample Projects](#sample-projects)
* [Github Repository](#github-repository)
* [Trouble shooting and known issues](#trouble-shooting-and-known-issues)
* [Related Projects](#related-projects)

## Requirements
Expand Down Expand Up @@ -296,6 +302,57 @@ The BApp (Blockchain Application) Development sample projects using caver-js are
* [Count BApp](https://docs.klaytn.com/bapp/tutorials/count-bapp)
* [Klaystagram](https://docs.klaytn.com/bapp/tutorials/klaystagram)

## Trouble shooting and known issues

### Connect with Kaikas Web Extension

Kaikas Web Extension Wallet works normally with [functions prior to common architecture](https://docs.klaytn.com/dapp/sdk/caver-js/v1.4.1).
Features provided in later versions (caver-js v1.5.0~) may not work with Kaikas Web Extension Wallet.

If the following error occurs when using with Kaikas, it must be modified to use the [functions supported by caver-js v1.4.1](https://docs.klaytn.com/dapp/sdk/caver-js/v1.4.1).
For compatibility with the latest version, the same [functions provided by caver-js v1.4.0](https://docs.klaytn.com/dapp/sdk/caver-js/v1.4.1) are provided.

```
Kaikas only processes one transaction at a time. Open Kaikas and refresh the pending transaction. If the service doesn’t process your transaction for a while, cancel the pending transaction.
```

```
Kaikas는 한 번에 하나의 트랜잭션만 처리합니다. Kaikas를 열어 대기 중인 트랜잭션을 새로고침 해주세요. 만약 대기 상태가 계속된다면 이용 중인 서비스가 트랜잭션을 처리하지 않는 것이니 트랜잭션을 취소바랍니다.
```

Although the above error is mostly the case, other errors may occur besides the above error, so if you are using Kaikas Web Extension Wallet, please use the [functions supported by caver-js v1.4.1](https://docs.klaytn.com/dapp/sdk/caver-js/v1.4.1).
Keep in mind that you **cannot mix features** before and after common architecture.

For documents for the functions supported by caver-js v1.4.1, refer to [caver-js ~v1.4.1 Documentation](https://docs.klaytn.com/dapp/sdk/caver-js/v1.4.1).

### Using webpack >= 5

Node.js module polyfills are not provided by default in webpack v5 and later.
Therefore, you need to install the missing modules and add them to the `resolve.fallback` property of the webpack.config.js file in the form below.

```
module.exports = {
...
resolve: {
fallback: {
fs: false,
net: false,
stream: require.resolve('stream-browserify'),
crypto: require.resolve('crypto-browserify'),
http: require.resolve('stream-http'),
https: require.resolve('https-browserify'),
os: require.resolve('os-browserify/browser'),
...
},
},
}
```

More information on migrating to webpack v5 can be found [here](https://webpack.js.org/migrate/5/#clean-up-configuration).

If you are implementing an app using [create-react-app](https://create-react-app.dev/), you can use [react-app-rewired](https://www.npmjs.com/package/react-app-rewired) to add the above polyfills to the webpack.config.js file used by [CRA](https://create-react-app.dev/).
More information on using react-app-rewired with create-react-app can be found [here](https://www.npmjs.com/package/react-app-rewired).

## Github Repository

* [caver-js](https://github.com/klaytn/caver-js)
Expand Down
25 changes: 12 additions & 13 deletions packages/caver-klay/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/

const _ = require('lodash')
const util = require('util')

const core = require('../../caver-core')
const { formatters } = require('../../caver-core-helpers')
Expand Down Expand Up @@ -168,13 +167,13 @@ const Klay = function Klay(...args) {
this.KIP7._klayAccounts = this.accounts
this.KIP7.currentProvider = this._requestManager.provider

const kip7Deprecated =
'`caver.klay.KIP7` has been deprecated. `caver.klay.KIP7` works using only `caver.klay.accounts.wallet`. If you are using `caver.wallet` then use `caver.kct.kip7`.'
// Overwrite constructor with deprecate warning
this.KIP7 = util.deprecate(this.KIP7, kip7Deprecated)
// const kip7Deprecated =
// '`caver.klay.KIP7` has been deprecated. `caver.klay.KIP7` works using only `caver.klay.accounts.wallet`. If you are using `caver.wallet` then use `caver.kct.kip7`.'
// // Overwrite constructor with deprecate warning
// this.KIP7 = util.deprecate(this.KIP7, kip7Deprecated)

// Overwrite static deloy method with deprecate warning
this.KIP7.deploy = util.deprecate(this.KIP7.deploy, kip7Deprecated)
// // Overwrite static deloy method with deprecate warning
// this.KIP7.deploy = util.deprecate(this.KIP7.deploy, kip7Deprecated)

this.KIP17 = KIP17
this.KIP17.defaultAccount = this.defaultAccount
Expand All @@ -183,13 +182,13 @@ const Klay = function Klay(...args) {
this.KIP17._klayAccounts = this.accounts
this.KIP17.currentProvider = this._requestManager.provider

const kip17Deprecated =
'`caver.klay.KIP17` has been deprecated. `caver.klay.KIP17` works using only `caver.klay.accounts.wallet`. If you are using `caver.wallet` then use `caver.kct.kip17`.'
// Overwrite constructor with deprecate warning
this.KIP17 = util.deprecate(KIP17, kip17Deprecated)
// const kip17Deprecated =
// '`caver.klay.KIP17` has been deprecated. `caver.klay.KIP17` works using only `caver.klay.accounts.wallet`. If you are using `caver.wallet` then use `caver.kct.kip17`.'
// // Overwrite constructor with deprecate warning
// this.KIP17 = util.deprecate(KIP17, kip17Deprecated)

// Overwrite static deloy method with deprecate warning
this.KIP17.deploy = util.deprecate(this.KIP17.deploy, kip17Deprecated)
// // Overwrite static deloy method with deprecate warning
// this.KIP17.deploy = util.deprecate(this.KIP17.deploy, kip17Deprecated)

// add IBAN
this.Iban = utils.Iban
Expand Down
183 changes: 0 additions & 183 deletions test.js

This file was deleted.

0 comments on commit 330503e

Please sign in to comment.