-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enhancement: Initial stateproofs support (#629)
* Initial stateproofs support
- Loading branch information
1 parent
1c7d9e4
commit 5559d71
Showing
18 changed files
with
585 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import JSONRequest from '../jsonrequest'; | ||
import HTTPClient from '../../client'; | ||
import IntDecoding from '../../../types/intDecoding'; | ||
|
||
export default class GetTransactionProof extends JSONRequest { | ||
constructor( | ||
c: HTTPClient, | ||
intDecoding: IntDecoding, | ||
private round: number, | ||
private txID: string | ||
) { | ||
super(c, intDecoding); | ||
|
||
this.round = round; | ||
this.txID = txID; | ||
} | ||
|
||
path() { | ||
return `/v2/blocks/${this.round}/transactions/${this.txID}/proof`; | ||
} | ||
|
||
/** | ||
* Exclude assets and application data from results | ||
* The type of hash function used to create the proof, must be one of: "sha512_256", "sha256" | ||
* | ||
* #### Example | ||
* ```typescript | ||
* const hashType = "sha256"; | ||
* const round = 123456; | ||
* const txId = "abc123; | ||
* const txProof = await algodClient.getTransactionProof(round, txId) | ||
* .hashType(hashType) | ||
* .do(); | ||
* ``` | ||
* | ||
* @param hashType | ||
* @category query | ||
*/ | ||
hashType(hashType: string) { | ||
this.query.hashtype = hashType; | ||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import JSONRequest from '../jsonrequest'; | ||
import HTTPClient from '../../client'; | ||
import IntDecoding from '../../../types/intDecoding'; | ||
|
||
export default class LightBlockHeaderProof extends JSONRequest { | ||
constructor(c: HTTPClient, intDecoding: IntDecoding, private round: number) { | ||
super(c, intDecoding); | ||
|
||
this.round = round; | ||
} | ||
|
||
path() { | ||
return `/v2/blocks/${this.round}/lightheader/proof`; | ||
} | ||
} |
Oops, something went wrong.