-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: estimate transaction cost #399
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
a211c1c
to
08905ce
Compare
} | ||
} | ||
let fee: bigint | undefined = undefined | ||
let feeError: undefined | Error = undefined |
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.
feeError
is not set anywhere. Maybe on line 51 it could be set?
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.
good catch! Forgot to commit this one, thanks!
import { defaultBlockchainNetwork } from '$lib/adapters/transaction' | ||
import type { Balance } from './schemas' | ||
import type { Splitter, SplitterFactory } from './contracts/types' | ||
|
||
const splitterFactoryAddress = defaultBlockchainNetwork.objects.splitterFactory |
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.
I just realized that the splitterFactory
address is hardcoded in the BlockchainNetwork
type. I don't think that's a good place to store it, it seems it would be better if the object code would define it, especially if the object is an external type then there is no way that it can expect the host application to know about it and expose it in the SDK.
This does not belong in this PR, but I just wanted to document this issue somewhere.
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.
I kinda agree. At the same time, it also depends on which blockchain the app is connected to. I'll create an issue about this but I believe there is some discussion needed.
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 code looks good, but please check out my comments.
I tested with Payggy where there is a field called Transaction fee (max)
which looks reasonable. Then after the transaction is done the same is displayed but at that time the exact amount can be known and it would be better to display that instead of the estimated maximum which has no relevance anymore.
resolves #314