Skip to content

Commit

Permalink
Merge pull request #47 from qianbin/master
Browse files Browse the repository at this point in the history
vip-191 related
  • Loading branch information
qianbin authored Jun 12, 2019
2 parents 6083538 + 9b6075d commit 37b1128
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ declare namespace Connex {
gasUsed: number
totalScore: number
txsRoot: string
txsFeatures?: number
stateRoot: string
receiptsRoot: string
signer: string
Expand Down Expand Up @@ -371,6 +372,7 @@ declare namespace Connex {
gasPriceCoef: number
gas: number
origin: string
delegator?: string
nonce: string
dependsOn: string | null
size: number
Expand All @@ -388,7 +390,14 @@ declare namespace Connex {
events: Event[]
transfers: Transfer[]
}[]
meta: LogMeta
meta: Receipt.Meta
}

namespace Receipt {
type Meta = Transaction.Meta & {
txID: string
txOrigin: string
}
}

type Event = {
Expand Down Expand Up @@ -425,12 +434,8 @@ declare namespace Connex {
}
}

type LogMeta = {
blockID: string
blockNumber: number
blockTimestamp: number
txID: string
txOrigin: string
type LogMeta = Receipt.Meta & {
clauseIndex: number
}

namespace Filter {
Expand Down Expand Up @@ -508,6 +513,12 @@ declare namespace Connex {
*/
comment(text: string): this

/**
* enable VIP-191 by providing delegation handler
* @param handler to sign tx as fee delegator
*/
delegate(handler: SigningService.DelegationHandler): this

/**
* send request
* @param msg clauses with comments
Expand Down Expand Up @@ -572,6 +583,14 @@ declare namespace Connex {
}
signature: string
}


/**
* returns object contains signature of fee delegator
* @param unsignedTx.raw RLP-encoded unsigned tx in hex form
* @param unsignedTx.origin address of intended tx origin
*/
type DelegationHandler = (unsignedTx: { raw: string, origin: string }) => Promise<{ signature: string }>
}
}
type ErrorType = 'BadParameter' | 'Rejected'
Expand Down

0 comments on commit 37b1128

Please sign in to comment.