Skip to content
This repository was archived by the owner on Jan 24, 2023. It is now read-only.
Open
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 Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ gennode:
rm -rf node/*
docker run -v $(PWD)/proto:/proto -v $(PWD)/node:/genproto \
--mount type=bind,source="$(PWD)/package.json",target=/package.json \
--mount type=bind,source="$(PWD)/package.lock",target=/package.lock \
--mount type=bind,source="$(PWD)/yarn.lock",target=/yarn.lock \
-e "USER_ID=$(USER_ID)" -e "GROUP_ID=$(GROUP_ID)" \
agora-api-builder-node

3 changes: 2 additions & 1 deletion build/node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ RUN apt-get update
RUN apt-get install -y protobuf-compiler

# Yarn proto dependencies
RUN yarn add grpc grpc-tools grpc_tools_node_protoc_ts
RUN yarn add @grpc/grpc-js
RUN yarn add -D grpc-tools grpc_tools_node_protoc_ts

# Common base proto dependencies.
RUN git clone https://github.com/envoyproxy/protoc-gen-validate
Expand Down
5 changes: 3 additions & 2 deletions build/node/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ for f in $(find /proto/ -type f -name "*.proto"); do
FILES="$FILES $f"
done

yarn add grpc grpc-tools grpc_tools_node_protoc_ts
yarn add @grpc/grpc-js
yarn add -D grpc-tools grpc_tools_node_protoc_ts

PROTO_DEST=../genproto

# JavaScript code generation
yarn run grpc_tools_node_protoc \
--js_out=import_style=commonjs,binary:${PROTO_DEST} \
--grpc_out=${PROTO_DEST} \
--grpc_out=grpc_js:${PROTO_DEST} \
--plugin=protoc-gen-grpc=./node_modules/.bin/grpc_tools_node_protoc_plugin \
-I /proto-common:/proto \
$FILES
Expand Down
8 changes: 4 additions & 4 deletions node/account/v4/account_service_grpc_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface IAccountService extends grpc.ServiceDefinition<grpc.UntypedServiceImpl
}

interface IAccountService_ICreateAccount extends grpc.MethodDefinition<account_v4_account_service_pb.CreateAccountRequest, account_v4_account_service_pb.CreateAccountResponse> {
path: string; // "/kin.agora.account.v4.Account/CreateAccount"
path: "/kin.agora.account.v4.Account/CreateAccount";
requestStream: false;
responseStream: false;
requestSerialize: grpc.serialize<account_v4_account_service_pb.CreateAccountRequest>;
Expand All @@ -26,7 +26,7 @@ interface IAccountService_ICreateAccount extends grpc.MethodDefinition<account_v
responseDeserialize: grpc.deserialize<account_v4_account_service_pb.CreateAccountResponse>;
}
interface IAccountService_IGetAccountInfo extends grpc.MethodDefinition<account_v4_account_service_pb.GetAccountInfoRequest, account_v4_account_service_pb.GetAccountInfoResponse> {
path: string; // "/kin.agora.account.v4.Account/GetAccountInfo"
path: "/kin.agora.account.v4.Account/GetAccountInfo";
requestStream: false;
responseStream: false;
requestSerialize: grpc.serialize<account_v4_account_service_pb.GetAccountInfoRequest>;
Expand All @@ -35,7 +35,7 @@ interface IAccountService_IGetAccountInfo extends grpc.MethodDefinition<account_
responseDeserialize: grpc.deserialize<account_v4_account_service_pb.GetAccountInfoResponse>;
}
interface IAccountService_IResolveTokenAccounts extends grpc.MethodDefinition<account_v4_account_service_pb.ResolveTokenAccountsRequest, account_v4_account_service_pb.ResolveTokenAccountsResponse> {
path: string; // "/kin.agora.account.v4.Account/ResolveTokenAccounts"
path: "/kin.agora.account.v4.Account/ResolveTokenAccounts";
requestStream: false;
responseStream: false;
requestSerialize: grpc.serialize<account_v4_account_service_pb.ResolveTokenAccountsRequest>;
Expand All @@ -44,7 +44,7 @@ interface IAccountService_IResolveTokenAccounts extends grpc.MethodDefinition<ac
responseDeserialize: grpc.deserialize<account_v4_account_service_pb.ResolveTokenAccountsResponse>;
}
interface IAccountService_IGetEvents extends grpc.MethodDefinition<account_v4_account_service_pb.GetEventsRequest, account_v4_account_service_pb.Events> {
path: string; // "/kin.agora.account.v4.Account/GetEvents"
path: "/kin.agora.account.v4.Account/GetEvents";
requestStream: false;
responseStream: true;
requestSerialize: grpc.serialize<account_v4_account_service_pb.GetEventsRequest>;
Expand Down
2 changes: 1 addition & 1 deletion node/account/v4/account_service_grpc_pb.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// GENERATED CODE -- DO NOT EDIT!

'use strict';
var grpc = require('grpc');
var grpc = require('@grpc/grpc-js');
var account_v4_account_service_pb = require('../../account/v4/account_service_pb.js');
var validate_validate_pb = require('../../validate/validate_pb.js');
var common_v4_model_pb = require('../../common/v4/model_pb.js');
Expand Down
37 changes: 3 additions & 34 deletions node/account/v4/account_service_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,19 @@ export class AccountInfo extends jspb.Message {
clearAccountId(): void;
getAccountId(): common_v4_model_pb.SolanaAccountId | undefined;
setAccountId(value?: common_v4_model_pb.SolanaAccountId): AccountInfo;

getBalance(): string;
setBalance(value: string): AccountInfo;


hasOwner(): boolean;
clearOwner(): void;
getOwner(): common_v4_model_pb.SolanaAccountId | undefined;
setOwner(value?: common_v4_model_pb.SolanaAccountId): AccountInfo;


hasCloseAuthority(): boolean;
clearCloseAuthority(): void;
getCloseAuthority(): common_v4_model_pb.SolanaAccountId | undefined;
setCloseAuthority(value?: common_v4_model_pb.SolanaAccountId): AccountInfo;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): AccountInfo.AsObject;
static toObject(includeInstance: boolean, msg: AccountInfo): AccountInfo.AsObject;
Expand All @@ -56,11 +52,9 @@ export class CreateAccountRequest extends jspb.Message {
clearTransaction(): void;
getTransaction(): common_v4_model_pb.Transaction | undefined;
setTransaction(value?: common_v4_model_pb.Transaction): CreateAccountRequest;

getCommitment(): common_v4_model_pb.Commitment;
setCommitment(value: common_v4_model_pb.Commitment): CreateAccountRequest;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): CreateAccountRequest.AsObject;
static toObject(includeInstance: boolean, msg: CreateAccountRequest): CreateAccountRequest.AsObject;
Expand All @@ -82,13 +76,11 @@ export class CreateAccountResponse extends jspb.Message {
getResult(): CreateAccountResponse.Result;
setResult(value: CreateAccountResponse.Result): CreateAccountResponse;


hasAccountInfo(): boolean;
clearAccountInfo(): void;
getAccountInfo(): AccountInfo | undefined;
setAccountInfo(value?: AccountInfo): CreateAccountResponse;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): CreateAccountResponse.AsObject;
static toObject(includeInstance: boolean, msg: CreateAccountResponse): CreateAccountResponse.AsObject;
Expand Down Expand Up @@ -120,11 +112,9 @@ export class GetAccountInfoRequest extends jspb.Message {
clearAccountId(): void;
getAccountId(): common_v4_model_pb.SolanaAccountId | undefined;
setAccountId(value?: common_v4_model_pb.SolanaAccountId): GetAccountInfoRequest;

getCommitment(): common_v4_model_pb.Commitment;
setCommitment(value: common_v4_model_pb.Commitment): GetAccountInfoRequest;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GetAccountInfoRequest.AsObject;
static toObject(includeInstance: boolean, msg: GetAccountInfoRequest): GetAccountInfoRequest.AsObject;
Expand All @@ -146,13 +136,11 @@ export class GetAccountInfoResponse extends jspb.Message {
getResult(): GetAccountInfoResponse.Result;
setResult(value: GetAccountInfoResponse.Result): GetAccountInfoResponse;


hasAccountInfo(): boolean;
clearAccountInfo(): void;
getAccountInfo(): AccountInfo | undefined;
setAccountInfo(value?: AccountInfo): GetAccountInfoResponse;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GetAccountInfoResponse.AsObject;
static toObject(includeInstance: boolean, msg: GetAccountInfoResponse): GetAccountInfoResponse.AsObject;
Expand Down Expand Up @@ -182,11 +170,9 @@ export class ResolveTokenAccountsRequest extends jspb.Message {
clearAccountId(): void;
getAccountId(): common_v4_model_pb.SolanaAccountId | undefined;
setAccountId(value?: common_v4_model_pb.SolanaAccountId): ResolveTokenAccountsRequest;

getIncludeAccountInfo(): boolean;
setIncludeAccountInfo(value: boolean): ResolveTokenAccountsRequest;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ResolveTokenAccountsRequest.AsObject;
static toObject(includeInstance: boolean, msg: ResolveTokenAccountsRequest): ResolveTokenAccountsRequest.AsObject;
Expand All @@ -209,13 +195,11 @@ export class ResolveTokenAccountsResponse extends jspb.Message {
getTokenAccountsList(): Array<common_v4_model_pb.SolanaAccountId>;
setTokenAccountsList(value: Array<common_v4_model_pb.SolanaAccountId>): ResolveTokenAccountsResponse;
addTokenAccounts(value?: common_v4_model_pb.SolanaAccountId, index?: number): common_v4_model_pb.SolanaAccountId;

clearTokenAccountInfosList(): void;
getTokenAccountInfosList(): Array<AccountInfo>;
setTokenAccountInfosList(value: Array<AccountInfo>): ResolveTokenAccountsResponse;
addTokenAccountInfos(value?: AccountInfo, index?: number): AccountInfo;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): ResolveTokenAccountsResponse.AsObject;
static toObject(includeInstance: boolean, msg: ResolveTokenAccountsResponse): ResolveTokenAccountsResponse.AsObject;
Expand All @@ -240,7 +224,6 @@ export class GetEventsRequest extends jspb.Message {
getAccountId(): common_v4_model_pb.SolanaAccountId | undefined;
setAccountId(value?: common_v4_model_pb.SolanaAccountId): GetEventsRequest;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): GetEventsRequest.AsObject;
static toObject(includeInstance: boolean, msg: GetEventsRequest): GetEventsRequest.AsObject;
Expand All @@ -260,13 +243,11 @@ export namespace GetEventsRequest {
export class Events extends jspb.Message {
getResult(): Events.Result;
setResult(value: Events.Result): Events;

clearEventsList(): void;
getEventsList(): Array<Event>;
setEventsList(value: Array<Event>): Events;
addEvents(value?: Event, index?: number): Event;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): Events.AsObject;
static toObject(includeInstance: boolean, msg: Events): Events.AsObject;
Expand Down Expand Up @@ -297,19 +278,16 @@ export class Event extends jspb.Message {
getAccountUpdateEvent(): AccountUpdateEvent | undefined;
setAccountUpdateEvent(value?: AccountUpdateEvent): Event;


hasTransactionEvent(): boolean;
clearTransactionEvent(): void;
getTransactionEvent(): TransactionEvent | undefined;
setTransactionEvent(value?: TransactionEvent): Event;


hasSimulationEvent(): boolean;
clearSimulationEvent(): void;
getSimulationEvent(): SimulationEvent | undefined;
setSimulationEvent(value?: SimulationEvent): Event;


getTypeCase(): Event.TypeCase;

serializeBinary(): Uint8Array;
Expand All @@ -331,13 +309,9 @@ export namespace Event {

export enum TypeCase {
TYPE_NOT_SET = 0,

ACCOUNT_UPDATE_EVENT = 1,

TRANSACTION_EVENT = 2,

SIMULATION_EVENT = 3,

ACCOUNT_UPDATE_EVENT = 1,
TRANSACTION_EVENT = 2,
SIMULATION_EVENT = 3,
}

}
Expand All @@ -349,7 +323,6 @@ export class AccountUpdateEvent extends jspb.Message {
getAccountInfo(): AccountInfo | undefined;
setAccountInfo(value?: AccountInfo): AccountUpdateEvent;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): AccountUpdateEvent.AsObject;
static toObject(includeInstance: boolean, msg: AccountUpdateEvent): AccountUpdateEvent.AsObject;
Expand All @@ -373,13 +346,11 @@ export class TransactionEvent extends jspb.Message {
getTransaction(): common_v4_model_pb.Transaction | undefined;
setTransaction(value?: common_v4_model_pb.Transaction): TransactionEvent;


hasTransactionError(): boolean;
clearTransactionError(): void;
getTransactionError(): common_v4_model_pb.TransactionError | undefined;
setTransactionError(value?: common_v4_model_pb.TransactionError): TransactionEvent;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): TransactionEvent.AsObject;
static toObject(includeInstance: boolean, msg: TransactionEvent): TransactionEvent.AsObject;
Expand All @@ -404,13 +375,11 @@ export class SimulationEvent extends jspb.Message {
getTransaction(): common_v4_model_pb.Transaction | undefined;
setTransaction(value?: common_v4_model_pb.Transaction): SimulationEvent;


hasTransactionError(): boolean;
clearTransactionError(): void;
getTransactionError(): common_v4_model_pb.TransactionError | undefined;
setTransactionError(value?: common_v4_model_pb.TransactionError): SimulationEvent;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): SimulationEvent.AsObject;
static toObject(includeInstance: boolean, msg: SimulationEvent): SimulationEvent.AsObject;
Expand Down
3 changes: 3 additions & 0 deletions node/account/v4/account_service_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck

var jspb = require('google-protobuf');
var goog = jspb;
Expand Down
2 changes: 1 addition & 1 deletion node/airdrop/v4/airdrop_service_grpc_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface IAirdropService extends grpc.ServiceDefinition<grpc.UntypedServiceImpl
}

interface IAirdropService_IRequestAirdrop extends grpc.MethodDefinition<airdrop_v4_airdrop_service_pb.RequestAirdropRequest, airdrop_v4_airdrop_service_pb.RequestAirdropResponse> {
path: string; // "/kin.agora.airdrop.v4.Airdrop/RequestAirdrop"
path: "/kin.agora.airdrop.v4.Airdrop/RequestAirdrop";
requestStream: false;
responseStream: false;
requestSerialize: grpc.serialize<airdrop_v4_airdrop_service_pb.RequestAirdropRequest>;
Expand Down
2 changes: 1 addition & 1 deletion node/airdrop/v4/airdrop_service_grpc_pb.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// GENERATED CODE -- DO NOT EDIT!

'use strict';
var grpc = require('grpc');
var grpc = require('@grpc/grpc-js');
var airdrop_v4_airdrop_service_pb = require('../../airdrop/v4/airdrop_service_pb.js');
var validate_validate_pb = require('../../validate/validate_pb.js');
var common_v4_model_pb = require('../../common/v4/model_pb.js');
Expand Down
5 changes: 0 additions & 5 deletions node/airdrop/v4/airdrop_service_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@ export class RequestAirdropRequest extends jspb.Message {
clearAccountId(): void;
getAccountId(): common_v4_model_pb.SolanaAccountId | undefined;
setAccountId(value?: common_v4_model_pb.SolanaAccountId): RequestAirdropRequest;

getQuarks(): number;
setQuarks(value: number): RequestAirdropRequest;

getCommitment(): common_v4_model_pb.Commitment;
setCommitment(value: common_v4_model_pb.Commitment): RequestAirdropRequest;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): RequestAirdropRequest.AsObject;
static toObject(includeInstance: boolean, msg: RequestAirdropRequest): RequestAirdropRequest.AsObject;
Expand All @@ -44,13 +41,11 @@ export class RequestAirdropResponse extends jspb.Message {
getResult(): RequestAirdropResponse.Result;
setResult(value: RequestAirdropResponse.Result): RequestAirdropResponse;


hasSignature(): boolean;
clearSignature(): void;
getSignature(): common_v4_model_pb.TransactionSignature | undefined;
setSignature(value?: common_v4_model_pb.TransactionSignature): RequestAirdropResponse;


serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): RequestAirdropResponse.AsObject;
static toObject(includeInstance: boolean, msg: RequestAirdropResponse): RequestAirdropResponse.AsObject;
Expand Down
3 changes: 3 additions & 0 deletions node/airdrop/v4/airdrop_service_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck

var jspb = require('google-protobuf');
var goog = jspb;
Expand Down
Loading