@ocap/sdk 1.17.3 → 1.17.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +5 -34
  2. package/package.json +7 -7
package/index.d.ts CHANGED
@@ -276,29 +276,19 @@ export interface WalletObject {
276
276
  ethSign(data: string, hashBeforeSign?: boolean): string;
277
277
  ethVerify(data: string, signature: string, hashBeforeVerify?: boolean): boolean;
278
278
  toJSON(): SerializedWallet;
279
+ /**
280
+ * @deprecated ES6: use `wallet.address` instead
281
+ */
279
282
  toAddress(): string;
280
283
  }
281
284
  export declare const WalletType: typeof DidType;
282
285
  /**
283
286
  * Generate an wallet instance that can be used to sign a message or verify a signature
284
- *
285
- * @public
286
- * @static
287
- * @param {object} keyPair - the key pair
288
- * @param {string} keyPair.sk - the secretKey
289
- * @param {string} keyPair.pk - the wallet publicKey
290
- * @param {DIDTypeArg} [type='default'] - wallet type
291
- * @returns {WalletObject} wallet object that can be used to sign/verify/getAddress
292
287
  */
293
288
  export declare function Wallet(keyPair: KeyPairType, t?: DIDTypeArg): WalletObject;
294
289
  /**
295
290
  * Generate a wallet from secretKey
296
291
  *
297
- * @public
298
- * @static
299
- * @param {string} sk - the secret key, `hex encoded string`
300
- * @param {DIDTypeArg} [type='default'] - wallet type
301
- * @returns {WalletObject} wallet object that can be used to sign/verify/getAddress
302
292
  * @example
303
293
  * const assert = require('assert');
304
294
  * const { fromSecretKey } = require('@ocap/wallet');
@@ -317,32 +307,16 @@ export declare function Wallet(keyPair: KeyPairType, t?: DIDTypeArg): WalletObje
317
307
  export declare function fromSecretKey(sk: BytesType, _type?: DIDTypeArg): WalletObject;
318
308
  /**
319
309
  * Generate a wallet from publicKey
320
- *
321
- * @public
322
- * @static
323
- * @param {string} pk - the public key, `hex encoded string`
324
- * @param {DIDTypeArg} [type='default'] - wallet type
325
- * @returns {WalletObject} wallet object that can be used to sign/verify/getAddress
326
310
  */
327
311
  export declare function fromPublicKey(pk: BytesType, _type?: DIDTypeArg): WalletObject;
328
312
  /**
329
313
  * Generate a wallet from address (did)
330
314
  *
331
315
  * Since we do not know the publicKey and secretKey, this kind of wallet cannot be used for signing and verifying
332
- *
333
- * @public
334
- * @static
335
- * @param {string} address - the wallet address
336
- * @returns {WalletObject} wallet object that can be used to sign/verify/getAddress
337
316
  */
338
317
  export declare function fromAddress(address: string): WalletObject;
339
318
  /**
340
319
  * Generate a wallet by generating a random secretKey
341
- *
342
- * @public
343
- * @static
344
- * @param {DIDTypeArg} [type='default'] - wallet type
345
- * @returns {WalletObject} wallet object that can be used to sign/verify/getAddress
346
320
  */
347
321
  export declare function fromRandom(_type?: DIDTypeArg): WalletObject;
348
322
  /**
@@ -351,11 +325,6 @@ export declare function fromRandom(_type?: DIDTypeArg): WalletObject;
351
325
  export declare function fromJSON(json: SerializedWallet): WalletObject;
352
326
  /**
353
327
  * Check if an object is valid wallet object
354
- *
355
- * @public
356
- * @static
357
- * @param {object} wallet
358
- * @param {boolean} canSign - should the wallet support sign
359
328
  */
360
329
  export declare function isValid(wallet: WalletObject, canSign?: boolean): boolean;
361
330
  export {};
@@ -500,6 +469,8 @@ declare namespace ForgeSdkUtil {
500
469
 
501
470
  /*~ Write your module's methods and properties in this class */
502
471
  declare interface OcapSDK {
472
+ constructor(httpEndpoint: string);
473
+
503
474
  getQueries(): string[];
504
475
  getSubscriptions(): string[];
505
476
  getMutations(): string[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ocap/sdk",
3
3
  "description": "Forge javascript SDK packages all-in-one",
4
- "version": "1.17.3",
4
+ "version": "1.17.4",
5
5
  "author": {
6
6
  "name": "wangshijun",
7
7
  "email": "shijun@arcblock.io",
@@ -18,11 +18,11 @@
18
18
  "access": "public"
19
19
  },
20
20
  "dependencies": {
21
- "@arcblock/did-util": "1.17.3",
22
- "@ocap/client": "1.17.3",
23
- "@ocap/message": "1.17.3",
24
- "@ocap/util": "1.17.3",
25
- "@ocap/wallet": "1.17.3",
21
+ "@arcblock/did-util": "1.17.4",
22
+ "@ocap/client": "1.17.4",
23
+ "@ocap/message": "1.17.4",
24
+ "@ocap/util": "1.17.4",
25
+ "@ocap/wallet": "1.17.4",
26
26
  "debug": "^4.3.3",
27
27
  "react-app-polyfill": "^1.0.1"
28
28
  },
@@ -79,5 +79,5 @@
79
79
  "test": "jest --forceExit --detectOpenHandles",
80
80
  "coverage": "yarn test -- --coverage"
81
81
  },
82
- "gitHead": "7a74e4e2b362a6e6ea8d14617f0480966c3363d5"
82
+ "gitHead": "296f3dccba7a691244212a51481fffcf142fc138"
83
83
  }