Skip to content
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

feat: Use ID types in client api #1191

Merged
merged 15 commits into from
May 31, 2023

Conversation

bvrooman
Copy link
Contributor

@bvrooman bvrooman commented May 25, 2023

Related issues:

This PR update the FuelClient API to use ID types in place of string serialized IDs. Now, consumers of the API must directly pass a client type when performing a method call. Internally, these ID types are then converted to GraphQL types to be used in the GraphQL API. This API update represents a breaking change.

@bvrooman bvrooman added the breaking A breaking api change label May 29, 2023
@bvrooman bvrooman marked this pull request as ready for review May 29, 2023 17:12
@bvrooman bvrooman requested a review from a team May 29, 2023 19:19
@bvrooman bvrooman self-assigned this May 29, 2023
Copy link
Collaborator

@xgreenx xgreenx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now the usage looks much, much better, thank you!=)

crates/client/src/client.rs Outdated Show resolved Hide resolved
@@ -750,10 +770,10 @@ impl FuelClient {
// Retrieve a page of balances by their owner
pub async fn balances(
&self,
owner: &str,
owner: &Address,
request: PaginationRequest<String>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, maybe it also would be nice to use a real cursor instead of the String. If that possible, of course

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's worth investigating. I will look into that for this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed over a call, we can investigate this further at a separate time. I am creating this ticket to capture this tech debt: #1197

@bvrooman bvrooman marked this pull request as draft May 31, 2023 00:01
// (Utxos, Messages Nonce)
excluded_ids: Option<(Vec<&str>, Vec<&str>)>,
excluded_ids: Option<(Vec<&UtxoId>, Vec<&Nonce>)>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
excluded_ids: Option<(Vec<&UtxoId>, Vec<&Nonce>)>,
excluded_ids: Option<(Vec<UtxoId>, Vec<Nonce>)>,

@bvrooman bvrooman marked this pull request as ready for review May 31, 2023 19:31
@bvrooman bvrooman enabled auto-merge (squash) May 31, 2023 20:30
@bvrooman bvrooman merged commit 819081e into master May 31, 2023
@bvrooman bvrooman deleted the bvrooman/feat/use-id-types-in-client-api branch May 31, 2023 20:37
@xgreenx xgreenx mentioned this pull request Jun 13, 2023
xgreenx added a commit that referenced this pull request Jun 14, 2023
## What's Changed
* version compatibility cleanup by @Voxelot in
#1171
* Added example with custom query around the `fuel-core-client` by
@xgreenx in #1175
* Update to fuel-vm 0.32 (including wideint gas profiling) by @Dentosal
in #1173
* feat: Client primitives by @bvrooman in
#1144
* Improve executor config by @Voxelot in
#1185
* Added `contract_id` to the `ContractConfig` by @xgreenx in
#1184
* fix windows file name error by @firedpeanut in
#1176
* Make transaction status stream work by @freesig in
#1108
* Added `submit_and_await` endpoint to not miss the notifications by
@xgreenx in #1192
* feat: Use ID types in client api by @bvrooman in
#1191
* Use `fuel-vm 0.33` with predicate estimation by @xgreenx in
#1195
* Add transaction lifecycle diagram to the docs by @digorithm in
#1201
* sync with peers before producing blocks by @leviathanbeak in
#1169
* SMT storage key hashing by @xgreenx in
#1207

## New Contributors
* @firedpeanut made their first contribution in
#1176

**Full Changelog**:
v0.18.1...v0.19.0

---------

Co-authored-by: Brandon Kite <brandonkite92@gmail.com>
crypto523 pushed a commit to crypto523/fuel-core that referenced this pull request Oct 7, 2024
## What's Changed
* version compatibility cleanup by @Voxelot in
FuelLabs/fuel-core#1171
* Added example with custom query around the `fuel-core-client` by
@xgreenx in FuelLabs/fuel-core#1175
* Update to fuel-vm 0.32 (including wideint gas profiling) by @Dentosal
in FuelLabs/fuel-core#1173
* feat: Client primitives by @bvrooman in
FuelLabs/fuel-core#1144
* Improve executor config by @Voxelot in
FuelLabs/fuel-core#1185
* Added `contract_id` to the `ContractConfig` by @xgreenx in
FuelLabs/fuel-core#1184
* fix windows file name error by @firedpeanut in
FuelLabs/fuel-core#1176
* Make transaction status stream work by @freesig in
FuelLabs/fuel-core#1108
* Added `submit_and_await` endpoint to not miss the notifications by
@xgreenx in FuelLabs/fuel-core#1192
* feat: Use ID types in client api by @bvrooman in
FuelLabs/fuel-core#1191
* Use `fuel-vm 0.33` with predicate estimation by @xgreenx in
FuelLabs/fuel-core#1195
* Add transaction lifecycle diagram to the docs by @digorithm in
FuelLabs/fuel-core#1201
* sync with peers before producing blocks by @leviathanbeak in
FuelLabs/fuel-core#1169
* SMT storage key hashing by @xgreenx in
FuelLabs/fuel-core#1207

## New Contributors
* @firedpeanut made their first contribution in
FuelLabs/fuel-core#1176

**Full Changelog**:
FuelLabs/fuel-core@v0.18.1...v0.19.0

---------

Co-authored-by: Brandon Kite <brandonkite92@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking A breaking api change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use backend-agnostic Rust types in fuel-client-core instead of GraphQL types
3 participants