Skip to content

Commit 6d4a210

Browse files
committed
fix(params): add params initialize value
1 parent ffc9d32 commit 6d4a210

File tree

8 files changed

+15
-12
lines changed

8 files changed

+15
-12
lines changed

dist/anyweb-js-sdk.umd.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/anyweb-js-sdk.umd.min.js.map

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@idealight-labs/anyweb-js-sdk",
33
"description": "AnyWeb JavaScript Software Development Kit",
4-
"version": "1.3.5",
4+
"version": "1.3.6",
55
"license": "LGPL-3.0",
66
"author": "[email protected]",
77
"repository": {

dist/src/interface/provider.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ConsoleLike } from '../utils/types';
88
*/
99
export interface IRequestArguments {
1010
readonly method: string;
11-
readonly params?: unknown;
11+
readonly params?: unknown[];
1212
readonly chainId?: number;
1313
}
1414
export interface IBaseProviderOptions {

dist/src/provider.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export declare class Provider implements IProvider {
5858
* @param params
5959
* @protected
6060
*/
61-
protected rawRequest(method: string, params?: any): Promise<unknown>;
61+
protected rawRequest(method: string, params?: any[]): Promise<unknown>;
6262
/**
6363
* Monitor information
6464
* @param type {string} Type of information

dist/src/provider.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class Provider {
156156
* @protected
157157
*/
158158
// eslint-disable-next-line @typescript-eslint/no-explicit-any
159-
rawRequest(method, params) {
159+
rawRequest(method, params = []) {
160160
var _a, _b, _c, _d, _e, _f, _g;
161161
return __awaiter(this, void 0, void 0, function* () {
162162
if (!Provider.ready) {
@@ -221,7 +221,7 @@ class Provider {
221221
})
222222
: '',
223223
}, this);
224-
case 'cfx_personal_sign':
224+
case 'cfx_personalSign':
225225
return yield (0, common_1.callIframe)('personalSign', {
226226
appId: this.appId,
227227
chainId: this.chainId,

src/interface/provider.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { ConsoleLike } from '../utils/types'
99
*/
1010
export interface IRequestArguments {
1111
readonly method: string
12-
readonly params?: unknown
12+
readonly params?: unknown[]
1313
readonly chainId?: number
1414
}
1515

src/provider.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,10 @@ export class Provider implements IProvider {
195195
* @protected
196196
*/
197197
// eslint-disable-next-line @typescript-eslint/no-explicit-any
198-
protected async rawRequest(method: string, params?: any): Promise<unknown> {
198+
protected async rawRequest(
199+
method: string,
200+
params: any[] = []
201+
): Promise<unknown> {
199202
if (!Provider.ready) {
200203
throw new ProviderRpcError(
201204
ProviderErrorCode.SDKNotReady,

0 commit comments

Comments
 (0)