Conversation
d5d4e37 to
80c1856
Compare
06833b0 to
d371787
Compare
added 4 commits
January 4, 2023 10:49
| let mut swap_data = vec![]; | ||
| swap_data.append(&mut discriminator.try_to_vec()?); | ||
| swap_data.extend( | ||
| &mut input_struct.swap_config[start_index..=last_index] |
Contributor
There was a problem hiding this comment.
Just wonder: what is start_index and last_index for
Author
There was a problem hiding this comment.
For extracting swap config
Jupiter swap's ix data contain 5 props in this order:
a). SwapLeg: (uncertain length)
b) inAmount: u64
c) outAmount: u64
d) slippage: u16
e) platform fee: u8
since we can only set swap_config a fix u8 array size in SwapInwrapper,
we need to extract the subarray from this attribute to fit the payload format.
programs/adapter-jupiter/Cargo.toml
Outdated
| overflow-checks = true | ||
|
|
||
| [dependencies] | ||
| anchor-lang = "0.24.2" |
Contributor
There was a problem hiding this comment.
Upgrade to v0.26.0
Author
There was a problem hiding this comment.
I tried to build with v0.26.0, however, all adapters should also update to v0.26.0 to proceed compile.
Shall I push all updates on Cargo.toml in this repo?
| let mut swap_data = vec![]; | ||
| swap_data.append(&mut discriminator.try_to_vec()?); | ||
| swap_data.extend( | ||
| &mut input_struct.swap_config[start_index..=last_index] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This update will support Jupiter protocol in Gateway program, so that all the state can be stored on chain and provide better user experience to check the asset flow in
Activitypages. See more details below.swap_configto[u8; 30]for scalability as Jupiter's parameterSwapLegmight be longer in the future.Will also update these repo to make all functions works:
gateway-programsgateway