Anchor

Anchor

A warpping class that connects Anchor API.

Constructor

new Anchor(client, accessOptions)

Creates an instance of anchor api.

Parameters:
Name Type Description
client ApiClient

The Api client to use to connect with KAS.

accessOptions AccessOptions

An instance of AccessOptions including chainId, accessKeyId and secretAccessKey.

Members

auth :string

Type:
  • string

accessOptions :AccessOptions

Type:

accessKeyId :string

Type:
  • string

secretAccessKey :string

Type:
  • string

chainId :string

Type:
  • string

apiInstances :object

Type:
  • object

client :object

Type:
  • object

anchorApi :DataAnchoringTransactionApi

Type:

operatorApi :OperatorApi

Type:

Methods

sendAnchoringData(operator, payload, callbackopt) → {AnchorBlockStatus}

Sends data to be anchored to the Klaytn blockchain platform.
POST /v1/anchor

Parameters:
Name Type Attributes Description
operator string

Operator address to send ChainDataAnchoring transaction.

payload object

Data to be anchored to the Klaytn blockchain platform.

callback function <optional>

The callback function to call.

Returns:
Type
AnchorBlockStatus

getAnchoringTransactionList(operator, queryOptionsopt, callbackopt) → {AnchorTransactions}

Gets for anchoring transaction list generated by a specific operator.
GET /v1/operator/{operator-id}/tx

Parameters:
Name Type Attributes Description
operator string

The address of the operator that anchored the data.

queryOptions AnchorQueryOptions <optional>

Filters required when retrieving data. size, fromTimestamp, toTimestamp, and cursor.

callback function <optional>

The callback function to call.

Returns:
Type
AnchorTransactions

getAnchoringTransactionByTxHash(operator, transactionHash, callbackopt) → {AnchorTransactionDetail}

Gets anchoring transaction generated by the transaction hash.
GET /v1/operator/{operator-id}/tx/{transaction-hash}

Parameters:
Name Type Attributes Description
operator string

The address of the operator that anchored the data.

transactionHash string

The transaction hash to query.

callback function <optional>

The callback function to call.

Returns:
Type
AnchorTransactionDetail

getAnchoringTransactionByPayloadId(operator, payloadId, callbackopt) → {AnchorTransactionDetail}

Gets anchoring transaction generated by the payload id.
GET /v1/operator/{operator-id}/payload/{payload-id}

Parameters:
Name Type Attributes Description
operator string

The address of the operator that anchored the data.

payloadId string

The payload id to query.

callback function <optional>

The callback function to call.

Returns:
Type
AnchorTransactionDetail

getOperatorList(queryOptionsopt, callbackopt) → {Operators}

Gets operator list.
GET /v1/operator

Parameters:
Name Type Attributes Description
queryOptions AnchorQueryOptions <optional>

Filters required when retrieving data. size, fromTimestamp, toTimestamp, and cursor.

callback function <optional>

The callback function to call.

Returns:
Type
Operators

getOperator(operator, callbackopt) → {Operator}

Gets operator information.
GET /v1/operator/{operator-id}

Parameters:
Name Type Attributes Description
operator string

The address of the operator.

callback function <optional>

The callback function to call.

Returns:
Type
Operator