2021-05-12 22:57:08 -07:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package publicrpc.v1;
|
|
|
|
|
2021-08-26 01:35:09 -07:00
|
|
|
option go_package = "github.com/certusone/wormhole/node/pkg/proto/publicrpc/v1;publicrpcv1";
|
2021-05-12 22:57:08 -07:00
|
|
|
|
2021-07-30 15:12:28 -07:00
|
|
|
import "gossip/v1/gossip.proto";
|
2021-07-30 16:18:53 -07:00
|
|
|
import "google/api/annotations.proto";
|
2021-05-12 22:57:08 -07:00
|
|
|
|
2021-08-21 15:34:58 -07:00
|
|
|
enum ChainID {
|
|
|
|
CHAIN_ID_UNSPECIFIED = 0;
|
2021-07-30 17:25:22 -07:00
|
|
|
CHAIN_ID_SOLANA = 1;
|
|
|
|
CHAIN_ID_ETHEREUM = 2;
|
|
|
|
CHAIN_ID_TERRA = 3;
|
|
|
|
CHAIN_ID_BSC = 4;
|
2021-10-18 08:53:13 -07:00
|
|
|
CHAIN_ID_POLYGON = 5;
|
2021-12-09 13:40:55 -08:00
|
|
|
CHAIN_ID_AVALANCHE = 6;
|
2021-12-20 11:40:58 -08:00
|
|
|
CHAIN_ID_OASIS = 7;
|
2021-12-22 08:22:04 -08:00
|
|
|
CHAIN_ID_ALGORAND = 8;
|
2022-03-15 07:41:10 -07:00
|
|
|
CHAIN_ID_AURORA = 9;
|
2022-02-02 09:50:10 -08:00
|
|
|
CHAIN_ID_FANTOM = 10;
|
2022-03-03 13:40:32 -08:00
|
|
|
CHAIN_ID_KARURA = 11;
|
|
|
|
CHAIN_ID_ACALA = 12;
|
2022-04-04 15:11:03 -07:00
|
|
|
CHAIN_ID_KLAYTN = 13;
|
2022-04-28 09:20:38 -07:00
|
|
|
CHAIN_ID_CELO = 14;
|
2022-04-29 14:21:51 -07:00
|
|
|
CHAIN_ID_NEAR = 15;
|
2022-05-10 08:23:07 -07:00
|
|
|
CHAIN_ID_MOONBEAM = 16;
|
2022-06-14 07:22:49 -07:00
|
|
|
CHAIN_ID_NEON = 17;
|
2022-06-16 12:17:43 -07:00
|
|
|
CHAIN_ID_TERRA2 = 18;
|
2022-07-06 07:19:57 -07:00
|
|
|
CHAIN_ID_INJECTIVE = 19;
|
2022-07-15 06:03:03 -07:00
|
|
|
CHAIN_ID_OSMOSIS = 20;
|
|
|
|
CHAIN_ID_SUI = 21;
|
|
|
|
CHAIN_ID_APTOS = 22;
|
2022-07-19 11:05:40 -07:00
|
|
|
CHAIN_ID_ARBITRUM = 23;
|
|
|
|
CHAIN_ID_OPTIMISM = 24;
|
|
|
|
CHAIN_ID_GNOSIS = 25;
|
2022-07-28 10:30:00 -07:00
|
|
|
CHAIN_ID_PYTHNET = 26;
|
2022-10-12 11:10:13 -07:00
|
|
|
CHAIN_ID_XPLA = 28;
|
2022-11-15 06:04:53 -08:00
|
|
|
CHAIN_ID_BTC = 29;
|
2021-07-30 17:25:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// MessageID is a VAA's globally unique identifier (see data availability design document).
|
|
|
|
message MessageID {
|
|
|
|
// Emitter chain ID.
|
2021-08-21 15:34:58 -07:00
|
|
|
ChainID emitter_chain = 1;
|
2021-08-08 02:38:21 -07:00
|
|
|
// Hex-encoded (without leading 0x) emitter address.
|
2021-07-30 17:25:22 -07:00
|
|
|
string emitter_address = 2;
|
|
|
|
// Sequence number for (emitter_chain, emitter_address).
|
2021-10-04 05:04:23 -07:00
|
|
|
uint64 sequence = 3;
|
2021-07-30 17:25:22 -07:00
|
|
|
}
|
|
|
|
|
2022-09-09 10:30:22 -07:00
|
|
|
message BatchID {
|
|
|
|
// Emitter chain ID.
|
|
|
|
ChainID emitter_chain = 1;
|
2022-11-09 08:39:57 -08:00
|
|
|
// Transaction's unique identifier.
|
|
|
|
bytes tx_id = 2;
|
|
|
|
// Nonce of the messages in the batch.
|
|
|
|
uint32 nonce = 3;
|
2022-09-09 10:30:22 -07:00
|
|
|
}
|
|
|
|
|
2021-08-21 15:34:58 -07:00
|
|
|
// PublicRPCService service exposes endpoints to be consumed externally; GUIs, historical record keeping, etc.
|
|
|
|
service PublicRPCService {
|
2021-08-03 11:03:00 -07:00
|
|
|
// GetLastHeartbeats returns the last heartbeat received for each guardian node in the
|
|
|
|
// node's active guardian set. Heartbeats received by nodes not in the guardian set are ignored.
|
|
|
|
// The heartbeat value is null if no heartbeat has yet been received.
|
2021-08-21 15:34:58 -07:00
|
|
|
rpc GetLastHeartbeats (GetLastHeartbeatsRequest) returns (GetLastHeartbeatsResponse) {
|
2021-08-03 11:03:00 -07:00
|
|
|
option (google.api.http) = {
|
|
|
|
get: "/v1/heartbeats"
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-07-30 17:25:22 -07:00
|
|
|
rpc GetSignedVAA (GetSignedVAARequest) returns (GetSignedVAAResponse) {
|
|
|
|
option (google.api.http) = {
|
|
|
|
get: "/v1/signed_vaa/{message_id.emitter_chain}/{message_id.emitter_address}/{message_id.sequence}"
|
|
|
|
};
|
|
|
|
}
|
2021-08-10 07:31:56 -07:00
|
|
|
|
2022-09-09 10:30:22 -07:00
|
|
|
rpc GetSignedBatchVAA (GetSignedBatchVAARequest) returns (GetSignedBatchVAAResponse) {
|
|
|
|
option (google.api.http) = {
|
2022-11-09 08:39:57 -08:00
|
|
|
get: "/v1/signed_batch_vaa/{batch_id.emitter_chain}/{batch_id.tx_id}/{batch_id.nonce}"
|
2022-09-09 10:30:22 -07:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-08-10 07:31:56 -07:00
|
|
|
rpc GetCurrentGuardianSet (GetCurrentGuardianSetRequest) returns (GetCurrentGuardianSetResponse) {
|
|
|
|
option (google.api.http) = {
|
|
|
|
get: "/v1/guardianset/current"
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2022-07-19 11:08:06 -07:00
|
|
|
rpc GovernorGetAvailableNotionalByChain (GovernorGetAvailableNotionalByChainRequest) returns (GovernorGetAvailableNotionalByChainResponse) {
|
|
|
|
option (google.api.http) = {
|
|
|
|
get: "/v1/governor/available_notional_by_chain"
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
rpc GovernorGetEnqueuedVAAs (GovernorGetEnqueuedVAAsRequest) returns (GovernorGetEnqueuedVAAsResponse) {
|
|
|
|
option (google.api.http) = {
|
|
|
|
get: "/v1/governor/enqueued_vaas"
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2022-08-04 09:51:04 -07:00
|
|
|
rpc GovernorIsVAAEnqueued (GovernorIsVAAEnqueuedRequest) returns (GovernorIsVAAEnqueuedResponse) {
|
|
|
|
option (google.api.http) = {
|
|
|
|
get: "/v1/governor/is_vaa_enqueued/{message_id.emitter_chain}/{message_id.emitter_address}/{message_id.sequence}"
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2022-07-19 11:08:06 -07:00
|
|
|
rpc GovernorGetTokenList (GovernorGetTokenListRequest) returns (GovernorGetTokenListResponse) {
|
|
|
|
option (google.api.http) = {
|
|
|
|
get: "/v1/governor/token_list"
|
|
|
|
};
|
2022-09-09 10:30:22 -07:00
|
|
|
}
|
2022-07-19 11:08:06 -07:00
|
|
|
|
2021-05-12 22:57:08 -07:00
|
|
|
}
|
|
|
|
|
2021-07-30 17:25:22 -07:00
|
|
|
message GetSignedVAARequest {
|
|
|
|
MessageID message_id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetSignedVAAResponse {
|
|
|
|
bytes vaa_bytes = 1;
|
|
|
|
}
|
2021-08-03 11:03:00 -07:00
|
|
|
|
2022-09-09 10:30:22 -07:00
|
|
|
message GetSignedBatchVAARequest {
|
|
|
|
BatchID batch_id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetSignedBatchVAAResponse {
|
2022-11-09 08:39:57 -08:00
|
|
|
gossip.v1.SignedBatchVAAWithQuorum signed_batch_vaa = 1;
|
2022-09-09 10:30:22 -07:00
|
|
|
}
|
|
|
|
|
2021-08-21 15:34:58 -07:00
|
|
|
message GetLastHeartbeatsRequest {
|
2021-08-03 11:03:00 -07:00
|
|
|
}
|
|
|
|
|
2021-08-21 15:34:58 -07:00
|
|
|
message GetLastHeartbeatsResponse {
|
2021-08-08 02:38:21 -07:00
|
|
|
message Entry {
|
|
|
|
// Verified, hex-encoded (with leading 0x) guardian address. This is the guardian address
|
|
|
|
// which signed this heartbeat. The GuardianAddr field inside the heartbeat
|
|
|
|
// is NOT verified - remote nodes can put arbitrary data in it.
|
|
|
|
string verified_guardian_addr = 1;
|
|
|
|
|
|
|
|
// Base58-encoded libp2p node address that sent this heartbeat, used to
|
|
|
|
// distinguish between multiple nodes running for the same guardian.
|
|
|
|
string p2p_node_addr = 2;
|
|
|
|
|
|
|
|
// Raw heartbeat received from the network. Data is only as trusted
|
|
|
|
// as the guardian node that sent it - none of the fields are verified.
|
|
|
|
gossip.v1.Heartbeat raw_heartbeat = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
repeated Entry entries = 1;
|
2021-08-03 11:03:00 -07:00
|
|
|
}
|
2021-08-10 07:31:56 -07:00
|
|
|
|
|
|
|
message GetCurrentGuardianSetRequest {
|
|
|
|
}
|
|
|
|
|
|
|
|
message GetCurrentGuardianSetResponse {
|
|
|
|
GuardianSet guardian_set = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message GuardianSet {
|
|
|
|
// Guardian set index
|
|
|
|
uint32 index = 1;
|
|
|
|
// List of guardian addresses as human-readable hex-encoded (leading 0x) addresses.
|
|
|
|
repeated string addresses = 2;
|
|
|
|
}
|
2022-07-19 11:08:06 -07:00
|
|
|
|
|
|
|
message GovernorGetAvailableNotionalByChainRequest {
|
|
|
|
}
|
|
|
|
|
|
|
|
message GovernorGetAvailableNotionalByChainResponse {
|
|
|
|
message Entry {
|
|
|
|
uint32 chain_id = 1;
|
|
|
|
uint64 remaining_available_notional = 2;
|
|
|
|
uint64 notional_limit = 3;
|
2022-08-30 09:28:18 -07:00
|
|
|
uint64 big_transaction_size = 4;
|
2022-07-19 11:08:06 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// There is an entry for each chain that is being governed.
|
|
|
|
// Chains that are not being governed are not listed, and assumed to be unlimited.
|
|
|
|
repeated Entry entries = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message GovernorGetEnqueuedVAAsRequest {
|
|
|
|
}
|
|
|
|
|
|
|
|
message GovernorGetEnqueuedVAAsResponse {
|
|
|
|
message Entry {
|
2022-08-30 09:28:18 -07:00
|
|
|
uint32 emitter_chain = 1;
|
|
|
|
string emitter_address = 2; // human-readable hex-encoded (leading 0x)
|
|
|
|
uint64 sequence = 3;
|
|
|
|
uint32 release_time = 4;
|
|
|
|
uint64 notional_value = 5;
|
|
|
|
string tx_hash = 6;
|
2022-07-19 11:08:06 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// There is an entry for each enqueued vaa.
|
|
|
|
repeated Entry entries = 1;
|
|
|
|
}
|
|
|
|
|
2022-08-04 09:51:04 -07:00
|
|
|
message GovernorIsVAAEnqueuedRequest {
|
|
|
|
MessageID message_id = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message GovernorIsVAAEnqueuedResponse {
|
|
|
|
bool is_enqueued = 1;
|
|
|
|
}
|
|
|
|
|
2022-07-19 11:08:06 -07:00
|
|
|
message GovernorGetTokenListRequest {
|
|
|
|
}
|
|
|
|
|
|
|
|
message GovernorGetTokenListResponse {
|
|
|
|
message Entry {
|
|
|
|
uint32 origin_chain_id = 1;
|
|
|
|
string origin_address = 2; // human-readable hex-encoded (leading 0x)
|
|
|
|
float price = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
// There is an entry for each token that applies to the notional TVL calcuation.
|
|
|
|
repeated Entry entries = 1;
|
|
|
|
}
|