Skip to content

Commit

Permalink
feat: update schema files
Browse files Browse the repository at this point in the history
  • Loading branch information
bot-anik committed Aug 23, 2024
1 parent 5481997 commit 9530b1d
Show file tree
Hide file tree
Showing 31 changed files with 2,990 additions and 3,401 deletions.
4 changes: 2 additions & 2 deletions go/cognitarium-schema/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AXONE cognitarium schema

> Generated go types for [axone-cognitarium contract](https://github.com/axone-protocol/contracts/tree/v3.0.0-54-gb243e6d/contracts/axone-cognitarium).
> Generated go types for [axone-cognitarium contract](https://github.com/axone-protocol/contracts/tree//contracts/axone-cognitarium).
[![version](https://img.shields.io/github/v/release/axone-protocol/axone-contract-schema?style=for-the-badge&logo=github)](https://github.com/axone-protocol/axone-contract-schema/releases)
[![build](https://img.shields.io/github/actions/workflow/status/axone-protocol/axone-contract-schema/build.yml?branch=main&label=build&style=for-the-badge&logo=github)](https://github.com/axone-protocol/axone-contract-schema/actions/workflows/build.yml)
Expand Down Expand Up @@ -897,6 +897,6 @@ Represents a condition in a [WhereClause].

---

_Rendered by [Fadroma](https://fadroma.tech) ([@fadroma/schema 1.1.0](https://www.npmjs.com/package/@fadroma/schema)) from `axone-cognitarium.json` (`72125c91d0c7acd2`)_
_Rendered by [Fadroma](https://fadroma.tech) ([@fadroma/schema 1.1.0](https://www.npmjs.com/package/@fadroma/schema)) from `axone-cognitarium.json` (`8f8a0452855d9314`)_


14 changes: 7 additions & 7 deletions go/dataverse-schema/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AXONE dataverse schema

> Generated go types for [axone-dataverse contract](https://github.com/axone-protocol/contracts/tree/v3.0.0-54-gb243e6d/contracts/axone-dataverse).
> Generated go types for [axone-dataverse contract](https://github.com/axone-protocol/contracts/tree//contracts/axone-dataverse).
[![version](https://img.shields.io/github/v/release/axone-protocol/axone-contract-schema?style=for-the-badge&logo=github)](https://github.com/axone-protocol/axone-contract-schema/releases)
[![build](https://img.shields.io/github/actions/workflow/status/axone-protocol/axone-contract-schema/build.yml?branch=main&label=build&style=for-the-badge&logo=github)](https://github.com/axone-protocol/axone-contract-schema/actions/workflows/build.yml)
Expand Down Expand Up @@ -117,11 +117,11 @@ To maintain integrity and coherence in the dataverse, several preconditions are

- `DataIntegrity` with the following cryptosuites: `eddsa-2022`, `eddsa-rdfc-2022`.

| parameter | description |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `submit_claims` | _(Required.) _ **object**. |
| `submit_claims.format` | **[RdfDatasetFormat](#rdfdatasetformat)\|null**. RDF dataset serialization format for the metadata. If not provided, the default format is [N-Quads](https://www.w3.org/TR/n-quads/) format. |
| `submit_claims.metadata` | _(Required.) _ **[Binary](#binary)**. The serialized metadata intended for attachment. This metadata should adhere to the format specified in the `format` field. |
| parameter | description |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `submit_claims` | _(Required.) _ **object**. |
| `submit_claims.claims` | _(Required.) _ **[Binary](#binary)**. The Verifiable Credential containing the claims. The claims must be serialized in the format specified by the `format` field. |
| `submit_claims.format` | **[RdfDatasetFormat](#rdfdatasetformat)\|null**. RDF dataset serialization format for the claims. If not provided, the default format is [N-Quads](https://www.w3.org/TR/n-quads/) format. |

### ExecuteMsg::RevokeClaims

Expand Down Expand Up @@ -259,7 +259,7 @@ let b = Uint64::from(70u32); assert_eq!(b.u64(), 70); ```
---
*Rendered by [Fadroma](https://fadroma.tech) ([@fadroma/schema 1.1.0](https://www.npmjs.com/package/@fadroma/schema)) from `axone-dataverse.json` (`6c036ea055d1bbb8`)*
*Rendered by [Fadroma](https://fadroma.tech) ([@fadroma/schema 1.1.0](https://www.npmjs.com/package/@fadroma/schema)) from `axone-dataverse.json` (`13c4a7b5af578887`)*
````


81 changes: 81 additions & 0 deletions go/dataverse-schema/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/* Code generated by github.com/srdtrk/go-codegen, DO NOT EDIT. */
package schema

import (
"context"
"encoding/json"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
grpc "google.golang.org/grpc"
insecure "google.golang.org/grpc/credentials/insecure"
)

// QueryClient is the client API for Query service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type QueryClient interface {
// Dataverse is the client API for the QueryMsg_Dataverse query message
Dataverse(ctx context.Context, req *QueryMsg_Dataverse, opts ...grpc.CallOption) (*DataverseResponse, error)
}

type queryClient struct {
cc *grpc.ClientConn
address string
}

var _ QueryClient = (*queryClient)(nil)

// NewQueryClient creates a new QueryClient
func NewQueryClient(gRPCAddress, contractAddress string, opts ...grpc.DialOption) (QueryClient, error) {
if len(opts) == 0 {
opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials()))
}

// Create a connection to the gRPC server
grpcConn, err := grpc.Dial(gRPCAddress, opts...)
if err != nil {
return nil, err
}

return &queryClient{
address: contractAddress,
cc: grpcConn,
}, nil
}

// Close closes the gRPC connection to the server
func (q *queryClient) Close() error {
return q.cc.Close()
}

// queryContract is a helper function to query the contract with raw query data
func (q *queryClient) queryContract(ctx context.Context, rawQueryData []byte, opts ...grpc.CallOption) ([]byte, error) {
in := &wasmtypes.QuerySmartContractStateRequest{
Address: q.address,
QueryData: rawQueryData,
}
out := new(wasmtypes.QuerySmartContractStateResponse)
err := q.cc.Invoke(ctx, "/cosmwasm.wasm.v1.Query/SmartContractState", in, out, opts...)
if err != nil {
return nil, err
}
return out.Data, nil
}

func (q *queryClient) Dataverse(ctx context.Context, req *QueryMsg_Dataverse, opts ...grpc.CallOption) (*DataverseResponse, error) {
rawQueryData, err := json.Marshal(map[string]any{"dataverse": req})
if err != nil {
return nil, err
}

rawResponseData, err := q.queryContract(ctx, rawQueryData, opts...)
if err != nil {
return nil, err
}

var response DataverseResponse
if err := json.Unmarshal(rawResponseData, &response); err != nil {
return nil, err
}

return &response, nil
}
Loading

0 comments on commit 9530b1d

Please sign in to comment.