Conversation
BeroBurny
commented
Sep 23, 2024
Comment on lines
+150
to
+165
| private deferredRequest<T>( | ||
| name: string, | ||
| request: () => Promise<T>, | ||
| ): Promise<T> { | ||
| if (!(name in this.#requests)) { | ||
| this.#requests[name] = request(); | ||
| void this.#requests[name].finally(() => { | ||
| void setTimeout(() => { | ||
| delete this.#requests[name]; | ||
| }, 1000); | ||
| }); | ||
| } | ||
|
|
||
| return this.#requests[name] as Promise<T>; | ||
| } | ||
|
|
Contributor
Author
There was a problem hiding this comment.
Curious, what do you think about this?
# Conflicts: # yarn.lock
| You can pass custom fetch options when initializing the context: | ||
|
|
||
| ```tsx | ||
| <SprinterContext fetchOptions={{ baseUrl: "https://api.test.sprinter.buildwithsygma.com/" }}> |
Contributor
There was a problem hiding this comment.
Seems like a centralized service, doesn't it make sense to choose from selectable environments rather than a connection string? Like SprinterEnvironment.Test or SprinterEnvironment.Main
Contributor
Author
There was a problem hiding this comment.
It defaults to mainnet and with that approach, we eliminate the need for updates for client's custom deployments or proxies
sztok7
reviewed
Sep 23, 2024
sztok7
approved these changes
Sep 23, 2024
Merged
BeroBurny
pushed a commit
that referenced
this pull request
Sep 23, 2024
🤖 I have created a release *beep* *boop* --- <details><summary>sprinter-sdk: 0.2.0</summary> ## [0.2.0](sprinter-sdk-v0.1.0...sprinter-sdk-v0.2.0) (2024-09-23) ### Features * implement tracing url resolver ([#46](#46)) ([efd1be3](efd1be3)), closes [#44](#44) * react sdk context ([#48](#48)) ([39dbe7e](39dbe7e)), closes [#47](#47) </details> <details><summary>sprinter-react: 0.1.0</summary> ## [0.1.0](sprinter-react-v0.0.1...sprinter-react-v0.1.0) (2024-09-23) ### Features * react sdk context ([#48](#48)) ([39dbe7e](39dbe7e)), closes [#47](#47) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Merged
BeroBurny
pushed a commit
that referenced
this pull request
Sep 23, 2024
🤖 I have created a release *beep* *boop* --- <details><summary>sprinter-sdk: 0.3.0</summary> ## [0.3.0](sprinter-sdk-v0.2.0...sprinter-sdk-v0.3.0) (2024-09-23) ### Features * api options ([#33](#33)) ([ad1cb88](ad1cb88)) * cross chain contract call ([#21](#21)) ([69c0128](69c0128)) * depricate provider param from sdk ([#41](#41)) ([72297fe](72297fe)) * docs POC ([#14](#14)) ([8cd800d](8cd800d)) * erc20 with contract call ([#39](#39)) ([77e1d8d](77e1d8d)), closes [#38](#38) * implement tracing url resolver ([#46](#46)) ([efd1be3](efd1be3)), closes [#44](#44) * native tokens transfers ([#40](#40)) ([d4edf35](d4edf35)), closes [#36](#36) * react sdk context ([#48](#48)) ([39dbe7e](39dbe7e)), closes [#47](#47) * SDK POC ([#11](#11)) ([6aca865](6aca865)) * web poc (super basic basic) ([#3](#3)) ([25a91f7](25a91f7)) ### Bug Fixes * process approvals from quote ([#26](#26)) ([95d9ebf](95d9ebf)) </details> <details><summary>sprinter-react: 0.2.0</summary> ## [0.2.0](sprinter-react-v0.1.0...sprinter-react-v0.2.0) (2024-09-23) ### Features * react sdk context ([#48](#48)) ([39dbe7e](39dbe7e)), closes [#47](#47) ### Bug Fixes * cd and rect hooks export ([#52](#52)) ([33c0604](33c0604)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
closes #47