@vechain/connex
Advanced tools
Comparing version 0.1.3 to 0.1.4
193
index.d.ts
@@ -42,5 +42,4 @@ /** | ||
* @param addr account address | ||
* @param options | ||
*/ | ||
account(addr: string, options?: { revision?: string | number }): Thor.AccountVisitor | ||
account(addr: string): Thor.AccountVisitor | ||
@@ -58,5 +57,4 @@ /** | ||
* @param id tx id | ||
* @param options | ||
*/ | ||
transaction(id: string, options?: { head?: string }): Thor.TransactionVisitor | ||
transaction(id: string): Thor.TransactionVisitor | ||
@@ -72,8 +70,5 @@ /** | ||
/** | ||
* To obtain how blockchain would execute a tx with these clauses. | ||
* | ||
* @param clauses clauses to be atomically executed | ||
* @param options | ||
* Create an explainer to obtain how blockchain would execute a tx. | ||
*/ | ||
explain(clauses: Thor.Clause[], options?: Thor.CallOptions): Promise<Thor.VMOutput[]> | ||
explain(): Thor.Explainer | ||
} | ||
@@ -97,2 +92,8 @@ | ||
/** | ||
* set revision | ||
* @param rev block id or number | ||
*/ | ||
revision(rev: string | number): this | ||
/** | ||
* query the account | ||
@@ -137,7 +138,30 @@ * | ||
/** | ||
* set value | ||
* @param val amount of VET to transfer | ||
*/ | ||
value(val: string | number): this | ||
/** | ||
* set caller(msg.sender) | ||
* @param addr caller address | ||
*/ | ||
caller(addr: string): this | ||
/** | ||
* set max allowed gas | ||
* @param gas | ||
*/ | ||
gas(gas: number): this | ||
/** | ||
* set gas price | ||
* @param gp gas price in hex string | ||
*/ | ||
gasPrice(gp: string): this | ||
/** | ||
* Pack arguments into {@link Clause}. | ||
* @param args method arguments | ||
* @param value amount of VET to transfer | ||
*/ | ||
asClause(args: any[], value: string | number): Clause | ||
asClause(...args: any[]): Clause | ||
@@ -147,6 +171,4 @@ /** | ||
* @param args method arguments | ||
* @param value amount of VET to transfer | ||
* @param options | ||
*/ | ||
call(args: any[], value: string | number, options?: CallOptions): Promise<VMOutput> | ||
call(...args: any[]): Promise<VMOutput> | ||
} | ||
@@ -188,2 +210,8 @@ | ||
/** | ||
* set head block id | ||
* @param head block id | ||
*/ | ||
head(head: string): this | ||
/** | ||
* query the transaction | ||
@@ -226,2 +254,34 @@ */ | ||
interface Explainer { | ||
/** | ||
* set caller | ||
* @param addr caller address | ||
*/ | ||
caller(addr: string): this | ||
/** | ||
* set max allowed gas | ||
* @param gas | ||
*/ | ||
gas(gas: number): this | ||
/** | ||
* set gas price | ||
* @param gp gas price in hex string | ||
*/ | ||
gasPrice(gp: string): this | ||
/** | ||
* set revision | ||
* @param rev block id or number | ||
*/ | ||
revision(rev: string | number): this | ||
/** | ||
* execute clauses | ||
* @param clauses | ||
*/ | ||
execute(clauses: Clause[]): Promise<VMOutput[]> | ||
} | ||
/** | ||
@@ -398,10 +458,2 @@ * block chain status | ||
type CallOptions = { | ||
gas?: number | ||
gasPrice?: string | ||
caller?: string | ||
revision?: string | number | ||
} | ||
type VMOutput = { | ||
@@ -427,36 +479,63 @@ data: string | ||
namespace Vendor { | ||
interface SigningService<T extends 'tx' | 'cert'> { | ||
interface TxSigningService { | ||
/** | ||
* Set message | ||
* @param msg message requested to be signed | ||
* @returns this instance | ||
* enforce the signer | ||
* @param addr signer address | ||
*/ | ||
signer(addr: string): this | ||
message(msg: SigningService.Message<T>): this | ||
/** | ||
* Send request | ||
* @param options options of signing request | ||
* @returns promise of signing result | ||
* enforce max allowed gas | ||
* @param gas | ||
*/ | ||
request(options?: SigningService.Options<T>): Promise<SigningService.Result<T>> | ||
gas(gas: number): this | ||
/** | ||
* set the link to reveal tx related information | ||
* @param url link url | ||
*/ | ||
link(url: string): this | ||
/** | ||
* set comment for the message | ||
* @param text | ||
*/ | ||
comment(text: string): this | ||
/** | ||
* send request | ||
* @param msg clauses with comments | ||
*/ | ||
request(msg: SigningService.TxMessage): Promise<SigningService.TxResponse> | ||
} | ||
interface CertSigningService { | ||
/** | ||
* enforce the signer | ||
* @param addr signer address | ||
*/ | ||
signer(addr: string): this | ||
/** | ||
* send request | ||
* @param msg | ||
*/ | ||
request(msg: SigningService.CertMessage): Promise<SigningService.CertResponse> | ||
} | ||
type SigningService<T extends 'tx' | 'cert'> = | ||
T extends 'tx' ? TxSigningService : | ||
T extends 'cert' ? CertSigningService : never | ||
namespace SigningService { | ||
type TxMessage = { | ||
clauses: { | ||
to: string | null | ||
value: string | number | ||
data: string | ||
/** | ||
* comment to the clause | ||
*/ | ||
comment?: string | ||
}[], | ||
type TxMessage = Array<{ | ||
to: string | null | ||
value: string | number | ||
data: string | ||
/** | ||
* comment to the tx | ||
* comment to the clause | ||
*/ | ||
comment?: string | ||
} | ||
}> | ||
type CertMessage = { | ||
@@ -470,25 +549,8 @@ purpose: 'identification' | 'agreement' | ||
type Message<T extends 'tx' | 'cert'> = | ||
T extends 'tx' ? TxMessage : | ||
T extends 'cert' ? CertMessage : never | ||
type TxOptions = { | ||
signer?: string | ||
gas?: number | ||
link?: string | ||
} | ||
type CertOptions = { | ||
signer?: string | ||
} | ||
type Options<T extends 'tx' | 'cert'> = | ||
T extends 'tx' ? TxOptions : | ||
T extends 'cert' ? CertOptions : never | ||
type TxResult = { | ||
type TxResponse = { | ||
txId: string | ||
signer: string | ||
} | ||
type CertResult = { | ||
type CertResponse = { | ||
annex: { | ||
@@ -501,5 +563,2 @@ domain: string | ||
} | ||
type Result<T extends 'tx' | 'cert'> = | ||
T extends 'tx' ? TxResult : | ||
T extends 'cert' ? CertResult : never | ||
@@ -506,0 +565,0 @@ type ErrorType = 'BadMessage' | 'Rejected' |
{ | ||
"name": "@vechain/connex", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Standard interface to connect DApp with VeChain and user", | ||
@@ -5,0 +5,0 @@ "main": "", |
# Connex | ||
Connex is the standard interface to connect DApp with VeChain and user. | ||
# Getting Started | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22364
487
7