Skip to content

Latest commit

 

History

History
670 lines (403 loc) · 16.4 KB

api_reference.md

File metadata and controls

670 lines (403 loc) · 16.4 KB

Modules

overledger-bundle
overledger-core
overledger-dlt-abstract
overledger-dlt-bitcoin
overledger-dlt-ethereum
overledger-dlt-substrate
overledger-dlt-xrp-ledger
overledger-oauth-provider
overledger-provider
overledger-types

Classes

OverledgerSDK
Bitcoin
Ethereum
Substrate
Ripple
Provider

Typedefs

Account : Object

An Overledger Account instance for a single DLT.

DLTOptions : Object

Options for loading a DLT in the SDK.

NetworkOptions : string

Overledger network options.

ProviderOptions : Object

Overledger network provider options.

SDKOptions : Object

Overledger SDK options.

overledger-bundle

overledger-bundle.default

Main Overledger SDK bundle. Includes all the packages for all supported DLTs.

overledger-core

overledger-core.default

Core Overledger SDK class. Individual dlt packages must be installed manually.

overledger-core.log

**

overledger-dlt-abstract

overledger-dlt-abstract.AbstractDLT

new AbstractDLT(sdk)

Param Type
sdk any

abstractDLT.createAccount()

Create an account for a specific DLT

Abstract method to be implemented in each DLT

abstractDLT.setAccount(AccountInfo)

Param Type Description
AccountInfo Account The standardised Account Object

Set an account for signing transactions for a specific DLT

Abstract method to be implemented in each DLT

abstractDLT.getEcho()

overledger-dlt-abstract.default

Abstract class for DLT modules. All DLT packages need to extend this class.

overledger-dlt-bitcoin

overledger-dlt-bitcoin.default

Development package for Bitcoin blockchain.

overledger-dlt-bitcoin.log

overledger-dlt-ethereum

overledger-dlt-ethereum.default

Development package for Ethereum.

overledger-dlt-ethereum.log

overledger-dlt-substrate

overledger-dlt-substrate.default

Development package for Substrate.

overledger-dlt-substrate.log

overledger-dlt-xrp-ledger

overledger-dlt-xrp-ledger.default

Development package for Ripple (XRP Ledger).

overledger-dlt-xrp-ledger.log

overledger-oauth-provider

overledger-oauth-provider.default

Oauth provider package.

overledger-oauth-provider.log

overledger-provider

overledger-provider.TESTNET

Constant for the testnet URL.

overledger-provider.MAINNET

Constant for the mainnet URL (placeholder).

overledger-provider.default

Network provider package.

overledger-provider.log

overledger-types

overledger-types.DltNameOptions

OverledgerSDK

new OverledgerSDK(options)

Param Type Description
options SDKOptions The DLT Options and Provider Options

Create the Overledger SDK

overledgerSDK.dlts

The object storing the DLTs loaded by the Overledger SDK

overledgerSDK.validateOptions(options)

Param Type Description
options SDKOptions The DLT Options and Provider Options

Validate the provided Overledger SDK Options

overledgerSDK.loadDlt(config)

Param Type Description
config DLTOptions DLT name and an optional Private Key to use as the main account

Load the DLT in the Overledger SDK

Returns: AbstractDLT - The loaded DLT class

overledgerSDK.getEcho(echoRequest)

Param
echoRequest

Calls echoecho endpoint, just used to see if things connect

overledgerSDK.refreshAccessToken()

refresh access token

overledgerSDK.getTokensUsingClientIdAndSecret()

get new set of tokens using username, password, clientId and clientSecret

overledgerSDK.sign(unsignedData)

Param
unsignedData

Signing a prepared object

Bitcoin

new Bitcoin(sdk, options)

Param Type Description
sdk any the sdk instance
options Object any additional options to instantiate this dlt

bitcoin.name

Name of the DLT

bitcoin.symbol

Symbol of the DLT

bitcoin.createAccount()

Create a Bitcoin account

Returns: Account - the new Bitcoin account

bitcoin.setAccount(accountInfo)

Param Type Description
accountInfo Account The standardised account information

Set an account for signing transactions for a specific DLT

Ethereum

new Ethereum(sdk)

Param Type Description
sdk any the sdk instance

ethereum.name

Name of the DLT

ethereum.symbol

Symbol of the DLT

ethereum.createAccount()

Create an Ethereum account

Returns: Account - the new Ethereum account

ethereum.setAccount(accountInfo)

Param Type Description
accountInfo Account The standardised account information

Set an account for signing transactions for a specific DLT

Substrate

new Substrate(sdk, options)

Param Type Description
sdk any the sdk instance
options Object any additional options to instantiate this dlt

substrate.createAccount()

Create a Substrate account

Returns: Account - the new Substrate account

substrate.setAccount(accountInfo)

Param Type Description
accountInfo Account The standardised account information

Set an account for signing transactions for a specific DLT

Ripple

new Ripple(sdk)

Param Type
sdk any

ripple.name

Name of the DLT

ripple.symbol

Symbol of the DLT

ripple.createAccount()

Create an XRP account

Returns: Account - (privateKey, address)

ripple.setAccount(accountInfo)

Param Type Description
accountInfo Account The standardised account information

Set an account for signing for a specific DLT

ripple.isValidSeed()

ripple seed validation

Provider

new Provider(ProviderOptions)

Param Type Description
ProviderOptions ProviderOptions Overledger network provider options

provider.createRequest(path, accessToken, contentType, acceptString)

Param
path
accessToken
contentType
acceptString

Creating a request, making this as flexible as possible with the possible values in the headers being passed in the method signature

Account

Properties

Name Type Description
privateKey string The private key of the account, used for signing transactions.
address string The address of the account, used for receiving messages
publicKey string The public key of the account. The address parameter will be a representation of this public key.
password string For some accounts, they may be protected by a password, or a password is used instead of a private key
provider string If the account is stored or managed not by the user, then this person is the provider

An Overledger Account instance for a single DLT.

DLTOptions

Properties

Name Type Description
dlt string The distributed ledger technology.
[privateKey] string The private key of an account for the respecitve dlt.

Options for loading a DLT in the SDK.

NetworkOptions

Overledger network options.

ProviderOptions

Properties

Name Type Description
[network] NetworkOptions The network, either testnet, mainnet or custom.
[timeout] number Request timeout period specified in milliseconds.

Overledger network provider options.

SDKOptions

Properties

Name Type Description
dlts Array.<DLTOptions> The dlts to be loaded.
[provider] ProviderOptions The network provider options.

Overledger SDK options.