Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
| } | ||
| } | ||
|
|
||
| const MEMO_MAX_LENGTH: usize = 100; |
There was a problem hiding this comment.
decide a reasonable value here
There was a problem hiding this comment.
is this to prevent DoSooor quote requestoors from making a bunch of illegitimate quote requests with too-long-to-be-included-in-a-transaction memos?
There was a problem hiding this comment.
if they pass a very long memo, they will just get 404 because the searcher transactions will be too big.
it's better to fail explicitly here so the user understands the reason for not getting any quotes is the length of the memo.
| searcherToken: PublicKey; | ||
| tokenProgramSearcher: PublicKey; | ||
| tokenInitializationConfigs: TokenAccountInitializationConfigs; | ||
| memo?: string; |
There was a problem hiding this comment.
maybe we should make this return type into a struct?
There was a problem hiding this comment.
It's okay imo. it's already a string on the server side.
There was a problem hiding this comment.
i mean the whole return type, there's a lot of fields in there
There was a problem hiding this comment.
This type gets deconstructed right away everywhere so i'll just leave it as it is.
| const { userToken, searcherToken, user, tokenInitializationConfigs } = | ||
| extractSwapInfo(swapOpportunity); | ||
|
|
||
| if (swapOpportunity.memo) { |
There was a problem hiding this comment.
maybe we want to make this backward compatible for limo/submit bid as well?
There was a problem hiding this comment.
do you mean adding this to limit orders? let's decide if we need to prioritize that, we should do it in a different pull request anyway
| Ok(()) | ||
| } | ||
| (Some(_), 0) => Ok(()), // todo: this is for backward compatibility, we should remove this line once searchers have updated their sdk | ||
| (_, _) => Err(RestError::InvalidInstruction( |
There was a problem hiding this comment.
one other thing to think about is what if searchers use memo instructions of their own in the program? there's probably not a reason to fail the tx if it has the required memo program ix and then others on top of that
There was a problem hiding this comment.
Let's wait until a searcher requests this before doing it.
| } | ||
| } | ||
|
|
||
| const MEMO_MAX_LENGTH: usize = 100; |
There was a problem hiding this comment.
is this to prevent DoSooor quote requestoors from making a bunch of illegitimate quote requests with too-long-to-be-included-in-a-transaction memos?
No description provided.