-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TeddySwap Integration #69
Conversation
src/dex/teddyswap.ts
Outdated
} | ||
|
||
const relevantAssets = utxo.assetBalances.filter((assetBalance) => { | ||
const assetName = (assetBalance.asset as Asset).assetName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const assetName = (assetBalance.asset as Asset).assetName; | |
const assetName = assetBalance.asset === 'lovelace' ? 'lovelace' : assetBalance.assetName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
: assetBalance.asset.assetName;
Is asset not required here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is! My comment was wrong but the code reflects the correct path now
Nice! 🚀 |
@@ -100,6 +109,20 @@ export class DefinitionBuilder { | |||
* Recursively pull parameters from datum using definition template. | |||
*/ | |||
private extractParameters(definedDefinition: DefinitionField, templateDefinition: DefinitionField, foundParameters: DatumParameters = {}): DatumParameters { | |||
if (templateDefinition instanceof Function) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adds support for datum mappings to include dynamic pulling/pushing of parameters. One example would be an order datum not including a stake key, which will result in a different datum. Not all DEXs support this atm, but will push a fix after this PR is in
quantity: batcherFee?.value + deposit.value, | ||
}, | ||
], | ||
datum: datumBuilder.getCbor(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inline?
@@ -210,6 +210,7 @@ export class Minswap extends BaseDex { | |||
}, | |||
], | |||
datum: datumBuilder.getCbor(), | |||
isInlineDatum: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice approach!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! 🚀
No description provided.