TrueNFT – B2B NFT Protocol – TrueNFT-B2B NFT协议区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,TrueNFT – B2B NFT Protocol – TrueNFT-B2B NFT协议区块链毕设代写 是一篇很好的国外资料

TrueNFT – B2B NFT Protocol

Overview

TrueNFT enables B2B Messages to be tokenized either through EDI or XML Mappings and Data Ingestion

TrueNFT Protocol Diagram

Valid Server Setup

  1. Deploy the NFT and Master Proxy contracts

  2. Deploy the Universal Proxy contract with the Master Proxy’s address and an admin address (this should be a human account) as input

  3. Deploy the Controller contract with the Universal Proxy’s address and an admin address (the same address as in step 2) an input

  4. Call changeController through the Universal Proxy from the admin address. The controller should be changed to the controller address deployed in step

Steps 1-3 cannot be performed through the API. Step 4 can if the controller_address is originally set to equal the universal_address. This solution is not ideal, so all of the steps 1-4 should be completed during the server setup.

Security & Development

These smart contracts will need to be updated for gas efficiency and to verify their security in the upcoming weeks.

The basic smart contract implementation is a functional set of smart contracts that will meet the implementation needs of any company using EDI X12/EDIFACT.

API Contract Testing

  • The continuous integration for github is a script that will run the postman and truffle tests on new commits added to the github repository.

  • The truffle tests are a set of javascript unit tests that will verify the modular properties of the codebase to ensure that it always meets the intention of the smart contract architecture. They are designed to have near-complete code coverage and thus should prevent most bugs.

  • The postman api unit tests are a set of tests for each api endpoint that verify that the endpoints will reject on invalid inputs and return the right data types.

In combination with the truffle tests, the postman tests will verify the integrity of the whole codebase.

The javascript endpoint implementation of the endpoints extends the test endpoints from last week. Now, in addition to data sanitation and returning proper values, they will parse the input data, format transactions and make ethereum calls through the infura web3. The new endpoints will also properly validate Corporate signatures of the nonce which protects admin transactions.

Usage

SEE API

Deployments

SEE DEPLOYMENTS

Roadmap

Development Dates

GraphQL

2020 Q4

Gas Optimizations

2020 Q4

Composability

2020 Q4

Abstract

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.

Endpoints

Default

getNonce

GET /getNonce

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

Description

Parameters

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 1. http response codes

Code Message Datatype

200

Successful query

ApiResponse

428

Request Timeout

<<>>

Samples

ERC721Token

approve

POST /nft/approve/

Change or reaffirm the approved address for an NFT

Description

Parameters

Body Parameter
Name Description Required Default Pattern

auth

The Freight Trust signature of the nonce Auth

X

Query Parameters
Name Description Required Default Pattern

approved

The address being approved

X

null

tokenId

The id of the token to be approved

X

null

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 2. http response codes

Code Message Datatype

200

Successful Approve

ApiResponse

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

balanceOf

GET /nft/balanceOf/

Count all NFTs assigned to an owner

Description

Parameters
Query Parameters
Name Description Required Default Pattern

owner

The address of the owner

X

null

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 3. http response codes

Code Message Datatype

200

Successful Query

ApiResponse

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

createRecord

POST /nft/createRecord/

Creates a new record

Description

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

Parameters

Body Parameter
Name Description Required Default Pattern

auth

InlineObject1

X

Query Parameters
Name Description Required Default Pattern

recordID

The identifying hash of the record

X

null

owner

The owner of the record

X

null

participant

The address of the participant in the record

X

null

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 4. http response codes

Code Message Datatype

200

Successful Creation

ApiResponse

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

getApprovedById

GET /nft/getApproved/

Get the approved address for a single NFT

Description

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

Parameters
Query Parameters
Name Description Required Default Pattern

tokenId

The NFT to find the approved address for

X

null

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 5. http response codes

Code Message Datatype

200

Successful Query

ApiResponse

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

isApprovedForAll

GET /nft/isApprovedForAll/

Query if an address is an authorized operator for another address

Description

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

Parameters
Query Parameters
Name Description Required Default Pattern

owner

The address that owns the NFTs

X

null

operator

The address that acts on behalf of the owner

X

null

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 6. http response codes

Code Message Datatype

200

Successful Query

ApiResponse

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

name

GET /nft/name

Returns the token contract’s name

Description

Parameters

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 7. http response codes

Code Message Datatype

200

Successful query

ApiResponse

428

Request Timeout

<<>>

Samples

ownerOf

GET /nft/ownerOf/

Find the owner of an NFT

Description

Parameters
Query Parameters
Name Description Required Default Pattern

tokenId

The Id of the token in question

X

null

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 8. http response codes

Code Message Datatype

200

Successful Query

ApiResponse

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

safeTransferFrom

POST /nft/safeTransferFrom/

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

Description

Parameters

Body Parameter
Name Description Required Default Pattern

auth

The Freight Trust signature of the nonce Auth

X

Query Parameters
Name Description Required Default Pattern

from

The sender of the transfer

X

null

to

The recipient of the transfer

X

null

tokenId

The id of the token to be transferred

X

null

extraData

Optional data to be sent with the transaction

null

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 9. http response codes

Code Message Datatype

200

Successful Transfer

ApiResponse

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

setApprovalForAll

POST /nft/setApprovalForAll/

Allows Freight Trust to issue univeral approval

Description

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

Parameters

Body Parameter
Name Description Required Default Pattern

auth

The Freight Trust signature of the nonce Auth

X

Query Parameters
Name Description Required Default Pattern

operator

Address to add to the set of authorized operators

X

null

approved

True if the operator is approved, false to revoke approval

X

null

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 10. http response codes

Code Message Datatype

200

Successful Approve

ApiResponse

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

signedTransfer

POST /nft/signedTransfer/

Signed Transfer

Description

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

Parameters

Body Parameter
Name Description Required Default Pattern

auth

InlineObject

X

Query Parameters
Name Description Required Default Pattern

from

The sender of the transfer

X

null

to

The recipient of the transfer

X

null

tokenId

The id of the token to be transferred

X

null

data

Optional data to be sent with the transaction

null

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 11. http response codes

Code Message Datatype

200

Successful Transfer

ApiResponse

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

supportsInterfaceById

GET /nft/supportsInterface/

Returns an interface’s support status

Description

Parameters
Query Parameters
Name Description Required Default Pattern

interfaceId

The Id of the interface to check

X

null

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 12. http response codes

Code Message Datatype

200

Successful Query

ApiResponse

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

symbol

GET /nft/symbol

Returns the token contract’s symbol

Description

Parameters

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 13. http response codes

Code Message Datatype

200

Successful query

ApiResponse

428

Request Timeout

<<>>

Samples

tokenByIndex

GET /nft/tokenByIndex/

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

Description

Parameters
Query Parameters
Name Description Required Default Pattern

index

A counter less than `totalSupply()`

X

null

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 14. http response codes

Code Message Datatype

200

Successful Query

ApiResponse

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

tokenOfOwnerByIndex

GET /nft/tokenOfOwnerByIndex/

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

Description

Parameters
Query Parameters
Name Description Required Default Pattern

owner

The address of the owner

X

null

index

The index of the nft assigned to the owner

X

null

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 15. http response codes

Code Message Datatype

200

Successful Query

ApiResponse

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

tokenURIById

GET /nft/tokenURI/

Enumerate NFTs assigned to an owner

Description

Parameters
Query Parameters
Name Description Required Default Pattern

tokenId

X

null

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 16. http response codes

Code Message Datatype

200

Successful Query

ApiResponse

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

totalSupply

GET /nft/totalSupply

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

Description

Returns the total supply of Non fungible tokens

Parameters

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 17. http response codes

Code Message Datatype

200

Successful query

ApiResponse

428

Request Timeout

<<>>

Samples

transferFrom

POST /nft/transferFrom/

Transfer ownership of an NFT without safety checks

Description

Allows Freight Trust to tranfer tokens unsafely — 

THE CALLER IS RESPONSIBLE TO CONFIRM THAT IS CAPABLE OF RECEIVING NFTS OR ELSE THEY MAY BE PERMANENTLY LOST

Parameters

Body Parameter
Name Description Required Default Pattern

auth

The Freight Trust signature of the nonce Auth

X

Query Parameters
Name Description Required Default Pattern

from

The sender of the transfer

X

null

to

The recipient of the transfer

X

null

tokenId

The id of the token to be transferred

X

null

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 18. http response codes

Code Message Datatype

200

Successful Transfer

ApiResponse

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

versionRecord

POST /nft/versionRecord/

Versions a record for Freight Trust

Description

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

Parameters

Body Parameter
Name Description Required Default Pattern

auth

The Freight Trust nonce signature to verify this action Auth

X

Query Parameters
Name Description Required Default Pattern

current

The identifying hash of the record

X

null

new

The new identifying hash of the record

X

null

Return Type

Responses
Table 19. http response codes

Code Message Datatype

200

Successful Edit

<<>>

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

versionRecordSigned

POST /nft/versionRecord/signed/

Versions a record for the owner

Description

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

Parameters

Body Parameter
Name Description Required Default Pattern

auth

InlineObject2

X

Query Parameters
Name Description Required Default Pattern

current

The identifying hash of the record

X

null

new

The new identifying hash of the record

X

null

owner

The owner of the record which will be updated

null

Return Type

Responses
Table 20. http response codes

Code Message Datatype

200

Successful Editing

<<>>

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

ProxyAndUpgrade

changeController

POST /proxy/changeController/

Sets the the new controller address

Description

Sets the new controller address.

Parameters

Body Parameter
Name Description Required Default Pattern

auth

The Freight Trust signature of the nonce Auth

X

Query Parameters
Name Description Required Default Pattern

newController

The new controller address

X

null

Return Type

ApiResponse

Content Type
  • application/xml

  • application/json

Responses
Table 21. http response codes

Code Message Datatype

200

Successfuly Changed

ApiResponse

425

Invalid Input

<<>>

Samples

changeMaster

POST /proxy/changeMaster/

Sets the address of Function

Description

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.

Parameters

Body Parameter
Name Description Required Default Pattern

auth

The Freight Trust signature of the nonce Auth

X

Query Parameters
Name Description Required Default Pattern

newMaster

The new master address

X

null

Return Type

ApiResponse

Content Type
  • application/xml

  • application/json

Responses
Table 22. http response codes

Code Message Datatype

200

Successfuly Changed

ApiResponse

425

Invalid Input

<<>>

Samples

getControler

GET /proxy/getControler

Gets address of the controler Contract

Description

Gets the address of the controler contract.

Parameters

Return Type

ApiResponse

Content Type
  • application/xml

  • application/json

Responses
Table 23. http response codes

Code Message Datatype

200

successful operation

ApiResponse

Samples

getMaster

GET /proxy/getMaster

Gets address of the Master Contract

Description

Gets the address of the master contract.

Parameters

Return Type

ApiResponse

Content Type
  • application/xml

  • application/json

Responses
Table 24. http response codes

Code Message Datatype

200

successful operation

ApiResponse

Samples

getTarget

GET /proxy/getTarget/

Gets address of Function

Description

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

Parameters
Query Parameters
Name Description Required Default Pattern

id

The function selector the return the target of

X

null

Return Type

ApiResponse

Content Type
  • application/xml

  • application/json

Responses
Table 25. http response codes

Code Message Datatype

200

successful operation

ApiResponse

425

Invalid Input

<<>>

Samples

getUniversalProxy

GET /proxy/getUniversalProxy

Gets address of the Universal Proxy Contract

Description

Gets the address of the Universal Proxy contract.

Parameters

Return Type

ApiResponse

Content Type
  • application/xml

  • application/json

Responses
Table 26. http response codes

Code Message Datatype

200

successful operation

ApiResponse

Samples

pause

POST /proxy/pause

Pauses the execution

Description

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

Parameters

Body Parameter
Name Description Required Default Pattern

auth

The Freight Trust signature of the nonce Auth

X

Return Type

ApiResponse

Content Type
  • application/xml

  • application/json

Responses
Table 27. http response codes

Code Message Datatype

200

Successfuly Paused

ApiResponse

425

Invalid Input

<<>>

Samples

setTarget

POST /proxy/setTarget/

Sets the address of Function

Description

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.

Parameters

Body Parameter
Name Description Required Default Pattern

auth

The Freight Trust signature of the nonce Auth

X

Query Parameters
Name Description Required Default Pattern

id

Function selector whose target to change.

X

null

target

The address to set the function too

X

null

Return Type

ApiResponse

Content Type
  • application/xml

  • application/json

Responses
Table 28. http response codes

Code Message Datatype

200

Successfuly Changed

ApiResponse

425

Invalid Input

<<>>

Samples

Models

ApiResponse

Field Name Required Type Description Format

code

Integer

int32

type

String

message

String

Auth

Field Name Required Type Description Format

signature

X

String

InlineObject

Field Name Required Type Description Format

freightTrustAuth

auth

senderAuth

auth

InlineObject1

Field Name Required Type Description Format

freightTrustAuth

auth

ownerAuth

auth

partAuth

auth

InlineObject2

Field Name Required Type Description Format

freightTrustAuth

auth

ownerAuth

auth

License

Copyright 2020 © FreightTrust and Clearing Corporation All Rights Reserved – https://freighttrust.com

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/

Merge branch ‘master’ of github.com:freight-trust/truenft


TrueNFT – B2B NFT Protocol

Overview

TrueNFT使B2B消息能够通过EDI或XML映射和数据摄取进行标记化

TrueNFT Protocol Diagram

Valid Server Setup

  1. 部署NFT和主代理契约

  2. 使用主代理地址和管理地址(这应该是一个人工帐户)作为输入部署通用代理契约

  3. 使用通用代理的地址和管理地址(与步骤2中的地址相同)输入通过通用代理从管理地址调用changeController。控制器应更改为步骤中部署的控制器地址。

  4. 步骤1-3无法通过API执行。如果控制器地址最初设置为等于通用地址,则步骤4可以。此解决方案并不理想,因此所有步骤1-4都应在服务器设置期间完成。

这些智能合约需要在未来几周内更新,以提高天然气效率,并验证其安全性。

Security & Development

基本智能合约实施是一套功能性的智能合约,可满足任何使用EDI X12/EDIFACT的公司的实施需求。

github的持续集成是一个脚本,它将对添加到github存储库的新提交运行postman和truffle测试。

API Contract Testing

  • truffle测试是一组javascript单元测试,将验证代码库的模块化属性,以确保它始终符合智能合约架构的意图。它们被设计成具有近乎完整的代码覆盖率,因此应该可以防止大多数错误。

  • postman api单元测试是针对每个api端点的一组测试,这些测试验证端点是否会拒绝无效输入并返回正确的数据类型。整个基片的完整性测试将在测试后进行验证。

  • 端点的javascript端点实现扩展了上周的测试端点。现在,除了数据卫生和返回正确的值之外,他们还将解析输入数据、格式化事务并通过infuraweb3进行以太坊eth调用。新的端点还将正确验证保护管理事务的nonce的公司签名。

请参见API

查看部署

Usage

GraphQL

Deployments

2020年第4季度

Roadmap

Development Dates

天然气优化

2020年第4季度

获取/获取Nonce

返回当前消息Freight Trust需要签名以验证其下一个post请求

ApiResponse

应用程序/json

Abstract

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.

Endpoints

Default

getNonce

200查询成功;

发布/nft/approve/

Description

Parameters

Return Type

更改或重申nft的批准地址

Content Type
  • 认证

Responses
Table 1. http response codes

Code Message Datatype

非认证机构的货运信托签名

X

批准的地址

X

令牌id

Samples

ERC721Token

approve

待批准令牌的id

X

Description

Parameters

Body Parameter
Name Description Required Default Pattern

auth

The Freight Trust signature of the nonce Auth

X

Query Parameters
Name Description Required Default Pattern

快速响应

应用/json应用

200

200

成功审批

The id of the token to be approved

X

null

Return Type

坏请求请求

Content Type
  • application/json

Responses
Table 2. http response codes

Code Message Datatype

坏请求

Successful Approve

ApiResponse

420

Bad Request

<<>>

428

请求超时

<<>>

Samples

balanceOf

p>获取/nft/balanceOf<

计数所有分配给所有者的所有非功能的非功能,

Description

Parameters
Query Parameters
Name Description Required Default Pattern

owner

The address of the owner

X

null

Return Type

ApiResponse

Content Type
  • 拥有者,

Responses
Table 3. http response codes

Code Message Datatype

200

Successful Query

420

>>>>>>>>>>>>

>>>

允许Freight Trust创建一个由所有者和参与者签名的记录。

p

Xppp

p

ppp>p在

应用程序/json

Samples

createRecord

200

成功创建

Description

ApiResponse

Parameters

Body Parameter
Name Description Required Default Pattern

420

错误请求

&lt;

Query Parameters
Name Description Required Default Pattern

428

请求超时

&lt;>>

获取/nft/getApproved/

获取单个nft的批准地址

此nft的批准地址,或零地址,如果没有

令牌ID

NFT为

X

ApiResponse

应用程序/json

Return Type

200

Content Type
  • 成功查询

Responses
Table 4. http response codes

Code Message Datatype

ApiResponse

420

错误请求;

428

请求超时

&lt;>>

GET/nft/isApprovedForAll/

查询某个地址是否是另一个地址的授权操作员

如果操作员是所有者的批准操作员,则为True,否则

Samples

getApprovedById

所有者

拥有NFT的地址

Description

X

Parameters
Query Parameters
Name Description Required Default Pattern

操作员

代表所有者的地址

ApiResponse

Return Type

应用程序/json

Content Type
  • 200

Responses
Table 5. http response codes

Code Message Datatype

200

Successful Query

>&lt;&lt;gt;

428

请求超时时间

<<>>

请求超时

Request Timeout

>

Samples

isApprovedForAll

GET /nft/isApprovedForAll/

获取/nft/name

Description

返回代金合同的名称

Parameters
Query Parameters
Name Description Required Default Pattern

owner

API响应

应用程序/json

200

成功查询的查询

The address that acts on behalf of the owner

p>p>428

请求超时

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 6. http response codes

Code Message Datatype

200

Successful Query

ApiResponse

420

Bad Request

<<>>

428

gt;

GET/nft/ownerOf/

Samples

name

查找nft的所有者

令牌Id

Description

Parameters

Return Type

相关令牌的Id

Content Type
  • X

Responses
Table 7. http response codes

Code Message Datatype

ApiResponse

应用程序/json

200

成功查询

ApiResponse

Samples

ownerOf

420

错误请求;

Description

Parameters
Query Parameters
Name Description Required Default Pattern

428

请求超时;

POST/nft/safeTransferFrom/

将非金融交易的所有权从一个地址转移到另一个地址

Return Type

认证

Content Type
  • 非现金授权的货运信托签名

Responses
Table 8. http response codes

Code Message Datatype

X

来自

发送人

X

令牌id

要传输的令牌的id

X

空值

Samples

safeTransferFrom

附加数据

随事务一起发送的可选数据

Description

Parameters

Body Parameter
Name Description Required Default Pattern

ApiResponse

应用程序/json

Query Parameters
Name Description Required Default Pattern

200

成功传输

ApiResponse

ApiResponse

420

请求;

POST/nft/setApprovalForAll/

允许Freight Trust发布统一批准

启用或禁用第三方(运营商)管理货运信托的所有资产的审批

验证

当前身份验证的货运信托签名

X

操作员

要添加到授权操作员

X

null

Return Type

批准

Content Type
  • 如果操作员被批准,则为假,撤销批准

Responses
Table 9. http response codes

Code Message Datatype

X

null

ApiResponse

应用程序/json

200

ApiResponse

420

错误请求

&lt;>

Samples

setApprovalForAll

428

请求超时

Description

&lt;

Parameters

Body Parameter
Name Description Required Default Pattern

POST/nft/signedTransfer/

签名转让

允许货运信托代表其持有人签署和转让ERC721代币

Query Parameters
Name Description Required Default Pattern

授权

InlineObject

X

来自转账发送方

X

发送给

传输接收者

Return Type

X

Content Type
  • null

Responses
Table 10. http response codes

Code Message Datatype

令牌id

要传输的令牌的id

X

数据

随事务一起发送的可选数据传输

API响应

420

错误请求

Samples

signedTransfer

&lt;>>

428

Description

请求超时;

Parameters

Body Parameter
Name Description Required Default Pattern

GET/nft/supportsInterface/

返回接口的支持状态

interfaceId

Query Parameters
Name Description Required Default Pattern

要检查的接口的Id

X

空值

ApiResponse

应用程序/json

200

成功查询

ApiResponse

420

错误请求

428

请求超时

&lt;>>

GET/nft/symbol

返回代币合约的符号

ApiResponse

Return Type

应用程序/json

Content Type
  • 200

Responses
Table 11. http response codes

Code Message Datatype

成功查询

ApiResponse

428

请求超时

&lt&lt;>;

GET/nft/tokenByIndex/

返回由合同跟踪的索引th nft的令牌标识符

索引

一个小于“totalSupply()`”的计数器

Samples

supportsInterfaceById

X

Description

Parameters
Query Parameters
Name Description Required Default Pattern

ApiResponse

应用程序/json

200

查询成功

Return Type

ApiResponse

Content Type
  • 420

Responses
Table 12. http response codes

Code Message Datatype

请求;

GET/nft/tokenOfOwnerByIndex/

返回分配给所有者的索引th nft的令牌标识符

所有者的地址

X

索引

分配给所有者的nft的索引

200

Samples

symbol

查询成功

ApiResponse

Description

Parameters

Return Type

420

Content Type
  • 错误请求

Responses
Table 13. http response codes

Code Message Datatype

&lt;>

Successful query

428

请求超时

&lt;>>

<<>>

Samples

tokenByIndex

GET/nft/tokenURI/

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

Description

Parameters
Query Parameters
Name Description Required Default Pattern

index

A counter less than `totalSupply()`

X

null

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 14. http response codes

Code Message Datatype

200

Successful Query

ApiResponse

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

tokenOfOwnerByIndex

GET /nft/tokenOfOwnerByIndex/

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

Description

Parameters
Query Parameters
Name Description Required Default Pattern

owner

The address of the owner

X

null

index

The index of the nft assigned to the owner

X

null

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 15. http response codes

Code Message Datatype

200

Successful Query

ApiResponse

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

tokenURIById

GET /nft/tokenURI/

Enumerate NFTs assigned to an owner

Description

Parameters
Query Parameters
Name Description Required Default Pattern

tokenId

X

null

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 16. http response codes

Code Message Datatype

200

Successful Query

ApiResponse

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

totalSupply

GET /nft/totalSupply

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

Description

Returns the total supply of Non fungible tokens

Parameters

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 17. http response codes

Code Message Datatype

200

Successful query

ApiResponse

428

Request Timeout

<<>>

Samples

transferFrom

POST /nft/transferFrom/

Transfer ownership of an NFT without safety checks

Description

Allows Freight Trust to tranfer tokens unsafely — 

THE CALLER IS RESPONSIBLE TO CONFIRM THAT IS CAPABLE OF RECEIVING NFTS OR ELSE THEY MAY BE PERMANENTLY LOST

Parameters

Body Parameter
Name Description Required Default Pattern

auth

The Freight Trust signature of the nonce Auth

X

Query Parameters
Name Description Required Default Pattern

from

The sender of the transfer

X

null

to

The recipient of the transfer

X

null

tokenId

The id of the token to be transferred

X

null

Return Type

ApiResponse

Content Type
  • application/json

Responses
Table 18. http response codes

Code Message Datatype

200

Successful Transfer

ApiResponse

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

versionRecord

POST /nft/versionRecord/

Versions a record for Freight Trust

Description

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

Parameters

Body Parameter
Name Description Required Default Pattern

auth

The Freight Trust nonce signature to verify this action Auth

X

Query Parameters
Name Description Required Default Pattern

current

The identifying hash of the record

X

null

new

The new identifying hash of the record

X

null

Return Type

Responses
Table 19. http response codes

Code Message Datatype

200

Successful Edit

<<>>

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

versionRecordSigned

POST /nft/versionRecord/signed/

Versions a record for the owner

Description

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

Parameters

Body Parameter
Name Description Required Default Pattern

auth

InlineObject2

X

Query Parameters
Name Description Required Default Pattern

current

The identifying hash of the record

X

null

new

The new identifying hash of the record

X

null

owner

The owner of the record which will be updated

null

Return Type

Responses
Table 20. http response codes

Code Message Datatype

200

Successful Editing

<<>>

420

Bad Request

<<>>

428

Request Timeout

<<>>

Samples

ProxyAndUpgrade

changeController

POST /proxy/changeController/

Sets the the new controller address

Description

Sets the new controller address.

Parameters

Body Parameter
Name Description Required Default Pattern

auth

The Freight Trust signature of the nonce Auth

X

Query Parameters
Name Description Required Default Pattern

newController

The new controller address

X

null

Return Type

ApiResponse

Content Type
  • application/xml

  • application/json

Responses
Table 21. http response codes

Code Message Datatype

200

Successfuly Changed

ApiResponse

425

Invalid Input

<<>>

Samples

changeMaster

POST /proxy/changeMaster/

Sets the address of Function

Description

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.

Parameters

Body Parameter
Name Description Required Default Pattern

auth

The Freight Trust signature of the nonce Auth

X

Query Parameters
Name Description Required Default Pattern

newMaster

The new master address

X

null

Return Type

ApiResponse

Content Type
  • application/xml

  • application/json

Responses
Table 22. http response codes

Code Message Datatype

200

Successfuly Changed

ApiResponse

425

Invalid Input

<<>>

Samples

getControler

GET /proxy/getControler

Gets address of the controler Contract

Description

Gets the address of the controler contract.

Parameters

Return Type

ApiResponse

Content Type
  • application/xml

  • application/json

Responses
Table 23. http response codes

Code Message Datatype

200

successful operation

ApiResponse

Samples

getMaster

GET /proxy/getMaster

Gets address of the Master Contract

Description

Gets the address of the master contract.

Parameters

Return Type

ApiResponse

Content Type
  • application/xml

  • application/json

Responses
Table 24. http response codes

Code Message Datatype

200

successful operation

ApiResponse

Samples

getTarget

GET /proxy/getTarget/

Gets address of Function

Description

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

Parameters
Query Parameters
Name Description Required Default Pattern

id

The function selector the return the target of

X

null

Return Type

ApiResponse

Content Type
  • application/xml

  • application/json

Responses
Table 25. http response codes

Code Message Datatype

200

successful operation

ApiResponse

425

Invalid Input

<<>>

Samples

getUniversalProxy

GET /proxy/getUniversalProxy

Gets address of the Universal Proxy Contract

Description

Gets the address of the Universal Proxy contract.

Parameters

Return Type

ApiResponse

Content Type
  • application/xml

  • application/json

Responses
Table 26. http response codes

Code Message Datatype

200

successful operation

ApiResponse

Samples

pause

POST /proxy/pause

Pauses the execution

Description

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

Parameters

Body Parameter
Name Description Required Default Pattern

auth

The Freight Trust signature of the nonce Auth

X

Return Type

ApiResponse

Content Type
  • application/xml

  • application/json

Responses
Table 27. http response codes

Code Message Datatype

200

Successfuly Paused

ApiResponse

425

Invalid Input

<<>>

Samples

setTarget

POST /proxy/setTarget/

Sets the address of Function

Description

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.

Parameters

Body Parameter
Name Description Required Default Pattern

auth

The Freight Trust signature of the nonce Auth

X

Query Parameters
Name Description Required Default Pattern

id

Function selector whose target to change.

X

null

target

The address to set the function too

X

null

Return Type

ApiResponse

Content Type
  • application/xml

  • application/json

Responses
Table 28. http response codes

Code Message Datatype

200

Successfuly Changed

ApiResponse

425

Invalid Input

<<>>

Samples

Models

ApiResponse

Field Name Required Type Description Format

code

Integer

int32

type

String

message

String

Auth

Field Name Required Type Description Format

signature

X

String

InlineObject

Field Name Required Type Description Format

freightTrustAuth

auth

senderAuth

auth

InlineObject1

Field Name Required Type Description Format

freightTrustAuth

auth

ownerAuth

auth

partAuth

auth

InlineObject2

Field Name Required Type Description Format

freightTrustAuth

auth

ownerAuth

auth

License

Copyright 2020 © FreightTrust and Clearing Corporation All Rights Reserved – https://freighttrust.com

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/

Merge branch ‘master’ of github.com:freight-trust/truenft

部分转自网络,侵权联系删除区块链源码网

www.interchains.cc

https://www.interchains.cc/17677.html

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 !
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » TrueNFT – B2B NFT Protocol – TrueNFT-B2B NFT协议区块链毕设代写

提供最优质的资源集合

立即查看 了解详情