Skip to content

Commit

Permalink
Merge pull request #156 from jefft0/chore/add-AddressFromMnemonic
Browse files Browse the repository at this point in the history
chore: Add API AddressFromMnemonic
  • Loading branch information
jefft0 authored Jul 22, 2024
2 parents 56a4073 + f98b795 commit e25fded
Show file tree
Hide file tree
Showing 21 changed files with 2,650 additions and 1,319 deletions.
420 changes: 410 additions & 10 deletions api/gen/csharp/Gnonativetypes.cs

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions api/gen/csharp/Rpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static RpcReflection() {
"EhgKE0VyckludmFsaWRHYXNXYW50ZWQQ0gESEAoLRXJyT3V0T2ZHYXMQ0wES",
"FAoPRXJyTWVtb1Rvb0xhcmdlENQBEhcKEkVyckluc3VmZmljaWVudEZlZRDV",
"ARIZChRFcnJUb29NYW55U2lnbmF0dXJlcxDWARIUCg9FcnJOb1NpZ25hdHVy",
"ZXMQ1wESEwoORXJyR2FzT3ZlcmZsb3cQ2AEyjRcKEEdub05hdGl2ZVNlcnZp",
"ZXMQ1wESEwoORXJyR2FzT3ZlcmZsb3cQ2AEyixgKEEdub05hdGl2ZVNlcnZp",
"Y2USXgoJU2V0UmVtb3RlEicubGFuZC5nbm8uZ25vbmF0aXZlLnYxLlNldFJl",
"bW90ZVJlcXVlc3QaKC5sYW5kLmduby5nbm9uYXRpdmUudjEuU2V0UmVtb3Rl",
"UmVzcG9uc2USXgoJR2V0UmVtb3RlEicubGFuZC5nbm8uZ25vbmF0aXZlLnYx",
Expand Down Expand Up @@ -105,12 +105,15 @@ static RpcReflection() {
"QWRkcmVzc1RvQmVjaDMyUmVzcG9uc2USdgoRQWRkcmVzc0Zyb21CZWNoMzIS",
"Ly5sYW5kLmduby5nbm9uYXRpdmUudjEuQWRkcmVzc0Zyb21CZWNoMzJSZXF1",
"ZXN0GjAubGFuZC5nbm8uZ25vbmF0aXZlLnYxLkFkZHJlc3NGcm9tQmVjaDMy",
"UmVzcG9uc2USUgoFSGVsbG8SIy5sYW5kLmduby5nbm9uYXRpdmUudjEuSGVs",
"bG9SZXF1ZXN0GiQubGFuZC5nbm8uZ25vbmF0aXZlLnYxLkhlbGxvUmVzcG9u",
"c2USZgoLSGVsbG9TdHJlYW0SKS5sYW5kLmduby5nbm9uYXRpdmUudjEuSGVs",
"bG9TdHJlYW1SZXF1ZXN0GioubGFuZC5nbm8uZ25vbmF0aXZlLnYxLkhlbGxv",
"U3RyZWFtUmVzcG9uc2UwAUIvWidnaXRodWIuY29tL2dub2xhbmcvZ25vbmF0",
"aXZlL2FwaS9nZW4vZ2+iAgNSVEdiBnByb3RvMw=="));
"UmVzcG9uc2USfAoTQWRkcmVzc0Zyb21NbmVtb25pYxIxLmxhbmQuZ25vLmdu",
"b25hdGl2ZS52MS5BZGRyZXNzRnJvbU1uZW1vbmljUmVxdWVzdBoyLmxhbmQu",
"Z25vLmdub25hdGl2ZS52MS5BZGRyZXNzRnJvbU1uZW1vbmljUmVzcG9uc2US",
"UgoFSGVsbG8SIy5sYW5kLmduby5nbm9uYXRpdmUudjEuSGVsbG9SZXF1ZXN0",
"GiQubGFuZC5nbm8uZ25vbmF0aXZlLnYxLkhlbGxvUmVzcG9uc2USZgoLSGVs",
"bG9TdHJlYW0SKS5sYW5kLmduby5nbm9uYXRpdmUudjEuSGVsbG9TdHJlYW1S",
"ZXF1ZXN0GioubGFuZC5nbm8uZ25vbmF0aXZlLnYxLkhlbGxvU3RyZWFtUmVz",
"cG9uc2UwAUIvWidnaXRodWIuY29tL2dub2xhbmcvZ25vbmF0aXZlL2FwaS9n",
"ZW4vZ2+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
74 changes: 74 additions & 0 deletions api/gen/csharp/RpcGrpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,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.AddressFromBech32Response> __Marshaller_land_gno_gnonative_v1_AddressFromBech32Response = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Land.Gno.Gnonative.V1.AddressFromBech32Response.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Land.Gno.Gnonative.V1.AddressFromMnemonicRequest> __Marshaller_land_gno_gnonative_v1_AddressFromMnemonicRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Land.Gno.Gnonative.V1.AddressFromMnemonicRequest.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Land.Gno.Gnonative.V1.AddressFromMnemonicResponse> __Marshaller_land_gno_gnonative_v1_AddressFromMnemonicResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Land.Gno.Gnonative.V1.AddressFromMnemonicResponse.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Land.Gno.Gnonative.V1.HelloRequest> __Marshaller_land_gno_gnonative_v1_HelloRequest = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Land.Gno.Gnonative.V1.HelloRequest.Parser));
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Marshaller<global::Land.Gno.Gnonative.V1.HelloResponse> __Marshaller_land_gno_gnonative_v1_HelloResponse = grpc::Marshallers.Create(__Helper_SerializeMessage, context => __Helper_DeserializeMessage(context, global::Land.Gno.Gnonative.V1.HelloResponse.Parser));
Expand Down Expand Up @@ -369,6 +373,14 @@ static T __Helper_DeserializeMessage<T>(grpc::DeserializationContext context, gl
__Marshaller_land_gno_gnonative_v1_AddressFromBech32Request,
__Marshaller_land_gno_gnonative_v1_AddressFromBech32Response);

[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Land.Gno.Gnonative.V1.AddressFromMnemonicRequest, global::Land.Gno.Gnonative.V1.AddressFromMnemonicResponse> __Method_AddressFromMnemonic = new grpc::Method<global::Land.Gno.Gnonative.V1.AddressFromMnemonicRequest, global::Land.Gno.Gnonative.V1.AddressFromMnemonicResponse>(
grpc::MethodType.Unary,
__ServiceName,
"AddressFromMnemonic",
__Marshaller_land_gno_gnonative_v1_AddressFromMnemonicRequest,
__Marshaller_land_gno_gnonative_v1_AddressFromMnemonicResponse);

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

/// <summary>
/// Convert a mnemonic (as in CreateAccount) to a byte array address.
/// </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.AddressFromMnemonicResponse> AddressFromMnemonic(global::Land.Gno.Gnonative.V1.AddressFromMnemonicRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}

/// <summary>
/// Hello is for debug purposes
/// </summary>
Expand Down Expand Up @@ -2127,6 +2151,54 @@ protected GnoNativeServiceClient(ClientBaseConfiguration configuration) : base(c
return CallInvoker.AsyncUnaryCall(__Method_AddressFromBech32, null, options, request);
}
/// <summary>
/// Convert a mnemonic (as in CreateAccount) to a byte array address.
/// </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.AddressFromMnemonicResponse AddressFromMnemonic(global::Land.Gno.Gnonative.V1.AddressFromMnemonicRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return AddressFromMnemonic(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Convert a mnemonic (as in CreateAccount) to a byte array address.
/// </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.AddressFromMnemonicResponse AddressFromMnemonic(global::Land.Gno.Gnonative.V1.AddressFromMnemonicRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_AddressFromMnemonic, null, options, request);
}
/// <summary>
/// Convert a mnemonic (as in CreateAccount) to a byte array address.
/// </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.AddressFromMnemonicResponse> AddressFromMnemonicAsync(global::Land.Gno.Gnonative.V1.AddressFromMnemonicRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return AddressFromMnemonicAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Convert a mnemonic (as in CreateAccount) to a byte array address.
/// </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.AddressFromMnemonicResponse> AddressFromMnemonicAsync(global::Land.Gno.Gnonative.V1.AddressFromMnemonicRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_AddressFromMnemonic, null, options, request);
}
/// <summary>
/// Hello is for debug purposes
/// </summary>
/// <param name="request">The request to send to the server.</param>
Expand Down Expand Up @@ -2238,6 +2310,7 @@ protected override GnoNativeServiceClient NewInstance(ClientBaseConfiguration co
.AddMethod(__Method_Run, serviceImpl.Run)
.AddMethod(__Method_AddressToBech32, serviceImpl.AddressToBech32)
.AddMethod(__Method_AddressFromBech32, serviceImpl.AddressFromBech32)
.AddMethod(__Method_AddressFromMnemonic, serviceImpl.AddressFromMnemonic)
.AddMethod(__Method_Hello, serviceImpl.Hello)
.AddMethod(__Method_HelloStream, serviceImpl.HelloStream).Build();
}
Expand Down Expand Up @@ -2275,6 +2348,7 @@ public static void BindService(grpc::ServiceBinderBase serviceBinder, GnoNativeS
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));
serviceBinder.AddMethod(__Method_AddressFromMnemonic, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Land.Gno.Gnonative.V1.AddressFromMnemonicRequest, global::Land.Gno.Gnonative.V1.AddressFromMnemonicResponse>(serviceImpl.AddressFromMnemonic));
serviceBinder.AddMethod(__Method_Hello, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Land.Gno.Gnonative.V1.HelloRequest, global::Land.Gno.Gnonative.V1.HelloResponse>(serviceImpl.Hello));
serviceBinder.AddMethod(__Method_HelloStream, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod<global::Land.Gno.Gnonative.V1.HelloStreamRequest, global::Land.Gno.Gnonative.V1.HelloStreamResponse>(serviceImpl.HelloStream));
}
Expand Down
48 changes: 48 additions & 0 deletions api/gen/es/gnonativetypes_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1574,6 +1574,54 @@ export declare class AddressFromBech32Response extends Message<AddressFromBech32
static equals(a: AddressFromBech32Response | PlainMessage<AddressFromBech32Response> | undefined, b: AddressFromBech32Response | PlainMessage<AddressFromBech32Response> | undefined): boolean;
}

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

constructor(data?: PartialMessage<AddressFromMnemonicRequest>);

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

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

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

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

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

/**
* @generated from message land.gno.gnonative.v1.AddressFromMnemonicResponse
*/
export declare class AddressFromMnemonicResponse extends Message<AddressFromMnemonicResponse> {
/**
* @generated from field: bytes address = 1;
*/
address: Uint8Array;

constructor(data?: PartialMessage<AddressFromMnemonicResponse>);

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

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

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

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

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

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

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

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

/**
* @generated from message land.gno.gnonative.v1.HelloRequest
*/
Expand Down
13 changes: 12 additions & 1 deletion api/gen/es/rpc_connect.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* eslint-disable */
// @ts-nocheck

import { AddressFromBech32Request, AddressFromBech32Response, AddressToBech32Request, AddressToBech32Response, CallRequest, CallResponse, CreateAccountRequest, CreateAccountResponse, DeleteAccountRequest, DeleteAccountResponse, GenerateRecoveryPhraseRequest, GenerateRecoveryPhraseResponse, GetActiveAccountRequest, GetActiveAccountResponse, GetChainIDRequest, GetChainIDResponse, GetKeyInfoByAddressRequest, GetKeyInfoByAddressResponse, GetKeyInfoByNameOrAddressRequest, GetKeyInfoByNameOrAddressResponse, GetKeyInfoByNameRequest, GetKeyInfoByNameResponse, GetRemoteRequest, GetRemoteResponse, HasKeyByAddressRequest, HasKeyByAddressResponse, HasKeyByNameOrAddressRequest, HasKeyByNameOrAddressResponse, HasKeyByNameRequest, HasKeyByNameResponse, HelloRequest, HelloResponse, HelloStreamRequest, HelloStreamResponse, ListKeyInfoRequest, ListKeyInfoResponse, QEvalRequest, QEvalResponse, QueryAccountRequest, QueryAccountResponse, QueryRequest, QueryResponse, RenderRequest, RenderResponse, RunRequest, RunResponse, SelectAccountRequest, SelectAccountResponse, SendRequest, SendResponse, SetChainIDRequest, SetChainIDResponse, SetPasswordRequest, SetPasswordResponse, SetRemoteRequest, SetRemoteResponse } from "./gnonativetypes_pb.js";
import { AddressFromBech32Request, AddressFromBech32Response, AddressFromMnemonicRequest, AddressFromMnemonicResponse, AddressToBech32Request, AddressToBech32Response, CallRequest, CallResponse, CreateAccountRequest, CreateAccountResponse, DeleteAccountRequest, DeleteAccountResponse, GenerateRecoveryPhraseRequest, GenerateRecoveryPhraseResponse, GetActiveAccountRequest, GetActiveAccountResponse, GetChainIDRequest, GetChainIDResponse, GetKeyInfoByAddressRequest, GetKeyInfoByAddressResponse, GetKeyInfoByNameOrAddressRequest, GetKeyInfoByNameOrAddressResponse, GetKeyInfoByNameRequest, GetKeyInfoByNameResponse, GetRemoteRequest, GetRemoteResponse, HasKeyByAddressRequest, HasKeyByAddressResponse, HasKeyByNameOrAddressRequest, HasKeyByNameOrAddressResponse, HasKeyByNameRequest, HasKeyByNameResponse, HelloRequest, HelloResponse, HelloStreamRequest, HelloStreamResponse, ListKeyInfoRequest, ListKeyInfoResponse, QEvalRequest, QEvalResponse, QueryAccountRequest, QueryAccountResponse, QueryRequest, QueryResponse, RenderRequest, RenderResponse, RunRequest, RunResponse, SelectAccountRequest, SelectAccountResponse, SendRequest, SendResponse, SetChainIDRequest, SetChainIDResponse, SetPasswordRequest, SetPasswordResponse, SetRemoteRequest, SetRemoteResponse } from "./gnonativetypes_pb.js";
import { MethodKind } from "@bufbuild/protobuf";

/**
Expand Down Expand Up @@ -340,6 +340,17 @@ export declare const GnoNativeService: {
readonly O: typeof AddressFromBech32Response,
readonly kind: MethodKind.Unary,
},
/**
* Convert a mnemonic (as in CreateAccount) to a byte array address.
*
* @generated from rpc land.gno.gnonative.v1.GnoNativeService.AddressFromMnemonic
*/
readonly addressFromMnemonic: {
readonly name: "AddressFromMnemonic",
readonly I: typeof AddressFromMnemonicRequest,
readonly O: typeof AddressFromMnemonicResponse,
readonly kind: MethodKind.Unary,
},
/**
* Hello is for debug purposes
*
Expand Down
Loading

0 comments on commit e25fded

Please sign in to comment.