Freight Trust - TrueNFT dApp API (1.0.0)

Download OpenAPI specification:Download

API reference for the Freight Trust dApp which allows recording, transfering and signing of EDI-based documents such as bills of lading or warehouse receipts.

Proxy and Upgrade

Allows Freight Trust to Control the App

Gets address of Function

Gets address that is delegate called to run a function's logic.

query Parameters
id
required
string 10 characters

The function selector the return the target of

Responses

Response samples

Content type
No sample

Gets address of the Master Contract

Gets the address of the master contract.

Responses

Response samples

Content type
No sample

Gets address of the controler Contract

Gets the address of the controler contract.

Responses

Response samples

Content type
No sample

Gets address of the Universal Proxy Contract

Gets the address of the Universal Proxy contract.

Responses

Response samples

Content type
No sample

Sets the address of Function

Sets address that is delegate called to run a function's logic. This function must be called with an signed nonce from the Freight Trust account in the https body.

query Parameters
id
required
string 10 characters

Function selector whose target to change.

target
required
string 42 characters

The address to set the function too

Request Body schema: application/json

The Freight Trust signature of the nonce

signature
required
string 132 characters

Responses

Request samples

Content type
application/json
{
  • "signature": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstring"
}

Response samples

Content type
No sample

Sets the address of Function

Sets address that is delegate called to run a function's logic. This function must be called with an signed nonce from the Freight Trust account in the https body.

query Parameters
newMaster
required
string 42 characters

The new master address

Request Body schema: application/json

The Freight Trust signature of the nonce

signature
required
string 132 characters

Responses

Request samples

Content type
application/json
{
  • "signature": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstring"
}

Response samples

Content type
No sample

Sets the the new controller address

Sets the new controller address.

query Parameters
newController
required
string 42 characters

The new controller address

Request Body schema: application/json

The Freight Trust signature of the nonce

signature
required
string 132 characters

Responses

Request samples

Content type
application/json
{
  • "signature": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstring"
}

Response samples

Content type
No sample

Pauses the execution

Calls the pause method in the universal proxy, blocking any state changes while Freight Trust's Network Operations Group updates.

Request Body schema: application/json

The Freight Trust signature of the nonce

signature
required
string 132 characters

Responses

Request samples

Content type
application/json
{
  • "signature": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstring"
}

Response samples

Content type
No sample

ERC721 Token

Exposes the Freight Trust nonfungible token methods

Returns the token contract's name

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "type": "string",
  • "message": "string"
}

Returns the token contract's symbol

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "type": "string",
  • "message": "string"
}

An API endpoint to get the total supply of tokens in the ERC721 contract

Returns the total supply of Non fungible tokens

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "type": "string",
  • "message": "string"
}

Enumerate NFTs assigned to an owner

query Parameters
tokenId
required
integer [ 0 .. 1.157920892373162e+77 ]

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "type": "string",
  • "message": "string"
}

Returns an interface's support status

query Parameters
interfaceId
required
integer [ 0 .. 4294967295 ]

The Id of the interface to check

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "type": "string",
  • "message": "string"
}

Returns the token identifier of the `index`-th nft tracked by the contract

query Parameters
index
required
integer [ 0 .. 1.157920892373162e+77 ]

A counter less than totalSupply()

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "type": "string",
  • "message": "string"
}

Returns the token identifier of the `index`-th nft assigned to the `owner`

query Parameters
owner
required
string 42 characters

The address of the owner

index
required
integer [ 0 .. 1.157920892373162e+77 ]

The index of the nft assigned to the owner

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "type": "string",
  • "message": "string"
}

Count all NFTs assigned to an owner

query Parameters
owner
required
string 42 characters

The address of the owner

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "type": "string",
  • "message": "string"
}

Find the owner of an NFT

query Parameters
tokenId
required
integer [ 0 .. 1.157920892373162e+77 ]

The Id of the token in question

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "type": "string",
  • "message": "string"
}

Transfers the ownership of an NFT from one address to another address

query Parameters
from
required
string 42 characters

The sender of the transfer

to
required
string 42 characters

The recipient of the transfer

tokenId
required
integer [ 0 .. 1.157920892373162e+77 ]

The id of the token to be transferred

extraData
string

Optional data to be sent with the transaction

Request Body schema: application/json

The Freight Trust signature of the nonce

signature
required
string 132 characters

Responses

Request samples

Content type
application/json
{
  • "signature": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstring"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "type": "string",
  • "message": "string"
}

Transfer ownership of an NFT without safety checks

Allows Freight Trust to tranfer tokens unsafely -- THE CALLER IS RESPONSIBLE TO CONFIRM THAT _to IS CAPABLE OF RECEIVING NFTS OR ELSE THEY MAY BE PERMANENTLY LOST

query Parameters
from
required
string 42 characters

The sender of the transfer

to
required
string 42 characters

The recipient of the transfer

tokenId
required
integer [ 0 .. 1.157920892373162e+77 ]

The id of the token to be transferred

Request Body schema: application/json

The Freight Trust signature of the nonce

signature
required
string 132 characters

Responses

Request samples

Content type
application/json
{
  • "signature": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstring"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "type": "string",
  • "message": "string"
}

Change or reaffirm the approved address for an NFT

query Parameters
approved
required
string 42 characters

The address being approved

tokenId
required
integer [ 0 .. 1.157920892373162e+77 ]

The id of the token to be approved

Request Body schema: application/json

The Freight Trust signature of the nonce

signature
required
string 132 characters

Responses

Request samples

Content type
application/json
{
  • "signature": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstring"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "type": "string",
  • "message": "string"
}

Allows Freight Trust to issue univeral approval

Enable or disable approval for a third party (operator) to manage all of Freight Trust's assets

query Parameters
operator
required
string 42 characters

Address to add to the set of authorized operators

approved
required
boolean

True if the operator is approved, false to revoke approval

Request Body schema: application/json

The Freight Trust signature of the nonce

signature
required
string 132 characters

Responses

Request samples

Content type
application/json
{
  • "signature": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstring"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "type": "string",
  • "message": "string"
}

Get the approved address for a single NFT

The approved address for this NFT, or the zero address if there is none

query Parameters
tokenId
required
integer [ 0 .. 1.157920892373162e+77 ]

The NFT to find the approved address for

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "type": "string",
  • "message": "string"
}

Query if an address is an authorized operator for another address

True if operator is an approved operator for owner, false otherwise

query Parameters
owner
required
string 42 characters

The address that owns the NFTs

operator
required
string 42 characters

The address that acts on behalf of the owner

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "type": "string",
  • "message": "string"
}

Signed Transfer

Allows Freight Trust to sign and transfer a ERC721 token on the behalf of its holder

query Parameters
from
required
string 42 characters

The sender of the transfer

to
required
string 42 characters

The recipient of the transfer

tokenId
required
integer [ 0 .. 1.157920892373162e+77 ]

The id of the token to be transferred

data
string

Optional data to be sent with the transaction

Request Body schema: application/json

The Freight Trust authorization signature followed by the signature of the sender of the transfer.

object (auth)
object (auth)

Responses

Request samples

Content type
application/json
{
  • "freightTrustAuth":
    {
    },
  • "senderAuth":
    {
    }
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "type": "string",
  • "message": "string"
}

Creates a new record

Allows Freight Trust to create a record with the signature of the owner and of the participant.

query Parameters
recordID
required
string 66 characters

The identifying hash of the record

owner
required
string 42 characters

The owner of the record

participant
required
string 42 characters

The address of the participant in the record

Request Body schema: application/json

The Freight Trust nonce signature, followed by the owner's signature and the participant's signature

object (auth)
object (auth)
object (auth)

Responses

Request samples

Content type
application/json
{
  • "freightTrustAuth":
    {
    },
  • "ownerAuth":
    {
    },
  • "partAuth":
    {
    }
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "type": "string",
  • "message": "string"
}

Versions a record for Freight Trust

Allows Freight Trust to version one of the records they own.

query Parameters
current
required
string 66 characters

The identifying hash of the record

new
required
string 66 characters

The new identifying hash of the record

Request Body schema: application/json

The Freight Trust nonce signature to verify this action

signature
required
string 132 characters

Responses

Request samples

Content type
application/json
{
  • "signature": "stringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstringstring"
}

Versions a record for the owner

Allows Freight Trust to version a record for the owner using the owner's signature.

query Parameters
current
required
string 66 characters

The identifying hash of the record

new
required
string 66 characters

The new identifying hash of the record

owner
string 42 characters

The owner of the record which will be updated

Request Body schema: application/json

The Freight Trust nonce signature followed by the owner's signature

object (auth)
object (auth)

Responses

Request samples

Content type
application/json
{
  • "freightTrustAuth":
    {
    },
  • "ownerAuth":
    {
    }
}

Returns the current message Freight Trust needs to sign to verify their next post request

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "type": "string",
  • "message": "string"
}