-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: move stream creation methods to utils
- Loading branch information
1 parent
8256165
commit 1c8a294
Showing
4 changed files
with
53 additions
and
65 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,30 @@ | ||
import { Address } from '../../types/types'; | ||
|
||
async function buildDepositProof( | ||
streamContractAddress: Address, | ||
asset: any, | ||
payerAddress: Address, | ||
payeeAddress: Address, | ||
sendAmount: number, | ||
): Promise<object> { | ||
const { proof } = await asset.send( | ||
[ | ||
{ | ||
to: streamContractAddress, | ||
amount: sendAmount, | ||
aztecAccountNotRequired: true, // contract can't have an AZTEC account | ||
numberOfOutputNotes: 1, // only want to track a single note per stream | ||
}, | ||
], | ||
{ | ||
userAccess: [payerAddress, payeeAddress], // Give view access to sender and recipient | ||
returnProof: true, | ||
sender: streamContractAddress, // proof is being submitted by contract rather than directly | ||
}, | ||
); | ||
|
||
console.log(proof); | ||
return proof; | ||
} | ||
|
||
export default buildDepositProof; |
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