-
Notifications
You must be signed in to change notification settings - Fork 69
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
Feature/new swap transfer batch #7
Feature/new swap transfer batch #7
Conversation
} | ||
|
||
get xorBalance() { | ||
const asset = this.accountAssets.find((item) => item.address === XOR.address); |
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.
need to check it, cuz we might already have XOR getter
} | ||
|
||
get xorFeeRequired() { | ||
return this.xorFeeAmount * 1.05 - this.xorBalance; |
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.
it's better to use FPNumber
(and all methods like sub
) instead of JS numbers for all calculations
return this.xorFeeAmount * 1.05 - this.xorBalance; | ||
} | ||
|
||
get showXorRequiredField() { |
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.
the same comment regarding FPNumber
@@ -206,6 +291,10 @@ export default class ReviewDetails extends Mixins(mixins.TransactionMixin) { | |||
return getAssetBalance(asset); | |||
} | |||
|
|||
get xor() { |
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.
do we really need it? :D
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.
This is for access XOR from template
} | ||
|
||
get networkSwapFee(): number { | ||
return FPNumber.fromCodecValue(this.networkFees[Operation.Swap]).toNumber() * 2; |
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.
what is it?
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.
This is preset value in swap dialog, if you don't have enough XOR for tx taxes.
0,7 XOR - tax for transfer, and 0,7 XOR - tax for swap operation to required XOR amount
src/store/routeAssets/actions.ts
Outdated
const time = Date.now(); | ||
await api | ||
.submitExtrinsic( | ||
(api.api.tx.liquidityProxy as any).swapTransferBatch(groupedData, ...params.args), |
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.
please move it to JS library
src/App.vue
Outdated
@@ -390,7 +390,7 @@ export default class App extends Mixins(mixins.TransactionMixin, NodeErrorMixin) | |||
status: RecipientStatus.FAILED, | |||
}); | |||
}); | |||
} else if (value.status === TransactionStatus.InBlock || isNewTx) { | |||
} else if (value.status === TransactionStatus.Finalized) { |
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.
need to check it, cuz TXs will be parsed slower than it actually is
Task
New swap transfer batch
Changes
New swap transfer batch implementation and small fixes