Skip to content

Commit b36a4fe

Browse files
committed
remove graphql queries
1 parent dd56c30 commit b36a4fe

File tree

62 files changed

+8808
-16658
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+8808
-16658
lines changed

clients/graphql_client.go

Lines changed: 3116 additions & 12 deletions
Large diffs are not rendered by default.

clients/graphql_client_l1.go

Lines changed: 0 additions & 2916 deletions
This file was deleted.

clients/graphql_client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ query GetAllBalances($owner: SuiAddress!, $limit: Int, $cursor: String) {
4545
}
4646
}
4747
}`
48-
b, err := client.Query(q, map[string]interface{}{
48+
b, err := client.Query(context.Background(), q, map[string]interface{}{
4949
"owner": "0xe25afa59deccfec819aaa67bf14f049982d2a1ca87c49c8614da5ea2dc438f72",
5050
})
5151
require.NoError(t, err)

clients/graphql_conversion_test.go

Lines changed: 0 additions & 164 deletions
This file was deleted.

clients/iota-go/iotaclient/api_coin_query.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func (c *Client) GetAllBalances(ctx context.Context, owner *iotago.Address) ([]*
1818
type GetAllCoinsRequest struct {
1919
Owner *iotago.Address
2020
Cursor *iotago.ObjectID // optional
21-
Limit uint // optional
21+
Limit int // optional
2222
}
2323

2424
// start with the first object when cursor is nil
@@ -51,7 +51,7 @@ type GetCoinsRequest struct {
5151
Owner *iotago.Address
5252
CoinType *string // optional
5353
Cursor *string // optional
54-
Limit uint // optional
54+
Limit int // optional
5555
}
5656

5757
// GetCoins to use default iotago coin(0x2::iota::IOTA) when coinType is nil

clients/iota-go/iotaclient/api_exented.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (c *Client) GetDynamicFieldObject(
3434
type GetDynamicFieldsRequest struct {
3535
ParentObjectID *iotago.ObjectID
3636
Cursor *iotago.ObjectID // optional
37-
Limit *uint // optional
37+
Limit *int // optional
3838
}
3939

4040
func (c *Client) GetDynamicFields(
@@ -55,7 +55,7 @@ type GetOwnedObjectsRequest struct {
5555
Cursor *iotago.ObjectID
5656
// [optional] Limit is the maximum number of items returned per page, defaults to [QUERY_MAX_RESULT_LIMIT_OBJECTS] if not
5757
// provided
58-
Limit *uint
58+
Limit *int
5959
}
6060

6161
func (c *Client) GetOwnedObjects(
@@ -78,7 +78,7 @@ func (c *Client) GetOwnedObjects(
7878
type QueryEventsRequest struct {
7979
Query *iotajsonrpc.EventFilter
8080
Cursor *iotajsonrpc.EventId // optional
81-
Limit *uint // optional
81+
Limit *int // optional
8282
DescendingOrder bool // optional
8383
}
8484

@@ -93,7 +93,7 @@ func (c *Client) QueryEvents(
9393
type QueryTransactionBlocksRequest struct {
9494
Query *iotajsonrpc.IotaTransactionBlockResponseQuery
9595
Cursor *iotago.TransactionDigest // optional
96-
Limit *uint // optional
96+
Limit *int // optional
9797
DescendingOrder bool // optional
9898
}
9999

@@ -125,7 +125,7 @@ func (c *Client) ResolveNameServiceAddress(ctx context.Context, iotaName string)
125125
type ResolveNameServiceNamesRequest struct {
126126
Owner *iotago.Address
127127
Cursor *iotago.ObjectID // optional
128-
Limit *uint // optional
128+
Limit *int // optional
129129
}
130130

131131
func (c *Client) ResolveNameServiceNames(

clients/iota-go/iotaclient/api_write.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ import (
1212
type DevInspectTransactionBlockRequest struct {
1313
SenderAddress *iotago.Address
1414
TxKindBytes iotago.Base64Data
15-
GasPrice *iotajsonrpc.BigInt // optional
16-
Epoch *uint64 // optional
15+
GasPrice *iotajsonrpc.BigInt // optional
16+
Epoch *uint64 // optional
17+
Options *iotajsonrpc.IotaTransactionBlockResponseOptions // optional
1718
// additional_args // optional // FIXME
1819
}
1920

@@ -37,12 +38,17 @@ func (c *Client) DevInspectTransactionBlock(
3738
)
3839
}
3940

41+
type DryRunTransactionRequest struct {
42+
TxDataBytes iotago.Base64Data
43+
Options *iotajsonrpc.IotaTransactionBlockResponseOptions // optional
44+
}
45+
4046
func (c *Client) DryRunTransaction(
4147
ctx context.Context,
42-
txDataBytes iotago.Base64Data,
48+
req DryRunTransactionRequest,
4349
) (*iotajsonrpc.DryRunTransactionBlockResponse, error) {
4450
var resp iotajsonrpc.DryRunTransactionBlockResponse
45-
return &resp, c.transport.Call(ctx, &resp, dryRunTransactionBlock, txDataBytes)
51+
return &resp, c.transport.Call(ctx, &resp, dryRunTransactionBlock, req.TxDataBytes)
4652
}
4753

4854
type ExecuteTransactionBlockRequest struct {

clients/iota-go/iotaclient/iotaclienttest/api_coin_query_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func TestGetAllCoins(t *testing.T) {
3333
ctx context.Context
3434
address *iotago.Address
3535
cursor *iotago.ObjectID
36-
limit uint
36+
limit int
3737
}
3838

3939
tests := []struct {

clients/iota-go/iotaclient/iotaclienttest/api_exented_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func TestGetOwnedObjects(t *testing.T) {
8181
ShowContent: true,
8282
},
8383
}
84-
limit := uint(10)
84+
limit := int(10)
8585
objs, err := client.GetOwnedObjects(
8686
context.Background(), iotaclient.GetOwnedObjectsRequest{
8787
Address: signer.Address(),
@@ -106,7 +106,7 @@ func TestGetOwnedObjects(t *testing.T) {
106106
ShowContent: true,
107107
},
108108
}
109-
limit := uint(9)
109+
limit := int(9)
110110
objs, err := client.GetOwnedObjects(
111111
context.Background(), iotaclient.GetOwnedObjectsRequest{
112112
Address: signer.Address(),
@@ -148,12 +148,12 @@ func TestGetOwnedObjects(t *testing.T) {
148148

149149
func TestQueryTransactionBlocks(t *testing.T) {
150150
api := l1starter.Instance().L1Client()
151-
limit := uint(10)
151+
limit := int(10)
152152
type args struct {
153153
ctx context.Context
154154
query *iotajsonrpc.IotaTransactionBlockResponseQuery
155155
cursor *iotago.TransactionDigest
156-
limit *uint
156+
limit *int
157157
descendingOrder bool
158158
}
159159
tests := []struct {

0 commit comments

Comments
 (0)