@@ -11,13 +11,11 @@ import * as Crypto from '@aeternity/aepp-sdk/es/utils/crypto'
11
11
* [ @aeternity/aepp-sdk /es/utils/crypto] ( #module_@aeternity/aepp-sdk/es/utils/crypto )
12
12
* _ static_
13
13
* [ .decode] ( #module_@aeternity/aepp-sdk/es/utils/crypto.decode ) ⇒ ` Array `
14
- * [ .isBase64(str)] ( #module_@aeternity/aepp-sdk/es/utils/crypto.isBase64 ) ⇒ ` boolean `
15
14
* [ .formatAddress(format, address)] ( #module_@aeternity/aepp-sdk/es/utils/crypto.formatAddress ) ⇒ ` String `
16
15
* [ .isAddressValid(address, prefix)] ( #module_@aeternity/aepp-sdk/es/utils/crypto.isAddressValid ) ⇒ ` Boolean `
17
16
* [ .addressToHex(base58CheckAddress)] ( #module_@aeternity/aepp-sdk/es/utils/crypto.addressToHex ) ⇒ ` String `
18
17
* [ .addressFromDecimal(decimalAddress)] ( #module_@aeternity/aepp-sdk/es/utils/crypto.addressFromDecimal ) ⇒ ` String `
19
18
* [ .hash(input)] ( #module_@aeternity/aepp-sdk/es/utils/crypto.hash ) ⇒ ` Buffer `
20
- * [ .nameId(input)] ( #module_@aeternity/aepp-sdk/es/utils/crypto.nameId ) ⇒ ` Buffer `
21
19
* [ .sha256hash(input)] ( #module_@aeternity/aepp-sdk/es/utils/crypto.sha256hash ) ⇒ ` String `
22
20
* [ .salt()] ( #module_@aeternity/aepp-sdk/es/utils/crypto.salt ) ⇒ ` Number `
23
21
* [ .encodeBase64Check(input)] ( #module_@aeternity/aepp-sdk/es/utils/crypto.encodeBase64Check ) ⇒ ` Buffer `
@@ -41,11 +39,10 @@ import * as Crypto from '@aeternity/aepp-sdk/es/utils/crypto'
41
39
* [ .decryptPrivateKey(password)] ( #module_@aeternity/aepp-sdk/es/utils/crypto.decryptPrivateKey ) ⇒ ` Buffer `
42
40
* [ .decryptPubKey(password)] ( #module_@aeternity/aepp-sdk/es/utils/crypto.decryptPubKey ) ⇒ ` Buffer `
43
41
* [ .assertedType(data, type, forceError)] ( #module_@aeternity/aepp-sdk/es/utils/crypto.assertedType ) ⇒ ` String ` \| ` Boolean `
44
- * [ .decodeTx(password )] ( #module_@aeternity/aepp-sdk/es/utils/crypto.decodeTx ) ⇒ ` Array `
42
+ * [ .decodeTx(txHash )] ( #module_@aeternity/aepp-sdk/es/utils/crypto.decodeTx ) ⇒ ` Buffer `
45
43
* [ .encodeTx(txData)] ( #module_@aeternity/aepp-sdk/es/utils/crypto.encodeTx ) ⇒ ` String `
46
44
* [ .isValidKeypair(privateKey, publicKey)] ( #module_@aeternity/aepp-sdk/es/utils/crypto.isValidKeypair ) ⇒ ` Boolean `
47
- * [ .envKeypair(env)] ( #module_@aeternity/aepp-sdk/es/utils/crypto.envKeypair ) ⇒ ` Object `
48
- * [ .deserialize(binary, opts)] ( #module_@aeternity/aepp-sdk/es/utils/crypto.deserialize ) ⇒ ` Object `
45
+ * [ .envKeypair(env, [ force] )] ( #module_@aeternity/aepp-sdk/es/utils/crypto.envKeypair ) ⇒ ` Object `
49
46
* [ .encryptData(msg, publicKey)] ( #module_@aeternity/aepp-sdk/es/utils/crypto.encryptData ) ⇒ ` Object `
50
47
* [ .decryptData(secretKey, encryptedData)] ( #module_@aeternity/aepp-sdk/es/utils/crypto.decryptData ) ⇒ ` Buffer ` \| ` null `
51
48
* _ inner_
@@ -64,18 +61,6 @@ RLP decode
64
61
| --- | --- | --- |
65
62
| data | ` Buffer ` \| ` String ` \| ` Integer ` \| ` Array ` | Data to decode |
66
63
67
- <a id =" module_@aeternity/aepp-sdk/es/utils/crypto.isBase64 " ></a >
68
-
69
- ### @aeternity/aepp-sdk /es/utils/crypto.isBase64(str) ⇒ ` boolean `
70
- Check whether a string is valid base-64.
71
-
72
- ** Kind** : static method of [ ` @aeternity/aepp-sdk/es/utils/crypto ` ] ( #module_@aeternity/aepp-sdk/es/utils/crypto )
73
- ** Returns** : ` boolean ` - True if the string is valid base-64, false otherwise.
74
-
75
- | Param | Type | Description |
76
- | --- | --- | --- |
77
- | str | ` string ` | String to validate. |
78
-
79
64
<a id =" module_@aeternity/aepp-sdk/es/utils/crypto.formatAddress " ></a >
80
65
81
66
### @aeternity/aepp-sdk /es/utils/crypto.formatAddress(format, address) ⇒ ` String `
@@ -143,20 +128,6 @@ Calculate 256bits Blake2b hash of `input`
143
128
| --- | --- | --- |
144
129
| input | ` String ` \| ` Buffer ` | Data to hash |
145
130
146
- <a id =" module_@aeternity/aepp-sdk/es/utils/crypto.nameId " ></a >
147
-
148
- ### @aeternity/aepp-sdk /es/utils/crypto.nameId(input) ⇒ ` Buffer `
149
- Calculate 256bits Blake2b nameId of ` input `
150
- as defined in https://github.com/aeternity/protocol/blob/master/AENS.md#hashing
151
-
152
- ** Kind** : static method of [ ` @aeternity/aepp-sdk/es/utils/crypto ` ] ( #module_@aeternity/aepp-sdk/es/utils/crypto )
153
- ** Returns** : ` Buffer ` - Hash
154
- ** rtype** : ` (input: String) => hash: String `
155
-
156
- | Param | Type | Description |
157
- | --- | --- | --- |
158
- | input | ` String ` | Data to hash |
159
-
160
131
<a id =" module_@aeternity/aepp-sdk/es/utils/crypto.sha256hash " ></a >
161
132
162
133
### @aeternity/aepp-sdk /es/utils/crypto.sha256hash(input) ⇒ ` String `
@@ -378,7 +349,7 @@ Verify that signature was signed by public key
378
349
379
350
| Param | Type | Description |
380
351
| --- | --- | --- |
381
- | str | ` String ` | Data to verify |
352
+ | str | ` String ` \| ` Buffer ` | Data to verify |
382
353
| signature | ` Buffer ` | Signature to verify |
383
354
| publicKey | ` Buffer ` | Key to verify against |
384
355
@@ -466,16 +437,16 @@ Assert base58 encoded type and return its payload
466
437
467
438
<a id =" module_@aeternity/aepp-sdk/es/utils/crypto.decodeTx " ></a >
468
439
469
- ### @aeternity/aepp-sdk /es/utils/crypto.decodeTx(password ) ⇒ ` Array `
440
+ ### @aeternity/aepp-sdk /es/utils/crypto.decodeTx(txHash ) ⇒ ` Buffer `
470
441
Decode a transaction
471
442
472
443
** Kind** : static method of [ ` @aeternity/aepp-sdk/es/utils/crypto ` ] ( #module_@aeternity/aepp-sdk/es/utils/crypto )
473
- ** Returns** : ` Array ` - Decoded transaction
444
+ ** Returns** : ` Buffer ` - Decoded transaction
474
445
** rtype** : ` (txHash: String) => Buffer `
475
446
476
447
| Param | Type | Description |
477
448
| --- | --- | --- |
478
- | password | ` String ` | Password to decrypt with |
449
+ | txHash | ` String ` | Transaction hash |
479
450
480
451
<a id =" module_@aeternity/aepp-sdk/es/utils/crypto.encodeTx " ></a >
481
452
@@ -508,7 +479,7 @@ Sign a message, and then verifying that signature
508
479
509
480
<a id =" module_@aeternity/aepp-sdk/es/utils/crypto.envKeypair " ></a >
510
481
511
- ### @aeternity/aepp-sdk /es/utils/crypto.envKeypair(env) ⇒ ` Object `
482
+ ### @aeternity/aepp-sdk /es/utils/crypto.envKeypair(env, [ force ] ) ⇒ ` Object `
512
483
Obtain key pair from ` env `
513
484
514
485
Designed to be used with ` env ` from nodejs. Assumes enviroment variables
@@ -518,23 +489,10 @@ Designed to be used with `env` from nodejs. Assumes enviroment variables
518
489
** Returns** : ` Object ` - Key pair
519
490
** rtype** : ` (env: Object) => {publicKey: String, secretKey: String}, throws: Error `
520
491
521
- | Param | Type | Description |
522
- | --- | --- | --- |
523
- | env | ` Object ` | Environment |
524
-
525
- <a id =" module_@aeternity/aepp-sdk/es/utils/crypto.deserialize " ></a >
526
-
527
- ### @aeternity/aepp-sdk /es/utils/crypto.deserialize(binary, opts) ⇒ ` Object `
528
- Deserialize ` binary ` state channel transaction
529
-
530
- ** Kind** : static method of [ ` @aeternity/aepp-sdk/es/utils/crypto ` ] ( #module_@aeternity/aepp-sdk/es/utils/crypto )
531
- ** Returns** : ` Object ` - Channel data
532
- ** rtype** : ` (binary: String) => Object `
533
-
534
- | Param | Type | Description |
535
- | --- | --- | --- |
536
- | binary | ` String ` | Data to deserialize |
537
- | opts | ` Object ` | Options |
492
+ | Param | Type | Default | Description |
493
+ | --- | --- | --- | --- |
494
+ | env | ` Object ` | | Environment |
495
+ | [ force] | ` Boolean ` | <code >false</code > | Force throwing error |
538
496
539
497
<a id =" module_@aeternity/aepp-sdk/es/utils/crypto.encryptData " ></a >
540
498
0 commit comments