Created
January 15, 2023 14:01
-
-
Save vlzhr/ccaca5089a028bcf76d8015297998e71 to your computer and use it in GitHub Desktop.
Calling Puzzle Aggregator from Ride script
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
# given code shows how you can invoke Puzzle Aggregator on-chain | |
# aggregator allows to exchange any token to any supported by PuzzleSwap.org | |
# you can modify any of these 4 parameters | |
let asset0Bytes = unit # asset you pay | |
let asset1Str = "DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p" # asset you want to receive | |
let amountToExchange = 1000000 | |
let recipientStr = this.toString() | |
strict swapInv = invoke(Address(base58'3PLPCb3wF2H2gtzohoAjeWcGaMKEiJvtE5X'), | |
"exchangeAndSendTo", | |
[assetFromStr, recipientStr], | |
[AttachedPayment(assetToBytes, amountToExchange)]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment