Skip to content

feat: update gno dependency and add EstimateGas API function #195

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 12 commits into from
Apr 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ ruby 3.2.2
cocoapods 1.15.2
java openjdk-17.0.2
yarn 1.22.19
golang 1.22.5
golang 1.23.7
buf 1.39.0
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ $(gnocore_aar): $(bind_init_files) $(go_deps)
$(gomobile) bind -v \
-cache $(cache_dir)/android-gnonative \
-javapkg=gnolang.gno \
-o $@ -target android -androidapi 21 ./framework/service
-o $@ -target android/arm64,android/amd64 -androidapi 21 ./framework/service
_bind.clean.android:
rm -rf $(gnocore_jar) $(gnocore_aar)

Expand Down
713 changes: 683 additions & 30 deletions api/gen/csharp/Gnonativetypes.cs

Large diffs are not rendered by default.

42 changes: 22 additions & 20 deletions api/gen/csharp/Rpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static RpcReflection() {
"ARIZChRFcnJUb29NYW55U2lnbmF0dXJlcxDWARIUCg9FcnJOb1NpZ25hdHVy",
"ZXMQ1wESEwoORXJyR2FzT3ZlcmZsb3cQ2AESFgoRRXJySW52YWxpZFBrZ1Bh",
"dGgQ2QESEwoORXJySW52YWxpZFN0bXQQ2gESEwoORXJySW52YWxpZEV4cHIQ",
"2wEy4xwKEEdub05hdGl2ZVNlcnZpY2USXgoJU2V0UmVtb3RlEicubGFuZC5n",
"2wEyyR0KEEdub05hdGl2ZVNlcnZpY2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",
"LkFkZHJlc3NUb0JlY2gzMlJlcXVlc3QaLi5sYW5kLmduby5nbm9uYXRpdmUu",
"djEuQWRkcmVzc1RvQmVjaDMyUmVzcG9uc2USdgoRQWRkcmVzc0Zyb21CZWNo",
"MzISLy5sYW5kLmduby5nbm9uYXRpdmUudjEuQWRkcmVzc0Zyb21CZWNoMzJS",
"ZXF1ZXN0GjAubGFuZC5nbm8uZ25vbmF0aXZlLnYxLkFkZHJlc3NGcm9tQmVj",
"aDMyUmVzcG9uc2USfAoTQWRkcmVzc0Zyb21NbmVtb25pYxIxLmxhbmQuZ25v",
"Lmdub25hdGl2ZS52MS5BZGRyZXNzRnJvbU1uZW1vbmljUmVxdWVzdBoyLmxh",
"bmQuZ25vLmdub25hdGl2ZS52MS5BZGRyZXNzRnJvbU1uZW1vbmljUmVzcG9u",
"c2USUgoFSGVsbG8SIy5sYW5kLmduby5nbm9uYXRpdmUudjEuSGVsbG9SZXF1",
"ZXN0GiQubGFuZC5nbm8uZ25vbmF0aXZlLnYxLkhlbGxvUmVzcG9uc2USZgoL",
"SGVsbG9TdHJlYW0SKS5sYW5kLmduby5nbm9uYXRpdmUudjEuSGVsbG9TdHJl",
"YW1SZXF1ZXN0GioubGFuZC5nbm8uZ25vbmF0aXZlLnYxLkhlbGxvU3RyZWFt",
"UmVzcG9uc2UwAUIvWidnaXRodWIuY29tL2dub2xhbmcvZ25vbmF0aXZlL2Fw",
"aS9nZW4vZ2+iAgNSVEdiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Land.Gno.Gnonative.V1.GnonativetypesReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Land.Gno.Gnonative.V1.ErrCode), }, null, new pbr::GeneratedClrTypeInfo[] {
Expand Down
79 changes: 79 additions & 0 deletions api/gen/csharp/RpcGrpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ static T __Helper_DeserializeMessage<T>(grpc::DeserializationContext context, gl
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Land.Gno.Gnonative.V1.MakeTxResponse> __Marshaller_land_gno_gnonative_v1_MakeTxResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Land.Gno.Gnonative.V1.MakeTxResponse.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Land.Gno.Gnonative.V1.EstimateGasRequest> __Marshaller_land_gno_gnonative_v1_EstimateGasRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Land.Gno.Gnonative.V1.EstimateGasRequest.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Land.Gno.Gnonative.V1.EstimateGasResponse> __Marshaller_land_gno_gnonative_v1_EstimateGasResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Land.Gno.Gnonative.V1.EstimateGasResponse.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Land.Gno.Gnonative.V1.SignTxRequest> __Marshaller_land_gno_gnonative_v1_SignTxRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Land.Gno.Gnonative.V1.SignTxRequest.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Land.Gno.Gnonative.V1.SignTxResponse> __Marshaller_land_gno_gnonative_v1_SignTxResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Land.Gno.Gnonative.V1.SignTxResponse.Parser));
Expand Down Expand Up @@ -403,6 +407,14 @@ static T __Helper_DeserializeMessage<T>(grpc::DeserializationContext context, gl
__Marshaller_land_gno_gnonative_v1_RunRequest,
__Marshaller_land_gno_gnonative_v1_MakeTxResponse);

[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Land.Gno.Gnonative.V1.EstimateGasRequest, global::Land.Gno.Gnonative.V1.EstimateGasResponse> __Method_EstimateGas = new grpc::Method<global::Land.Gno.Gnonative.V1.EstimateGasRequest, global::Land.Gno.Gnonative.V1.EstimateGasResponse>(
grpc::MethodType.Unary,
__ServiceName,
"EstimateGas",
__Marshaller_land_gno_gnonative_v1_EstimateGasRequest,
__Marshaller_land_gno_gnonative_v1_EstimateGasResponse);

[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Land.Gno.Gnonative.V1.SignTxRequest, global::Land.Gno.Gnonative.V1.SignTxResponse> __Method_SignTx = new grpc::Method<global::Land.Gno.Gnonative.V1.SignTxRequest, global::Land.Gno.Gnonative.V1.SignTxResponse>(
grpc::MethodType.Unary,
Expand Down Expand Up @@ -857,6 +869,19 @@ public abstract partial class GnoNativeServiceBase
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}

/// <summary>
/// EstimateGas estimate the least amount of gas required for the transaction to go through on the chain (minimum gas wanted), with a security margin.
/// If UpdateTx is true, then update the transaction with the gasWanted amount.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::System.Threading.Tasks.Task<global::Land.Gno.Gnonative.V1.EstimateGasResponse> EstimateGas(global::Land.Gno.Gnonative.V1.EstimateGasRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}

/// <summary>
/// Sign the transaction using the account with the given address.
/// If there is no activated account with the given address, return [ErrCode](#land.gno.gnonative.v1.ErrCode).ErrNoActiveAccount.
Expand Down Expand Up @@ -2427,6 +2452,58 @@ protected GnoNativeServiceClient(ClientBaseConfiguration configuration) : base(c
return CallInvoker.AsyncUnaryCall(__Method_MakeRunTx, null, options, request);
}
/// <summary>
/// EstimateGas estimate the least amount of gas required for the transaction to go through on the chain (minimum gas wanted), with a security margin.
/// If UpdateTx is true, then update the transaction with the gasWanted amount.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Land.Gno.Gnonative.V1.EstimateGasResponse EstimateGas(global::Land.Gno.Gnonative.V1.EstimateGasRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return EstimateGas(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// EstimateGas estimate the least amount of gas required for the transaction to go through on the chain (minimum gas wanted), with a security margin.
/// If UpdateTx is true, then update the transaction with the gasWanted amount.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::Land.Gno.Gnonative.V1.EstimateGasResponse EstimateGas(global::Land.Gno.Gnonative.V1.EstimateGasRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_EstimateGas, null, options, request);
}
/// <summary>
/// EstimateGas estimate the least amount of gas required for the transaction to go through on the chain (minimum gas wanted), with a security margin.
/// If UpdateTx is true, then update the transaction with the gasWanted amount.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Land.Gno.Gnonative.V1.EstimateGasResponse> EstimateGasAsync(global::Land.Gno.Gnonative.V1.EstimateGasRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return EstimateGasAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// EstimateGas estimate the least amount of gas required for the transaction to go through on the chain (minimum gas wanted), with a security margin.
/// If UpdateTx is true, then update the transaction with the gasWanted amount.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncUnaryCall<global::Land.Gno.Gnonative.V1.EstimateGasResponse> EstimateGasAsync(global::Land.Gno.Gnonative.V1.EstimateGasRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_EstimateGas, null, options, request);
}
/// <summary>
/// Sign the transaction using the account with the given address.
/// If there is no activated account with the given address, return [ErrCode](#land.gno.gnonative.v1.ErrCode).ErrNoActiveAccount.
/// If the password is wrong, return [ErrCode](#land.gno.gnonative.v1.ErrCode).ErrDecryptionFailed.
Expand Down Expand Up @@ -2764,6 +2841,7 @@ protected override GnoNativeServiceClient NewInstance(ClientBaseConfiguration co
.AddMethod(__Method_MakeCallTx, serviceImpl.MakeCallTx)
.AddMethod(__Method_MakeSendTx, serviceImpl.MakeSendTx)
.AddMethod(__Method_MakeRunTx, serviceImpl.MakeRunTx)
.AddMethod(__Method_EstimateGas, serviceImpl.EstimateGas)
.AddMethod(__Method_SignTx, serviceImpl.SignTx)
.AddMethod(__Method_BroadcastTxCommit, serviceImpl.BroadcastTxCommit)
.AddMethod(__Method_AddressToBech32, serviceImpl.AddressToBech32)
Expand Down Expand Up @@ -2808,6 +2886,7 @@ public static void BindService(grpc::ServiceBinderBase serviceBinder, GnoNativeS
serviceBinder.AddMethod(__Method_MakeCallTx, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Land.Gno.Gnonative.V1.CallRequest, global::Land.Gno.Gnonative.V1.MakeTxResponse>(serviceImpl.MakeCallTx));
serviceBinder.AddMethod(__Method_MakeSendTx, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Land.Gno.Gnonative.V1.SendRequest, global::Land.Gno.Gnonative.V1.MakeTxResponse>(serviceImpl.MakeSendTx));
serviceBinder.AddMethod(__Method_MakeRunTx, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Land.Gno.Gnonative.V1.RunRequest, global::Land.Gno.Gnonative.V1.MakeTxResponse>(serviceImpl.MakeRunTx));
serviceBinder.AddMethod(__Method_EstimateGas, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Land.Gno.Gnonative.V1.EstimateGasRequest, global::Land.Gno.Gnonative.V1.EstimateGasResponse>(serviceImpl.EstimateGas));
serviceBinder.AddMethod(__Method_SignTx, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Land.Gno.Gnonative.V1.SignTxRequest, global::Land.Gno.Gnonative.V1.SignTxResponse>(serviceImpl.SignTx));
serviceBinder.AddMethod(__Method_BroadcastTxCommit, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod<global::Land.Gno.Gnonative.V1.BroadcastTxCommitRequest, global::Land.Gno.Gnonative.V1.BroadcastTxCommitResponse>(serviceImpl.BroadcastTxCommit));
serviceBinder.AddMethod(__Method_AddressToBech32, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Land.Gno.Gnonative.V1.AddressToBech32Request, global::Land.Gno.Gnonative.V1.AddressToBech32Response>(serviceImpl.AddressToBech32));
Expand Down
Loading