Skip to content

Commit

Permalink
Merge pull request #115 from jefft0/chore/add-Send
Browse files Browse the repository at this point in the history
chore: Add Send to the API
  • Loading branch information
jefft0 authored Feb 12, 2024
2 parents 136e4f9 + 51ec463 commit ba2a51a
Show file tree
Hide file tree
Showing 29 changed files with 2,001 additions and 250 deletions.
741 changes: 716 additions & 25 deletions api/gen/csharp/Gnonativetypes.cs

Large diffs are not rendered by default.

32 changes: 17 additions & 15 deletions api/gen/csharp/Rpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static RpcReflection() {
"YW50ZWQQ0gESEAoLRXJyT3V0T2ZHYXMQ0wESFAoPRXJyTWVtb1Rvb0xhcmdl",
"ENQBEhcKEkVyckluc3VmZmljaWVudEZlZRDVARIZChRFcnJUb29NYW55U2ln",
"bmF0dXJlcxDWARIUCg9FcnJOb1NpZ25hdHVyZXMQ1wESEwoORXJyR2FzT3Zl",
"cmZsb3cQ2AEyuhYKEEdub05hdGl2ZVNlcnZpY2USXgoJU2V0UmVtb3RlEicu",
"cmZsb3cQ2AEyjRcKEEdub05hdGl2ZVNlcnZpY2USXgoJU2V0UmVtb3RlEicu",
"bGFuZC5nbm8uZ25vbmF0aXZlLnYxLlNldFJlbW90ZVJlcXVlc3QaKC5sYW5k",
"Lmduby5nbm9uYXRpdmUudjEuU2V0UmVtb3RlUmVzcG9uc2USXgoJR2V0UmVt",
"b3RlEicubGFuZC5nbm8uZ25vbmF0aXZlLnYxLkdldFJlbW90ZVJlcXVlc3Qa",
Expand Down Expand Up @@ -95,20 +95,22 @@ static RpcReflection() {
"ZGVyUmVzcG9uc2USUgoFUUV2YWwSIy5sYW5kLmduby5nbm9uYXRpdmUudjEu",
"UUV2YWxSZXF1ZXN0GiQubGFuZC5nbm8uZ25vbmF0aXZlLnYxLlFFdmFsUmVz",
"cG9uc2USUQoEQ2FsbBIiLmxhbmQuZ25vLmdub25hdGl2ZS52MS5DYWxsUmVx",
"dWVzdBojLmxhbmQuZ25vLmdub25h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0GiIubGFuZC5nbm8u",
"Z25vbmF0aXZlLnYxLlJ1blJlc3BvbnNlMAEScAoPQWRkcmVzc1RvQmVjaDMy",
"Ei0ubGFuZC5nbm8uZ25vbmF0aXZlLnYxLkFkZHJlc3NUb0JlY2gzMlJlcXVl",
"c3QaLi5sYW5kLmduby5nbm9uYXRpdmUudjEuQWRkcmVzc1RvQmVjaDMyUmVz",
"cG9uc2USdgoRQWRkcmVzc0Zyb21CZWNoMzISLy5sYW5kLmduby5nbm9uYXRp",
"dmUudjEuQWRkcmVzc0Zyb21CZWNoMzJSZXF1ZXN0GjAubGFuZC5nbm8uZ25v",
"bmF0aXZlLnYxLkFkZHJlc3NGcm9tQmVjaDMyUmVzcG9uc2USUgoFSGVsbG8S",
"Iy5sYW5kLmduby5nbm9uYXRpdmUudjEuSGVsbG9SZXF1ZXN0GiQubGFuZC5n",
"bm8uZ25vbmF0aXZlLnYxLkhlbGxvUmVzcG9uc2USZgoLSGVsbG9TdHJlYW0S",
"KS5sYW5kLmduby5nbm9uYXRpdmUudjEuSGVsbG9TdHJlYW1SZXF1ZXN0Giou",
"bGFuZC5nbm8uZ25vbmF0aXZlLnYxLkhlbGxvU3RyZWFtUmVzcG9uc2UwAUIv",
"WidnaXRodWIuY29tL2dub2xhbmcvZ25vbmF0aXZlL2FwaS9nZW4vZ2+iAgNS",
"VEdiBnByb3RvMw=="));
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
57 changes: 57 additions & 0 deletions api/gen/csharp/RpcGrpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,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.CallResponse> __Marshaller_land_gno_gnonative_v1_CallResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Land.Gno.Gnonative.V1.CallResponse.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Land.Gno.Gnonative.V1.SendRequest> __Marshaller_land_gno_gnonative_v1_SendRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Land.Gno.Gnonative.V1.SendRequest.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Land.Gno.Gnonative.V1.SendResponse> __Marshaller_land_gno_gnonative_v1_SendResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Land.Gno.Gnonative.V1.SendResponse.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Land.Gno.Gnonative.V1.RunRequest> __Marshaller_land_gno_gnonative_v1_RunRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Land.Gno.Gnonative.V1.RunRequest.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Land.Gno.Gnonative.V1.RunResponse> __Marshaller_land_gno_gnonative_v1_RunResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Land.Gno.Gnonative.V1.RunResponse.Parser));
Expand Down Expand Up @@ -333,6 +337,14 @@ static T __Helper_DeserializeMessage<T>(grpc::DeserializationContext context, gl
__Marshaller_land_gno_gnonative_v1_CallRequest,
__Marshaller_land_gno_gnonative_v1_CallResponse);

[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Land.Gno.Gnonative.V1.SendRequest, global::Land.Gno.Gnonative.V1.SendResponse> __Method_Send = new grpc::Method<global::Land.Gno.Gnonative.V1.SendRequest, global::Land.Gno.Gnonative.V1.SendResponse>(
grpc::MethodType.ServerStreaming,
__ServiceName,
"Send",
__Marshaller_land_gno_gnonative_v1_SendRequest,
__Marshaller_land_gno_gnonative_v1_SendResponse);

[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Land.Gno.Gnonative.V1.RunRequest, global::Land.Gno.Gnonative.V1.RunResponse> __Method_Run = new grpc::Method<global::Land.Gno.Gnonative.V1.RunRequest, global::Land.Gno.Gnonative.V1.RunResponse>(
grpc::MethodType.ServerStreaming,
Expand Down Expand Up @@ -684,6 +696,21 @@ public abstract partial class GnoNativeServiceBase
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}

/// <summary>
/// Send currency from the active account to an account on the blockchain.
/// If no active account has been set with SelectAccount, return [ErrCode](#land.gno.gnonative.v1.ErrCode).ErrNoActiveAccount.
/// If the password is wrong, return [ErrCode](#land.gno.gnonative.v1.ErrCode).ErrDecryptionFailed.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="responseStream">Used for sending responses back to the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>A task indicating completion of the handler.</returns>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::System.Threading.Tasks.Task Send(global::Land.Gno.Gnonative.V1.SendRequest request, grpc::IServerStreamWriter<global::Land.Gno.Gnonative.V1.SendResponse> responseStream, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}

/// <summary>
/// Temporarily load the code in package on the blockchain and run main() which can
/// call realm functions and use println() to output to the "console".
Expand Down Expand Up @@ -1948,6 +1975,34 @@ protected GnoNativeServiceClient(ClientBaseConfiguration configuration) : base(c
return CallInvoker.AsyncServerStreamingCall(__Method_Call, null, options, request);
}
/// <summary>
/// Send currency from the active account to an account on the blockchain.
/// If no active account has been set with SelectAccount, return [ErrCode](#land.gno.gnonative.v1.ErrCode).ErrNoActiveAccount.
/// If the password is wrong, return [ErrCode](#land.gno.gnonative.v1.ErrCode).ErrDecryptionFailed.
/// </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::AsyncServerStreamingCall<global::Land.Gno.Gnonative.V1.SendResponse> Send(global::Land.Gno.Gnonative.V1.SendRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return Send(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Send currency from the active account to an account on the blockchain.
/// If no active account has been set with SelectAccount, return [ErrCode](#land.gno.gnonative.v1.ErrCode).ErrNoActiveAccount.
/// If the password is wrong, return [ErrCode](#land.gno.gnonative.v1.ErrCode).ErrDecryptionFailed.
/// </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::AsyncServerStreamingCall<global::Land.Gno.Gnonative.V1.SendResponse> Send(global::Land.Gno.Gnonative.V1.SendRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncServerStreamingCall(__Method_Send, null, options, request);
}
/// <summary>
/// Temporarily load the code in package on the blockchain and run main() which can
/// call realm functions and use println() to output to the "console".
/// This returns the "console" output.
Expand Down Expand Up @@ -2179,6 +2234,7 @@ protected override GnoNativeServiceClient NewInstance(ClientBaseConfiguration co
.AddMethod(__Method_Render, serviceImpl.Render)
.AddMethod(__Method_QEval, serviceImpl.QEval)
.AddMethod(__Method_Call, serviceImpl.Call)
.AddMethod(__Method_Send, serviceImpl.Send)
.AddMethod(__Method_Run, serviceImpl.Run)
.AddMethod(__Method_AddressToBech32, serviceImpl.AddressToBech32)
.AddMethod(__Method_AddressFromBech32, serviceImpl.AddressFromBech32)
Expand Down Expand Up @@ -2215,6 +2271,7 @@ public static void BindService(grpc::ServiceBinderBase serviceBinder, GnoNativeS
serviceBinder.AddMethod(__Method_Render, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Land.Gno.Gnonative.V1.RenderRequest, global::Land.Gno.Gnonative.V1.RenderResponse>(serviceImpl.Render));
serviceBinder.AddMethod(__Method_QEval, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Land.Gno.Gnonative.V1.QEvalRequest, global::Land.Gno.Gnonative.V1.QEvalResponse>(serviceImpl.QEval));
serviceBinder.AddMethod(__Method_Call, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod<global::Land.Gno.Gnonative.V1.CallRequest, global::Land.Gno.Gnonative.V1.CallResponse>(serviceImpl.Call));
serviceBinder.AddMethod(__Method_Send, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod<global::Land.Gno.Gnonative.V1.SendRequest, global::Land.Gno.Gnonative.V1.SendResponse>(serviceImpl.Send));
serviceBinder.AddMethod(__Method_Run, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod<global::Land.Gno.Gnonative.V1.RunRequest, global::Land.Gno.Gnonative.V1.RunResponse>(serviceImpl.Run));
serviceBinder.AddMethod(__Method_AddressToBech32, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Land.Gno.Gnonative.V1.AddressToBech32Request, global::Land.Gno.Gnonative.V1.AddressToBech32Response>(serviceImpl.AddressToBech32));
serviceBinder.AddMethod(__Method_AddressFromBech32, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Land.Gno.Gnonative.V1.AddressFromBech32Request, global::Land.Gno.Gnonative.V1.AddressFromBech32Response>(serviceImpl.AddressFromBech32));
Expand Down
96 changes: 96 additions & 0 deletions api/gen/es/gnonativetypes_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1279,6 +1279,102 @@ export declare class CallResponse extends Message<CallResponse> {
static equals(a: CallResponse | PlainMessage<CallResponse> | undefined, b: CallResponse | PlainMessage<CallResponse> | undefined): boolean;
}

/**
* @generated from message land.gno.gnonative.v1.MsgSend
*/
export declare class MsgSend extends Message<MsgSend> {
/**
* Example: The response of calling AddressFromBech32 with
* "g1juz2yxmdsa6audkp6ep9vfv80c8p5u76e03vvh"
*
* @generated from field: bytes to_address = 1;
*/
toAddress: Uint8Array;

/**
* Example: "1000ugnot"
*
* @generated from field: string send = 2;
*/
send: string;

constructor(data?: PartialMessage<MsgSend>);

static readonly runtime: typeof proto3;
static readonly typeName = "land.gno.gnonative.v1.MsgSend";
static readonly fields: FieldList;

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MsgSend;

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MsgSend;

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MsgSend;

static equals(a: MsgSend | PlainMessage<MsgSend> | undefined, b: MsgSend | PlainMessage<MsgSend> | undefined): boolean;
}

/**
* @generated from message land.gno.gnonative.v1.SendRequest
*/
export declare class SendRequest extends Message<SendRequest> {
/**
* @generated from field: string gas_fee = 1;
*/
gasFee: string;

/**
* @generated from field: sint64 gas_wanted = 2;
*/
gasWanted: bigint;

/**
* Memo is optional
*
* @generated from field: string memo = 3;
*/
memo: string;

/**
* list of send operations to make in one transaction
*
* @generated from field: repeated land.gno.gnonative.v1.MsgSend msgs = 4 [json_name = "Msgs"];
*/
msgs: MsgSend[];

constructor(data?: PartialMessage<SendRequest>);

static readonly runtime: typeof proto3;
static readonly typeName = "land.gno.gnonative.v1.SendRequest";
static readonly fields: FieldList;

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SendRequest;

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SendRequest;

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SendRequest;

static equals(a: SendRequest | PlainMessage<SendRequest> | undefined, b: SendRequest | PlainMessage<SendRequest> | undefined): boolean;
}

/**
* @generated from message land.gno.gnonative.v1.SendResponse
*/
export declare class SendResponse extends Message<SendResponse> {
constructor(data?: PartialMessage<SendResponse>);

static readonly runtime: typeof proto3;
static readonly typeName = "land.gno.gnonative.v1.SendResponse";
static readonly fields: FieldList;

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): SendResponse;

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): SendResponse;

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): SendResponse;

static equals(a: SendResponse | PlainMessage<SendResponse> | undefined, b: SendResponse | PlainMessage<SendResponse> | undefined): boolean;
}

/**
* @generated from message land.gno.gnonative.v1.RunRequest
*/
Expand Down
32 changes: 32 additions & 0 deletions api/gen/es/gnonativetypes_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,38 @@ export const CallResponse = proto3.makeMessageType(
],
);

/**
* @generated from message land.gno.gnonative.v1.MsgSend
*/
export const MsgSend = proto3.makeMessageType(
"land.gno.gnonative.v1.MsgSend",
() => [
{ no: 1, name: "to_address", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
{ no: 2, name: "send", kind: "scalar", T: 9 /* ScalarType.STRING */ },
],
);

/**
* @generated from message land.gno.gnonative.v1.SendRequest
*/
export const SendRequest = proto3.makeMessageType(
"land.gno.gnonative.v1.SendRequest",
() => [
{ no: 1, name: "gas_fee", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 2, name: "gas_wanted", kind: "scalar", T: 18 /* ScalarType.SINT64 */ },
{ no: 3, name: "memo", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 4, name: "msgs", jsonName: "Msgs", kind: "message", T: MsgSend, repeated: true },
],
);

/**
* @generated from message land.gno.gnonative.v1.SendResponse
*/
export const SendResponse = proto3.makeMessageType(
"land.gno.gnonative.v1.SendResponse",
[],
);

/**
* @generated from message land.gno.gnonative.v1.RunRequest
*/
Expand Down
Loading

0 comments on commit ba2a51a

Please sign in to comment.