-
Notifications
You must be signed in to change notification settings - Fork 210
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
GetApplicationBoxByName API #586
Conversation
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.
Mostly looks good! Left a few questions which could lead to changes.
} | ||
|
||
// name sets the box name in base64 encoded format. | ||
name(name: Uint8Array) { |
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.
Why limit the name to Uint8Array
and then encoding that as a base64 app arg as opposed to supporting the app arg format directly?
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 question - We discussed a bit about it offline last week and came to two thoughts:
- Since
appArgs
are inUint8Array
in this SDK, it makes sense for box name to mimic the JS SDK format (rather than mimic the goal format) - It's out of scope for this PR to include these conversion tools for now. We may revisit this in the future and provide functions to convert
int
s oraddr
s later for box names.
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.
Makes sense. Thanks for the explanation!
@@ -127,6 +127,54 @@ module.exports = function getSteps(options) { | |||
|
|||
const { algod_token: algodToken, kmd_token: kmdToken } = options; | |||
|
|||
// String parsing helper methods | |||
function processAppArgs(subArg) { |
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.
If not supporting passing app args directly through the name()
method, consider exporting this method to make it easier to encode app 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.
Looks good! Left one optional comment.
import HTTPClient from '../../client'; | ||
import IntDecoding from '../../../types/intDecoding'; | ||
|
||
export default class GetApplicationBoxByName extends JSONRequest { |
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.
nit: consider typing the response with JSONRequest<types.Box>
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.
done!
This PR introduces:
GetApplicationBoxByName
endpoint for boxes