Constructors
constructor
- new BalanceTree(balances: { account: PublicKey; amount: BN }[]): BalanceTree
Parameters
balances: { account: PublicKey; amount: BN }[]
Methods
getHexProof
- getHexProof(index: number, account: PublicKey, amount: BN): string[]
Parameters
index: number
account: PublicKey
amount: BN
Returns string[]
getHexRoot
Returns string
getProof
- getProof(index: number, account: PublicKey, amount: BN): Buffer[]
Parameters
index: number
account: PublicKey
amount: BN
Returns Buffer[]
getRoot
Returns Buffer
Static toNode
- toNode(index: number, account: PublicKey, amount: BN): Buffer
Parameters
index: number
account: PublicKey
amount: BN
Returns Buffer
Static verifyProof
- verifyProof(index: number, account: PublicKey, amount: BN, proof: Buffer[], root: Buffer): boolean
Parameters
index: number
account: PublicKey
amount: BN
proof: Buffer[]
root: Buffer
Returns boolean