/** options for creating Connex object */
export type Options = {
/** the base url of the thor node's thorREST API */
node: string
/**
* the expected network of the node url. defaults to 'main' if omitted.
* if it does not match with the actual network of the node url points to,
* all subsequent request will fail.
*/
network?: 'main' | 'test' | Connex.Thor.Block
/**
* designated wallet to connect, Sync, Sync2 or VeWorldExtension supported, Sync2 if omitted.
*/
signer?: 'sync' | 'sync2' | 'veworldextension'
}
Which makes dApp developers explicitly declare the signer they wish to connect. Sync, Sync2, VeWorldExteion.
const nodeURL = 'https://...'
const connex = new Connex({node: nodeURL, network: 'main', signer: 'sync2'}) // Sync2
const connex = new Connex({node: nodeURL, network: 'main', signer: 'veworldextension'}) // VeWorldExtension
const connex = new Connex({node: nodeURL, network: 'main'}) // sync2 if omit signer option
const vendor = new Connex.Vendor('test', 'sync') // sync or vechainthor mobile wallet
This PR also introduced Connex.Thor class for read-only functions, which allows dApps delay the time of interacting with wallets.
const thor = new Connex.Thor({node: 'https://...', network: 'main'})
// .... some reading options
const vendor = new Connex.Vendor('main', 'sync2')
vendor.sign('tx', ...)
This PR changes the constructor options to:
Which makes dApp developers explicitly declare the signer they wish to connect. Sync, Sync2, VeWorldExteion.
This PR also introduced
Connex.Thor
class for read-only functions, which allows dApps delay the time of interacting with wallets.