diff --git a/HISTORY.md b/HISTORY.md index b992a6d1..849b7b30 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,17 @@ # ripple-lib Release History +## UNRELEASED + ++ Add address/secret/key validation and derivation methods ([#932](https://github.com/ripple/ripple-lib/pull/932)) + + `isValidAddress(address: string) : boolean`: Checks if the specified string contains a valid address. + + `isValidSecret(secret: string): boolean`: Checks if the specified string contains a valid secret. + + `deriveKeypair(seed: string): {privateKey: string, publicKey: string}`: Derive a public and private key from a seed. + + `deriveAddress(publicKey: string): string`: Derive an XRP Ledger address from a public key. ++ To derive an address from a secret: + 1. Derive the public key from the secret. + 2. Derive the address from the public key. + + Example: `const address = api.deriveAddress(api.deriveKeypair(secret).publicKey)` + ## 1.0.0 (2018-08-30) We are pleased to announce the release of `ripple-lib` version 1.0.0. diff --git a/docs/index.md b/docs/index.md index 92594300..a9863cdc 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5110,13 +5110,13 @@ return api.generateAddress(); ## isValidAddress -`isValidAddress(address: string) : boolean +`isValidAddress(address: string): boolean` -Checks if the specified string contains a valid ledger address. +Checks if the specified string contains a valid address. ### Parameters -This method takes one parameter, the address which to validate. +This method takes one parameter, the address to validate. ### Return Value @@ -5130,9 +5130,9 @@ return api.isValidAddress("address") ## isValidSecret -`isValidSecret(secret: string) : boolean +`isValidSecret(secret: string): boolean` -Checks if the specified string contains a valid ledger secret. +Checks if the specified string contains a valid secret. ### Parameters @@ -5150,7 +5150,7 @@ return api.isValidSecret("secret") ## deriveKeypair -`deriveKeypair(seed: string) : {privateKey: string, publicKey: string}` +`deriveKeypair(seed: string): {privateKey: string, publicKey: string}` Derive a public and private key from a seed. @@ -5172,7 +5172,7 @@ var private_key = keypair.privateKey; ## deriveAddress -`deriveAddress(publicKey: string) : string +`deriveAddress(publicKey: string): string` Derive an XRP Ledger address from a public key. diff --git a/docs/src/deriveAddress.md.ejs b/docs/src/deriveAddress.md.ejs index 1a8a1e5c..b9ec496f 100644 --- a/docs/src/deriveAddress.md.ejs +++ b/docs/src/deriveAddress.md.ejs @@ -1,6 +1,6 @@ ## deriveAddress -`deriveAddress(publicKey: string) : string +`deriveAddress(publicKey: string): string` Derive an XRP Ledger address from a public key. diff --git a/docs/src/deriveKeypair.md.ejs b/docs/src/deriveKeypair.md.ejs index 8597206d..b8dd163f 100644 --- a/docs/src/deriveKeypair.md.ejs +++ b/docs/src/deriveKeypair.md.ejs @@ -1,6 +1,6 @@ ## deriveKeypair -`deriveKeypair(seed: string) : {privateKey: string, publicKey: string}` +`deriveKeypair(seed: string): {privateKey: string, publicKey: string}` Derive a public and private key from a seed. diff --git a/docs/src/isValidAddress.md.ejs b/docs/src/isValidAddress.md.ejs index 4805d080..ff61b20f 100644 --- a/docs/src/isValidAddress.md.ejs +++ b/docs/src/isValidAddress.md.ejs @@ -1,12 +1,12 @@ ## isValidAddress -`isValidAddress(address: string) : boolean +`isValidAddress(address: string): boolean` -Checks if the specified string contains a valid ledger address. +Checks if the specified string contains a valid address. ### Parameters -This method takes one parameter, the address which to validate. +This method takes one parameter, the address to validate. ### Return Value diff --git a/docs/src/isValidSecret.md.ejs b/docs/src/isValidSecret.md.ejs index bfce3000..66bf1952 100644 --- a/docs/src/isValidSecret.md.ejs +++ b/docs/src/isValidSecret.md.ejs @@ -1,8 +1,8 @@ ## isValidSecret -`isValidSecret(secret: string) : boolean +`isValidSecret(secret: string): boolean` -Checks if the specified string contains a valid ledger secret. +Checks if the specified string contains a valid secret. ### Parameters