mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-04 11:55:50 +00:00
Minor fix
This commit is contained in:
@@ -5,26 +5,28 @@ Verifies that a specific credential exists on the XRPL and is valid.
|
||||
Quick install & usage:
|
||||
|
||||
```sh
|
||||
blob
|
||||
npm install
|
||||
```
|
||||
|
||||
`verify_credential.js` can also be used as a commandline utility. Full usage statement:
|
||||
|
||||
```sh
|
||||
$ ./verify_credential.js -h
|
||||
usage: verify_credential.js [-h] [-b] [-n {devnet,testnet,mainnet}]
|
||||
[issuer] [subject] [credential_type]
|
||||
|
||||
Usage: verify-credential [options] [issuer] [subject] [credential_type]
|
||||
|
||||
Verify an XRPL credential
|
||||
|
||||
positional arguments:
|
||||
issuer Credential issuer address as base58.
|
||||
subject Credential subject (holder) address as base58.
|
||||
credential_type Credential type as string
|
||||
Arguments:
|
||||
issuer Credential issuer address as base58 (default:
|
||||
"rEzikzbnH6FQJ2cCr4Bqmf6c3jyWLzkonS")
|
||||
subject Credential subject (holder) address as base58 (default:
|
||||
"rsYhHbanGpnYe3M6bsaMeJT5jnLTfDEzoA")
|
||||
credential_type Credential type as string. (default: "my_credential")
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
-b, --binary Use binary (hexadecimal) for credential_type
|
||||
-n, --network {devnet,testnet,mainnet}
|
||||
Use the specified network for lookup
|
||||
Options:
|
||||
-b, --binary Use binary (hexadecimal) for credential_type
|
||||
-n, --network <network> {devnet,testnet,mainnet} Use the specified network for lookup (default: "devnet")
|
||||
-q, --quiet Don't print log messages
|
||||
-h, --help display help for command
|
||||
```
|
||||
|
||||
@@ -30,12 +30,11 @@ async function verifyCredential(client, issuer, subject, credentialType, binary=
|
||||
* as of the most recently validated ledger.
|
||||
* Parameters:
|
||||
* client - Client for interacting with rippled servers.
|
||||
* issuer - Address of the credential issuer, in base58
|
||||
* subject - Address of the credential holder/subject, in base58
|
||||
* issuer - Address of the credential issuer, in base58.
|
||||
* subject - Address of the credential holder/subject, in base58.
|
||||
* credentialType - Credential type to check for as a string,
|
||||
* which will be encoded as UTF-8 (1-128 bytes long).
|
||||
* binary - Specifies that the credential type is provided in hexadecimal format.
|
||||
* verbose - If true, print details to stdout during lookup.
|
||||
* You must provide the credential_type as input.
|
||||
* Returns True if the account holds the specified, valid credential.
|
||||
* Returns False if the credential is missing, expired, or not accepted.
|
||||
@@ -81,7 +80,7 @@ async function verifyCredential(client, issuer, subject, credentialType, binary=
|
||||
logger.info("Credential was not found");
|
||||
return false;
|
||||
} else {
|
||||
//Other errors, for example invalidly-specified addresses.
|
||||
// Other errors, for example invalidly pecified addresses.
|
||||
throw new XRPLLookupError(xrplResponse);
|
||||
}
|
||||
}
|
||||
@@ -129,7 +128,7 @@ async function verifyCredential(client, issuer, subject, credentialType, binary=
|
||||
|
||||
// Commandline usage -----------------------------------------------------------
|
||||
async function main() {
|
||||
// JSON-RPC URLs of public servers
|
||||
// Websocket URLs of public servers
|
||||
const NETWORKS = {
|
||||
devnet: "wss://s.devnet.rippletest.net:51233",
|
||||
testnet: "wss://s.altnet.rippletest.net:51233",
|
||||
|
||||
Reference in New Issue
Block a user