-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
allow ability to pass in feePayer to Provider methods [WIP] #2186
allow ability to pass in feePayer to Provider methods [WIP] #2186
Conversation
@surfertas is attempting to deploy a commit to the coral-xyz Team on Vercel. A member of the Team first needs to authorize it. |
Instead of adding a new argument, could the code instead check if feePayer has already been set in the transaction and if not then it assigns the provider's wallet? If you could also add something to the changelog in the PR that references this PR that would be helpful too. |
Looks good to me! Will merge it in shortly |
@Henry-E Was wondering if we should be using a strict equality check for undefined or use a null check to handle both cases? |
In the default transaction it looks like
so you should be checking
You should probably add a client test then to |
Yeah sounds good, technically the null check will capture undefined as well afiak, but the strict equality check for undefined is more concise! Will put that test up. |
I'm not sure this is true. We should check for both? |
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null
|
Sure, if
(I might be able to add these tests next week if you aren't able to add them) |
@Henry-E sorry hate to ask, but if you have time can you throw up thoses tests? Just got backed up with work. Sincere apologies. |
Just going to wait for tests to run again and then merge. |
…z#2186) * allow ability to pass in feePayer to Provider methods * align comments * prettier * check if feePayer set, handle if not * remove unnecessary spaces in comments * update changelog * strict equality check * use null check * use logical or * use logical or Co-authored-by: Henry-E <henry.elder@adaptcentre.ie>
Allow passing in an optional
feePayer
param to the send methods of the Provider class. This allows the caller to specify who pays for the transaction, as opposed to hard coding it to the connected wallet.closes #2180
Reference discord discussion:
https://discord.com/channels/889577356681945098/891724485177245717/1020066171329982605