1

I'm analyzing the Ontology blockchain.

The core of the Ontology blockchain is written in the Go language and there are numerous SDKs available, including one in TypeScript.

I can see that the desktop wallet is written using the TypeScript SDK. What technology was used to create the wallet application and connect it to the blockchain?

How does the TypeScript SDK interface with the Ontology blockchain written in Golang?

Ontology Golang implementation: https://github.com/ontio/ontology

Ontology TypeScript SDK: https://github.com/ontio/ontology-ts-sdk

OWallet (desktop wallet): https://github.com/ontio/OWallet

Wyetro
  • 8,439
  • 9
  • 46
  • 64
Crea
  • 37
  • 4

2 Answers2

1

Provide ontology RESTFUL API lists. Below ... https://dev-docs.ont.io/#/docs-en/API/02-restful_api?id=restful-api-list.

OWallet has declared RESTFUL API as follows. https://github.com/ontio/OWallet/blob/17e2e57fec6f04f79fd8582a8f9989aac517138c/src/core/consts.js

export const ONT_PASS_URL = {
  CreateSharedWallet: '/S1/api/v1/ontpass/SharedWallet/create',
  QuerySharedWallet: '/S1/api/v1/ontpass/SharedWallet/getBySharedWalletAddress', //get
  CreateSharedTransfer: '/S1/api/v1/ontpass/SharedTransfer/create',
  SignSharedTransfer: '/S1/api/v1/ontpass/SharedTransfer/sign',
  SendSharedTransfer: '/S1/api/v1/ontpass/SharedTransfer/isSendToChain', //get
  QueryPendingTransfer: '/S1/api/v1/ontpass/SharedTransfer/listSigningBeforeTime',
  // sharedAddress={sharedAddress}&assetName={assetName}&beforeTimeStamp={beforeTimeStamp},
  ExchangeCurrency: '/S1/api/v1/ontpass/api/v1/onto/exchangerate/reckon/'
    ///api/v1/onto/exchangerate/reckon/{currency}/{goaltype}/{amount}

    //for node stake
    ,
  GetQualifiedState: '/S4/NodePledgeApi/v1/Nodepledge/getQuailifiedState',
  // /NodePledgeApi/v1/Nodepledge/getQuailifiedState?ontid={ontid}&address={address}'
    DelegateSendTx: '/S4/NodePledgeApi/v1/Nodepledge/delegateSendTransaction',
    SetStakeInfo: '/S4/NodePledgeApi/v1/Nodepledge/setInfo',
    GetStakeInfo: '/S4/NodePledgeApi/v1/Nodepledge/info'
    // /NodePledgeApi/v1/Nodepledge/info?ontid={ontid}
}

OWallet is assumed to use the ontology RESTFUL API.

sh.seo
  • 1,482
  • 13
  • 20
1

The Ontology blockchain actually has three ways for SDKs to interact with it:

1) To connect via a Restful API

2) To connect via an RPC API

3) To connect via WebSockets

OWallet connects via the Restful client. Other applications and SDKs use the RPC and WebSockets.

Wyetro
  • 8,439
  • 9
  • 46
  • 64