Skip to content

Tfchain graphql #27

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

Merged
merged 249 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
249 commits
Select commit Hold shift + click to select a range
1ed8edc
add graphql client
AlaaElattar Apr 30, 2024
fc70bf3
add proxy client
AlaaElattar May 7, 2024
8789854
Merge branch 'main_signer_workflows_tfchain' of https://github.com/co…
AlaaElattar Jul 21, 2024
1dfa1b4
chore : add public_ips.dart and add classes for queryoptions and retu…
Basem1166 Jul 29, 2024
16f3b26
feat: added twins class
mariammahrous23 Jul 30, 2024
d656b3a
refactor: seperated query and return functions
mariammahrous23 Jul 30, 2024
c23a70c
Merge branch 'tfchain_graphql_twins' of https://github.com/codescaler…
Basem1166 Jul 30, 2024
7608f7c
feat: added all where options + limit + offset + order by
mariammahrous23 Jul 30, 2024
90fc358
feat : add farm query
Basem1166 Jul 30, 2024
9d958a5
style : change FarmCertification to Certification
Basem1166 Jul 30, 2024
7aef992
feat: implemented twinsconnection
mariammahrous23 Jul 30, 2024
559144c
Merge branch 'tfchain_graphql_twins' into tfchain_graphql_farms
Basem1166 Jul 31, 2024
548d6cb
feat: added better example for testing the fns in bin folder
mariammahrous23 Jul 31, 2024
077b62f
refactor: removing unnecessary function
mariammahrous23 Jul 31, 2024
a9eb1b0
chore: formatted code files
mariammahrous23 Jul 31, 2024
585655d
style : format and fix naming errors
Basem1166 Jul 31, 2024
1ee9397
remove unused function
Basem1166 Jul 31, 2024
ef3592d
style : remove unnecessary comment
Basem1166 Jul 31, 2024
34a6247
Merge branch 'tfchain_graphql_twins' into tfchain_graphql_farms
Basem1166 Jul 31, 2024
8f5c09e
refactor: making utils fn not accessible in main
mariammahrous23 Jul 31, 2024
8fa95e5
Merge branch 'tfchain_graphql_twins' into tfchain_graphql_farms
Basem1166 Jul 31, 2024
4995b08
refactor: utility functions made private
Basem1166 Jul 31, 2024
156a2e6
refactor: added error handling
mariammahrous23 Jul 31, 2024
828c162
chore: add farmsconnection,node,edges and page_info classes
Basem1166 Aug 1, 2024
6936c03
refactor: renamed twinWhere options to twinQueryWhereOptions + rename…
mariammahrous23 Aug 1, 2024
439803a
refactor: renaming enum in twins
mariammahrous23 Aug 2, 2024
8cbaa44
Merge branch 'tfchain_graphql_farms' into tfchain_graphql_nodes
mariammahrous23 Aug 2, 2024
d441f58
feat: added most of node implementation
mariammahrous23 Aug 2, 2024
2523756
fix: fixing bigInt parsing + fixing small if cond in twins
mariammahrous23 Aug 2, 2024
a877bd5
fix: small fix to adding where part in the query
mariammahrous23 Aug 2, 2024
6dac8ad
feat: added location , interface , node resources , power , public co…
mariammahrous23 Aug 3, 2024
0bd2535
feat: added nodeResourcesTotal
mariammahrous23 Aug 3, 2024
14cb77c
refactor: updated enum handling
mariammahrous23 Aug 3, 2024
1654ead
feat : farmsConnection query
Basem1166 Aug 4, 2024
1d9f9aa
Merge branch 'tfchain_graphql_twins' of https://github.com/codescaler…
Basem1166 Aug 4, 2024
7ce923d
style: error styles
Basem1166 Aug 4, 2024
fa2e565
refactor: edited error messages
mariammahrous23 Aug 5, 2024
2b6d00b
feat : add areAllBooleanFalse function
Basem1166 Aug 5, 2024
a90d96c
refactor: better error handling
mariammahrous23 Aug 5, 2024
1e90a6c
feat: all return options are optional , return all fields upon no fie…
Basem1166 Aug 5, 2024
ebcfc8e
add .reflectable to gitignore
Basem1166 Aug 5, 2024
c38bc25
docs: update README.md
Basem1166 Aug 5, 2024
2d31f10
feat : added nodeConnection
mariammahrous23 Aug 5, 2024
382698a
Merge branch 'tfchain_graphql_farms' into tfchain_graphql_twins
mariammahrous23 Aug 5, 2024
433d8af
Merge branch 'tfchain_graphql_farms' of https://github.com/codescaler…
mariammahrous23 Aug 5, 2024
119f9cf
refactor: made all return options optional
mariammahrous23 Aug 5, 2024
f325f7c
refactor: removed required feilds from pageinfo
mariammahrous23 Aug 5, 2024
ed8a5a4
refactor: add toJson methods for contract classes
Basem1166 Aug 5, 2024
0f6afbc
fix: small fix regarding returning all return options
mariammahrous23 Aug 6, 2024
ee9f8dc
feat : added nodeTotalConnection resources + refactor code so there i…
mariammahrous23 Aug 6, 2024
e30a544
refactor: small update to TwinConnectionsEdgeReturnOptions
mariammahrous23 Aug 6, 2024
a890208
feat: add ListContractsbyTwinId
Basem1166 Aug 6, 2024
a708069
Merge pull request #30 from codescalers/tfchain_graphql_twins
AlaaElattar Aug 6, 2024
1dbeb93
Merge pull request #39 from codescalers/tfchain_graphql_farms
AlaaElattar Aug 6, 2024
4b20cbc
Merge branch 'tfchain_graphql' of https://github.com/codescalers/tfgr…
Basem1166 Aug 6, 2024
b6518b3
Merge branch 'tfchain_graphql' of https://github.com/codescalers/tfgr…
mariammahrous23 Aug 6, 2024
cc23699
feat: add listContractConsumption
Basem1166 Aug 7, 2024
c8d5431
Bump melos from 3.4.0 to 6.1.0
dependabot[bot] Jun 27, 2024
2da9efe
Bump test from 1.25.7 to 1.25.8
dependabot[bot] Jul 4, 2024
4530889
Bump lints from 3.0.0 to 4.0.0
dependabot[bot] Jun 27, 2024
b79e31b
resolve conflicts
AlaaElattar Aug 8, 2024
bac138d
remove network host
AlaaElattar Jul 24, 2024
977f43b
fix running image from workflow
AlaaElattar Jul 24, 2024
668a5bd
add -d to the docker command
AlaaElattar Jul 24, 2024
e4692ae
make setupAll at the beginning of file
AlaaElattar Jul 24, 2024
10d733f
apply pr comments
AlaaElattar Jul 28, 2024
9e7ae08
add null check on twin
AlaaElattar Jul 28, 2024
d8f9701
fix ip creation
AlaaElattar Jul 30, 2024
6bd2f34
make setup manager singelton
AlaaElattar Jul 31, 2024
cea38cb
fix balances test
AlaaElattar Jul 31, 2024
582af1d
remove stopping docker from workflow
AlaaElattar Jul 31, 2024
37243fb
change tearDown to tearDownAll
AlaaElattar Jul 31, 2024
8afb48a
support both initialization of clients from setupManager
AlaaElattar Aug 1, 2024
888544d
update allowed public ips
AlaaElattar Aug 4, 2024
6b352ec
set subnet mask to 24
AlaaElattar Aug 4, 2024
dc69d5f
remove debugging logs
AlaaElattar Aug 4, 2024
f85e823
change condition to include Bob && remove commented code
AlaaElattar Aug 5, 2024
7e853a8
remove commented code from tests
AlaaElattar Aug 5, 2024
55d2592
Bump coverage from 1.8.0 to 1.9.0
dependabot[bot] Aug 5, 2024
091882c
change import signer to be from github directly
AlaaElattar Aug 6, 2024
1167de8
improve timeout and update readme
AlaaElattar Aug 6, 2024
c7a1778
resolve pubspec
AlaaElattar Aug 8, 2024
8ae5c5d
update test setp as suggested
AlaaElattar Aug 6, 2024
108e04d
update test setp as suggested
AlaaElattar Aug 6, 2024
4140ed4
refactor: made all node models in one file
mariammahrous23 Aug 8, 2024
3749f2e
refactor: combining nodesresourcestotal and node in one class + place…
mariammahrous23 Aug 8, 2024
b191c28
Merge pull request #35 from codescalers/tfchain_graphql_nodes
AlaaElattar Aug 8, 2024
07578b8
style: remove gql from class names , remove redundant code.
Basem1166 Aug 8, 2024
971fe5f
Merge branch 'tfchain_graphql' of https://github.com/codescalers/tfgr…
Basem1166 Aug 8, 2024
93eeb94
Merge pull request #36 from codescalers/tfchain_graphql_contracts
AlaaElattar Aug 8, 2024
b4edd45
update bin file to fix linting
AlaaElattar Aug 9, 2024
2f01a94
fix coverage workflow
AlaaElattar Aug 9, 2024
b60ad12
Merge branch 'main' into tfchain_graphql
AlaaElattar Aug 9, 2024
dabd0ea
refactor: updated get request fn
mariammahrous23 Aug 11, 2024
305bf77
Merge pull request #43 from codescalers/tfchain_gridproxy_client_update
AlaaElattar Aug 11, 2024
49be9aa
feat: added contracts
mariammahrous23 Aug 11, 2024
c9dcf3a
Refactor: Removed unnecessary prints + refactored contract details
mariammahrous23 Aug 11, 2024
d6ce839
refactor: further refactoring to details
mariammahrous23 Aug 11, 2024
afd1769
refactor: renamed details to contract
mariammahrous23 Aug 11, 2024
b430c1b
refactor: updated toString fn
mariammahrous23 Aug 11, 2024
b872b8b
refactor: making tojson
mariammahrous23 Aug 11, 2024
77a89ac
feat: implement node module
Basem1166 Aug 11, 2024
b8a94f9
Merge pull request #45 from codescalers/tfchain_gridproxy_contracts
AlaaElattar Aug 11, 2024
e6b1dee
Merge branch 'tfchain_gridproxy' into tfchain_gridproxy_nodes
Basem1166 Aug 11, 2024
87c52e7
feat: twins implementation
mariammahrous23 Aug 12, 2024
125b13f
fix: updated last hour consumption to be double instead of int
mariammahrous23 Aug 12, 2024
40679fd
chore : removed get node status, toString returns toJson()
Basem1166 Aug 12, 2024
a06a86b
Merge branch 'tfchain_gridproxy_nodes' of https://github.com/codescal…
Basem1166 Aug 12, 2024
d45d6ef
Merge pull request #46 from codescalers/tfchain_gridproxy_nodes
AlaaElattar Aug 12, 2024
f431757
fix: resolving conflict
mariammahrous23 Aug 12, 2024
d953cbd
fix: resolve conflict
mariammahrous23 Aug 12, 2024
423daa6
fix: resolve conflict in bin folder
mariammahrous23 Aug 12, 2024
090a25b
Merge branch 'tfchain_gridproxy' of https://github.com/codescalers/tf…
mariammahrous23 Aug 12, 2024
6e3622a
feat: implement farms endpoint
Basem1166 Aug 12, 2024
ad7de42
feat: added stats
mariammahrous23 Aug 12, 2024
ef9eaf7
Merge branch 'tfchain_gridproxy' into tfchain_gridproxy_stats
mariammahrous23 Aug 12, 2024
8b2095f
Merge pull request #49 from codescalers/tfchain_gridproxy_twins
AlaaElattar Aug 12, 2024
47accf2
Merge branch 'tfchain_gridproxy' into tfchain_gridproxy_stats
mariammahrous23 Aug 12, 2024
7cb6a55
Merge pull request #53 from codescalers/tfchain_gridproxy_stats
AlaaElattar Aug 12, 2024
d079cf9
refactor: add toJson methods for contract classes
Basem1166 Aug 5, 2024
eba8a22
feat: add ListContractsbyTwinId
Basem1166 Aug 6, 2024
829b0bb
fix: farmid changed to "" instead of being empty if not provided in p…
Basem1166 Aug 12, 2024
419b8cb
feat: add listContractConsumption
Basem1166 Aug 7, 2024
f7c0f22
style: remove gql from class names , remove redundant code.
Basem1166 Aug 8, 2024
ee85c44
update bin file to fix linting
AlaaElattar Aug 9, 2024
5789a3c
fix coverage workflow
AlaaElattar Aug 9, 2024
fb77e48
Bump melos from 3.4.0 to 6.1.0
dependabot[bot] Jun 27, 2024
2984156
Bump test from 1.25.7 to 1.25.8
dependabot[bot] Jul 4, 2024
aac5e8a
modify tests to be against docker image of chain
AlaaElattar Jul 24, 2024
b9d1982
remove network host
AlaaElattar Jul 24, 2024
0c1784c
fix running image from workflow
AlaaElattar Jul 24, 2024
9fed957
add -d to the docker command
AlaaElattar Jul 24, 2024
d769d98
apply pr comments
AlaaElattar Jul 28, 2024
029cac6
fix ip creation
AlaaElattar Jul 30, 2024
c98db0c
make setup manager singelton
AlaaElattar Jul 31, 2024
bb30be4
remove stopping docker from workflow
AlaaElattar Jul 31, 2024
5870c16
remove commented code from tests
AlaaElattar Aug 5, 2024
8c7bee2
Bump coverage from 1.8.0 to 1.9.0
dependabot[bot] Aug 5, 2024
cf9d397
change import signer to be from github directly
AlaaElattar Aug 6, 2024
e1bff99
improve timeout and update readme
AlaaElattar Aug 6, 2024
f89af8b
update test setp as suggested
AlaaElattar Aug 6, 2024
2c1379e
update test setp as suggested
AlaaElattar Aug 6, 2024
fa8b902
Merge branch 'tfchain_gridproxy' into tfchain_gridproxy_farms
Basem1166 Aug 12, 2024
feee713
Merge pull request #52 from codescalers/tfchain_gridproxy_farms
AlaaElattar Aug 13, 2024
fc902bb
fix versions to be compatible with dart 3.2.0
AlaaElattar Aug 18, 2024
741612e
remove tests dir form graphql and tfchain until there're tests
AlaaElattar Aug 18, 2024
5ddc450
update readme and gitignore of root
AlaaElattar Aug 18, 2024
b1d9640
modify reflectable file in gitignore
AlaaElattar Aug 19, 2024
51792cb
update dart version
AlaaElattar Aug 20, 2024
2618bac
remove analysis_options file
AlaaElattar Aug 20, 2024
abc9d10
update versions
AlaaElattar Aug 20, 2024
f2ea330
update versions in workflow
AlaaElattar Aug 20, 2024
a6614f7
Merge branch 'tfchain_graphql' of https://github.com/codescalers/tfgr…
AlaaElattar Aug 20, 2024
5928726
add readme && run dart analyze
AlaaElattar Aug 21, 2024
492f978
add path of gridproxy readme file
AlaaElattar Aug 21, 2024
0b5e8f3
remove gitignore and analysis_options file
AlaaElattar Aug 21, 2024
b9cb66f
fix renaming to be consistent in all models
AlaaElattar Aug 25, 2024
f42c57f
update functions renaming
AlaaElattar Aug 25, 2024
d3997a4
update getRequest to handle both http and https
AlaaElattar Aug 25, 2024
624530c
apply reflector pkg
AlaaElattar Aug 25, 2024
a8d1c9b
make sort shared between classes && apply dart format
AlaaElattar Aug 25, 2024
61e202c
make farm params not optional
AlaaElattar Aug 26, 2024
00e1514
check on contract type instead of fields && update readme
AlaaElattar Aug 26, 2024
ec39b87
wip: adding fromJson with reflector pkg
AlaaElattar Aug 28, 2024
01ebb04
wip: adding fromJson with reflector pkg
AlaaElattar Aug 28, 2024
6bfeb08
make nested classe to use fromJson manually
AlaaElattar Aug 29, 2024
b93e778
remove usage of dart:mirrors to work with flutter
AlaaElattar Aug 29, 2024
7220cf4
Delete packages/gridproxy_client/.gitignore
AlaaElattar Aug 29, 2024
db8e93c
Merge branch 'main' of https://github.com/codescalers/tfgrid-sdk-dart…
AlaaElattar Aug 29, 2024
0d674c7
Delete packages/gridproxy_client/pubspec.yaml
AlaaElattar Aug 29, 2024
d0a9822
Delete packages/gridproxy_client/pubspec.lock
AlaaElattar Aug 29, 2024
94be154
Delete packages/gridproxy_client/CHANGELOG.md
AlaaElattar Aug 29, 2024
7cbdd09
Delete packages/gridproxy_client/lib/src/nodes.dart
AlaaElattar Aug 29, 2024
581d7a2
Delete packages/gridproxy_client/lib/src/client.dart
AlaaElattar Aug 29, 2024
a1dcab7
Delete packages/gridproxy_client/lib/models/nodes.dart
AlaaElattar Aug 29, 2024
d879629
Delete packages/gridproxy_client/lib/gridproxy_client.dart
AlaaElattar Aug 29, 2024
c68907c
Delete packages/gridproxy_client/bin/gridproxy_client.dart
AlaaElattar Aug 29, 2024
d709c7d
Delete packages/gridproxy_client/analysis_options.yaml
AlaaElattar Aug 29, 2024
582a2ef
Delete packages/gridproxy_client/README.md
AlaaElattar Aug 29, 2024
2b26158
Merge branch 'tfchain_graphql' of https://github.com/codescalers/tfgr…
AlaaElattar Aug 29, 2024
a379d7a
undo changes in stellar client
AlaaElattar Aug 29, 2024
f73bed8
undo changes in stellar client
AlaaElattar Aug 29, 2024
a742ef9
undo changes in stellar client
AlaaElattar Aug 29, 2024
edd1fe7
undo changes in stellar client
AlaaElattar Aug 29, 2024
548846b
undo changes in reflector graphql
AlaaElattar Sep 2, 2024
7b89bd5
WIP: add fromJson to reflector pkg
AlaaElattar Sep 2, 2024
5e524df
use fromJson wiith PublicIp class && add pubspec.yaml (removed by mis…
AlaaElattar Sep 2, 2024
5ef7d6d
remove optional fields from nodes model
AlaaElattar Sep 2, 2024
c4773cc
update readme file
AlaaElattar Sep 2, 2024
b8048a6
update readme file
AlaaElattar Sep 2, 2024
a5bc71f
undo changes in graphql client by mistake
AlaaElattar Sep 2, 2024
c0b525a
update wrong readme example
AlaaElattar Sep 2, 2024
6133811
fix wrong data in readme
AlaaElattar Sep 2, 2024
feff78f
Merge pull request #44 from codescalers/tfchain_gridproxy
AlaaElattar Sep 2, 2024
940f362
comment initializeReflectable part in gridproxyClient
AlaaElattar Sep 2, 2024
b3296f0
WIP: fix error in processing superclass
AlaaElattar Sep 3, 2024
a5557f9
fix fromJson with contracts
AlaaElattar Sep 3, 2024
f568397
apply dart format
AlaaElattar Sep 3, 2024
db7f840
comment reflectable initialization from main
AlaaElattar Sep 3, 2024
de75fca
include graphql in the main readme file of repo
AlaaElattar Sep 3, 2024
a55ada5
Delete packages/graphql_client/CHANGELOG.md
AlaaElattar Sep 3, 2024
1268bc0
fix all bugs
AlaaElattar Sep 4, 2024
8b56ee5
Merge branch 'tfchain_graphql' of https://github.com/codescalers/tfgr…
AlaaElattar Sep 4, 2024
0e16d2a
Merge branch 'main' into tfchain_graphql
AhmedHanafy725 Sep 5, 2024
a3116cb
update renaming to be consistent
AlaaElattar Sep 8, 2024
41897c4
make toString generic with reflector pkg
AlaaElattar Sep 8, 2024
a9f15e4
WIP: update contracts functions
AlaaElattar Sep 9, 2024
d0a1c90
add build files for reflectable code to be seen from external projects
AlaaElattar Sep 9, 2024
40dd411
fix bug in building file to run local
AlaaElattar Sep 9, 2024
02fc832
Merge pull request #86 from codescalers/graphql_gridproxy_build.yaml
AlaaElattar Sep 9, 2024
f151521
update contracts functions
AlaaElattar Sep 10, 2024
e4e10f4
Merge branch 'tfchain_graphql' of https://github.com/codescalers/tfgr…
AlaaElattar Sep 10, 2024
580dab0
move farmInfo fromJson to be inside the class
AlaaElattar Sep 11, 2024
842b28e
update query handling in contracts
AlaaElattar Sep 11, 2024
81ab30b
WIP: fix bug in printing FarmInfo
AlaaElattar Sep 11, 2024
4667d82
WIP: trying to automate query building
AlaaElattar Sep 12, 2024
753be1c
WIP: test reflector with building queries
AlaaElattar Sep 12, 2024
157567d
undo changes of query building
AlaaElattar Sep 12, 2024
1877f1c
Merge branch 'main' of https://github.com/codescalers/tfgrid-sdk-dart…
AlaaElattar Sep 12, 2024
7c15855
Add method to stellar client to load wallet from hex secret seed
AhmedHanafy725 Sep 12, 2024
2d446b2
Add connection pool to tfchain client
AhmedHanafy725 Sep 17, 2024
5a1934e
Adjust hex regex
AhmedHanafy725 Sep 18, 2024
314f467
Fix reconnecting of the tfchain client
AhmedHanafy725 Sep 22, 2024
9d6f8ae
Change transaction types
AhmedHanafy725 Sep 30, 2024
34c29c3
Merge pull request #89 from codescalers/tfchain_graphql_hotfix_2
AhmedHanafy725 Oct 3, 2024
bd83a0b
Merge branch 'main' into tfchain_graphql
AhmedHanafy725 Oct 8, 2024
47336d8
Add ITransaction & TransactionTypes, add memo to PaymentOperationResp…
zaelgohary Oct 9, 2024
160b325
Move transaction to models, rename ITransaction to PaymentTransaction…
zaelgohary Oct 10, 2024
74b2593
Improve url
zaelgohary Oct 10, 2024
54ab469
Merge pull request #94 from codescalers/tfchain_graphql_add_memo
zaelgohary Oct 10, 2024
0a987f2
Fix stellar transactions and memo text in transaction
AhmedHanafy725 Oct 10, 2024
68fa4d2
Refactor toString & factory constructors, fix build
zaelgohary Oct 13, 2024
ce84e91
Fix Readme, add reflector to NodeConnectionsInfo
zaelgohary Oct 13, 2024
c40c485
Check for user balance before transfer
zaelgohary Oct 14, 2024
3378c0f
Add codecov in all packages
zaelgohary Oct 15, 2024
b84708d
Add precommit
zaelgohary Oct 15, 2024
af49738
Test pre-commit
zaelgohary Oct 15, 2024
1ece787
Push pre-commit
zaelgohary Oct 15, 2024
6e5ce8e
Merge pull request #97 from codescalers/tfchain_graphql_fix_codecov
zaelgohary Oct 17, 2024
732a0f6
Merge pull request #98 from codescalers/tfchain_graphql_pre-commit
zaelgohary Oct 17, 2024
c4f6a0c
Throw another error if sender doesn't have asset code
zaelgohary Oct 17, 2024
6b93538
Merge pull request #96 from codescalers/tfchain_graphql_check_balance
zaelgohary Oct 17, 2024
18a150d
Revert fromJson from ContractBillReports
zaelgohary Oct 20, 2024
8bc168b
Fix parsing errs
zaelgohary Oct 21, 2024
cb0641b
Ignore bin/graphql_client from analyzer
zaelgohary Oct 21, 2024
f8d0442
Remove bin/graphql_client from analyze, revert factory changes, add m…
zaelgohary Oct 23, 2024
dfa01ee
comment reflectable
zaelgohary Oct 23, 2024
bc2775a
Revert toString changes
zaelgohary Oct 23, 2024
4b81209
comment reflectable
zaelgohary Oct 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ coverage/
.vscode/
*.iml
.idea
/packages/*/bin/*.reflectable.dart
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
[![melos](https://img.shields.io/badge/maintained%20with-melos-f700ff.svg?style=flat-square)](https://github.com/invertase/melos) [![codecov](https://codecov.io/gh/codescalers/tfgrid-sdk-dart/graph/badge.svg?token=O34UDTMW5O)](https://codecov.io/gh/codescalers/tfgrid-sdk-dart)

This repo contains the dart clients for Threefold grid.

## Packages

- [signer](./packages/signer/README.md)
- [tfchain_client](./packages/tfchain_client/README.md)
- [gridproxy_client](./packages/gridproxy_client/README.md)
- [graphql_client](./packages/graphql_client/README.md)
- [stellar_client](./packages/stellar_client/README.md)

## Prerequisites

Make sure you have the following tools installed:
Expand Down
38 changes: 38 additions & 0 deletions git_hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/sh

result=$(dart format .)
exitCode=$? # If the exitCode is zero, then command executed successfully.

if [ $exitCode -ne 0 ]; then
echo "$result"
echo "Dart format found issues, please fix them."
exit 1
fi
echo "Finished running dart format command."

################################################################

result=$(dart analyze .)
exitCode=$? # If the exitCode is zero, then command executed successfully.

if [ $exitCode -ne 0 ]; then
echo "$result"
fi
echo "Finished running dart analyze command."

################################################################

# Run `dart dry --apply` to auto-fix basic issues.
result=$(dart fix --apply)
exitCode=$?

# Adding the files updated by `dart fix` command to git.
git add .

echo "$result"

if [ $exitCode -ne 0 ]; then
echo "dart fix command failed to execute."
exit 1
fi
echo "Finished running dart fix command."
47 changes: 47 additions & 0 deletions packages/graphql_client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Graphql Client

This is a dart client to send requests to graphql based on network for Threefold grid.

## Install Dependencies

``` bash
dart pub get
```

## Generate Reflectable code

```bash
dart run build_runner build
```

## Usage

- Ensure that initializeReflectable() is called at the beginning of your main

- Example usage:

```dart
import 'package:graphql_client/graphql_client.dart';
import 'package:graphql_client/models.dart';
import 'graphql_client.reflectable.dart';

void main() async {
initializeReflectable();

final graphQLClient = GraphQLClient('https://graphql.dev.grid.tf/graphql');

final FarmsReturnOptions farmsReturnOptions = FarmsReturnOptions(
farmID: true,
publicIps: PublicIpsReturnOptions(ip: true),
);
final FarmsQueryOptions farmsQueryOptions = FarmsQueryOptions(
idEq: "farm-id",
);

Future<List<FarmInfo>> farms = await graphQLClient.farms.list(farmsQueryOptions, farmsReturnOptions);

for (var farm in farms) {
print(farm);
}
}
```
14 changes: 14 additions & 0 deletions packages/graphql_client/bin/graphql_client.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'package:graphql_client/graphql_client.dart';
import 'package:graphql_client/models.dart';
// import 'graphql_client.reflectable.dart';

void main() async {
// initializeReflectable();
final graphQLClient = GraphQLClient('https://graphql.dev.grid.tf/graphql');

final res = await graphQLClient.twins.twinsConnections(
TwinConnectionsReturnOptions(),
TwinConnectionsQueryOptions(
whereOptions: TwinQueryWhereOptions(idEq: "89")));
print(res);
}
6 changes: 6 additions & 0 deletions packages/graphql_client/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
targets:
$default:
builders:
graphql_client:
generate_for:
- lib/**/*.dart
11 changes: 11 additions & 0 deletions packages/graphql_client/lib/graphql_client.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
library client;

import 'dart:convert';

import 'package:graphql_client/src/contracts.dart';
import 'package:graphql_client/src/farms.dart';
import 'package:graphql_client/src/nodes.dart';
import 'package:graphql_client/src/twins.dart';
import 'package:http/http.dart' as http;

part 'src/client.dart';
18 changes: 18 additions & 0 deletions packages/graphql_client/lib/models.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
library models;

import 'package:graphql_client/models/reflector.dart';
import 'package:reflectable/reflectable.dart';

part 'models/public_ips.dart';
part 'src/query_builder.dart';
part 'models/twins.dart';
part 'models/farms.dart';
part 'models/edges.dart';
part 'models/node.dart';
part 'models/page_info.dart';
part 'models/contracts.dart';
part 'models/nodes.dart';
part 'models/location.dart';
part 'models/public_config.dart';
part 'models/power.dart';
part "models/interfaces.dart";
Loading
Loading