diff --git a/docs/index.md b/docs/index.md index e0c1a2ae..92594300 100644 --- a/docs/index.md +++ b/docs/index.md @@ -76,6 +76,10 @@ - [combine](#combine) - [submit](#submit) - [generateAddress](#generateaddress) + - [isValidAddress](#isvalidaddress) + - [isValidSecret](#isvalidsecret) + - [deriveKeypair](#derivekeypair) + - [deriveAddress](#deriveaddress) - [signPaymentChannelClaim](#signpaymentchannelclaim) - [verifyPaymentChannelClaim](#verifypaymentchannelclaim) - [computeLedgerHash](#computeledgerhash) @@ -5104,6 +5108,88 @@ return api.generateAddress(); ``` +## isValidAddress + +`isValidAddress(address: string) : boolean + +Checks if the specified string contains a valid ledger address. + +### Parameters + +This method takes one parameter, the address which to validate. + +### Return Value + +This method returns `true` if the address is valid and `false` if it is not. + +### Example + +```javascript +return api.isValidAddress("address") +``` + +## isValidSecret + +`isValidSecret(secret: string) : boolean + +Checks if the specified string contains a valid ledger secret. + +### Parameters + +This method takes one parameter, the secret which to validate. + +### Return Value + +This method returns `true` if the secret is valid and `false` if it is not. + +### Example + +```javascript +return api.isValidSecret("secret") +``` + +## deriveKeypair + +`deriveKeypair(seed: string) : {privateKey: string, publicKey: string}` + +Derive a public and private key from a seed. + +### Parameters + +This method takes one parameter, the seed from which to derive the public and private key. + +### Return Value + +This method returns an object containing the public and private components of the keypair corresponding to the seed. + +### Example + +```javascript +var keypair = api.deriveKeypair(seed) +var public_key = keypair.publicKey; +var private_key = keypair.privateKey; +``` + +## deriveAddress + +`deriveAddress(publicKey: string) : string + +Derive an XRP Ledger address from a public key. + +### Parameters + +This method takes one parameter, the public key from which to derive the address. + +### Return Value + +This method returns a string corresponding to the address derived from the public key. + +### Example + +```javascript +var address = api.deriveAddress(public_key); +``` + ## signPaymentChannelClaim `signPaymentChannelClaim(channel: string, amount: string, privateKey: string): string` diff --git a/docs/src/deriveAddress.md.ejs b/docs/src/deriveAddress.md.ejs new file mode 100644 index 00000000..1a8a1e5c --- /dev/null +++ b/docs/src/deriveAddress.md.ejs @@ -0,0 +1,19 @@ +## deriveAddress + +`deriveAddress(publicKey: string) : string + +Derive an XRP Ledger address from a public key. + +### Parameters + +This method takes one parameter, the public key from which to derive the address. + +### Return Value + +This method returns a string corresponding to the address derived from the public key. + +### Example + +```javascript +var address = api.deriveAddress(public_key); +``` diff --git a/docs/src/deriveKeypair.md.ejs b/docs/src/deriveKeypair.md.ejs new file mode 100644 index 00000000..8597206d --- /dev/null +++ b/docs/src/deriveKeypair.md.ejs @@ -0,0 +1,21 @@ +## deriveKeypair + +`deriveKeypair(seed: string) : {privateKey: string, publicKey: string}` + +Derive a public and private key from a seed. + +### Parameters + +This method takes one parameter, the seed from which to derive the public and private key. + +### Return Value + +This method returns an object containing the public and private components of the keypair corresponding to the seed. + +### Example + +```javascript +var keypair = api.deriveKeypair(seed) +var public_key = keypair.publicKey; +var private_key = keypair.privateKey; +``` diff --git a/docs/src/index.md.ejs b/docs/src/index.md.ejs index 8f23f152..a566f399 100644 --- a/docs/src/index.md.ejs +++ b/docs/src/index.md.ejs @@ -46,6 +46,10 @@ <% include combine.md.ejs %> <% include submit.md.ejs %> <% include generateAddress.md.ejs %> +<% include isValidAddress.md.ejs %> +<% include isValidSecret.md.ejs %> +<% include deriveKeypair.md.ejs %> +<% include deriveAddress.md.ejs %> <% include signPaymentChannelClaim.md.ejs %> <% include verifyPaymentChannelClaim.md.ejs %> <% include computeLedgerHash.md.ejs %> diff --git a/docs/src/isValidAddress.md.ejs b/docs/src/isValidAddress.md.ejs new file mode 100644 index 00000000..4805d080 --- /dev/null +++ b/docs/src/isValidAddress.md.ejs @@ -0,0 +1,19 @@ +## isValidAddress + +`isValidAddress(address: string) : boolean + +Checks if the specified string contains a valid ledger address. + +### Parameters + +This method takes one parameter, the address which to validate. + +### Return Value + +This method returns `true` if the address is valid and `false` if it is not. + +### Example + +```javascript +return api.isValidAddress("address") +``` diff --git a/docs/src/isValidSecret.md.ejs b/docs/src/isValidSecret.md.ejs new file mode 100644 index 00000000..bfce3000 --- /dev/null +++ b/docs/src/isValidSecret.md.ejs @@ -0,0 +1,19 @@ +## isValidSecret + +`isValidSecret(secret: string) : boolean + +Checks if the specified string contains a valid ledger secret. + +### Parameters + +This method takes one parameter, the secret which to validate. + +### Return Value + +This method returns `true` if the secret is valid and `false` if it is not. + +### Example + +```javascript +return api.isValidSecret("secret") +```