描述:
- 连接钱包:正常
- 查询账户余额:正常
- 转账时,弹出MetaMask的签名窗口:正常
- 点击签名授权后,转账失败。
- 该问题只出现于主网。
- Aggron网络:一切顺利。成功的tx
send tx error Error: JSONRPCError:
server error {"code":-1,
"message":"CKBInternalError: Script(TransactionScriptError { source: Inputs[0].Lock, cause: ValidationFailure(-1): the exit code is per script specific, for system scripts, please check https://github.com/nervosnetwork/ckb-system-scripts/wiki/Error-codes })",
"data":"Error { kind: Script, inner: TransactionScriptError { source: Inputs[0].Lock, cause: ValidationFailure(-1): the exit code is per script specific, for system scripts, please check https://github.com/nervosnetwork/ckb-system-scripts/wiki/Error-codes } }"}
查看CKB中的错误码:
-1的意思是:
Argument length error. If the script receives an invalid length of arguments, this would be returned. Typically this means the lock/type script structure constructed has a problem, or a signature has an incorrect length.
引用pw-core的版本信息
"dependencies": {
"@lay2/pw-core": "^0.4.0-alpha.6",
"@nervosnetwork/ckb-sdk-core": "^0.40.0",
"@nervosnetwork/ckb-sdk-rpc": "^0.40.0",
"@nervosnetwork/ckb-sdk-utils": "^0.40.0",
"assert": "^2.0.0",
"axios": "^0.21.1",
"buffer": "^5.7.1",
"ckb-js-toolkit": "^0.10.2",
"crypto-browserify": "^3.12.0",
"https-browserify": "^1.0.0",
"lodash": "^4.17.21",
"os-browserify": "^0.3.0",
"stream-browserify": "^3.0.0",
"stream-http": "^3.1.1",
"url": "^0.11.0"
},
初始化Provider
// 1
const p = await this.web3Modal.connect();
this.provider = new Web3ModalProvider(new Web3(p));
// 2
//this.provider = new EthProvider();
相关代码
在线测试
- 地址
- 连接钱包:导航栏:Connect >> PW >> ETH
- 如果成功连接钱包:访客的人物卡片会更新;作者/站长的CKB卡片的底部中间,会出现转账按钮
- 转账时,可以把地址修改成您自己的另一个地址进行测试。
不知道有没有人遇到过类似的问题?
谢谢!