-
Notifications
You must be signed in to change notification settings - Fork 4
Adding aptos capability #296
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
Open
yashnevatia
wants to merge
4
commits into
main
Choose a base branch
from
aptos-service
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
db5a4ed
Adding aptos capability
yashnevatia 52dae36
Auto-fix: buf format, gofmt, go generate, go mod tidy
app-token-issuer-engops[bot] 7cc66f3
update types
yashnevatia a1838fd
Merge branch 'aptos-service' of ssh://github.com/smartcontractkit/cha…
yashnevatia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,202 @@ | ||
| syntax = "proto3"; | ||
| package capabilities.blockchain.aptos.v1alpha; | ||
|
|
||
| import "sdk/v1alpha/sdk.proto"; | ||
| import "tools/generator/v1alpha/cre_metadata.proto"; | ||
|
|
||
| // Transaction execution status returned by the forwarder. | ||
| enum TxStatus { | ||
| TX_STATUS_FATAL = 0; // unrecoverable failure | ||
| TX_STATUS_ABORTED = 1; // not executed / dropped | ||
| TX_STATUS_SUCCESS = 2; // executed successfully | ||
| } | ||
|
|
||
| // ========== AccountAPTBalance ========== | ||
|
|
||
| message AccountAPTBalanceRequest { | ||
| bytes address = 1; // 32-byte address | ||
| } | ||
|
|
||
| message AccountAPTBalanceReply { | ||
| uint64 value = 1; | ||
| } | ||
|
|
||
| // ========== View ========== | ||
|
|
||
| message ViewRequest { | ||
| ViewPayload payload = 1; | ||
| } | ||
|
|
||
| message ViewReply { | ||
| bytes data = 1; | ||
| } | ||
|
|
||
| message ViewPayload { | ||
| ModuleID module = 1; | ||
| string function = 2; | ||
| repeated TypeTag arg_types = 3; | ||
| repeated bytes args = 4; | ||
| } | ||
|
|
||
| message ModuleID { | ||
| bytes address = 1; // 32-byte address | ||
| string name = 2; | ||
| } | ||
|
|
||
| message TypeTag { | ||
| TypeTagType type = 1; | ||
| oneof value { | ||
| VectorTag vector = 2; | ||
| StructTag struct = 3; | ||
| GenericTag generic = 4; | ||
| } | ||
| } | ||
|
|
||
| enum TypeTagType { | ||
| TYPE_TAG_BOOL = 0; | ||
| TYPE_TAG_U8 = 1; | ||
| TYPE_TAG_U16 = 2; | ||
| TYPE_TAG_U32 = 3; | ||
| TYPE_TAG_U64 = 4; | ||
| TYPE_TAG_U128 = 5; | ||
| TYPE_TAG_U256 = 6; | ||
| TYPE_TAG_ADDRESS = 7; | ||
| TYPE_TAG_SIGNER = 8; | ||
| TYPE_TAG_VECTOR = 9; | ||
| TYPE_TAG_STRUCT = 10; | ||
| TYPE_TAG_GENERIC = 11; | ||
| } | ||
|
|
||
| message VectorTag { | ||
| TypeTag element_type = 1; | ||
| } | ||
|
|
||
| message StructTag { | ||
| bytes address = 1; // 32-byte address | ||
| string module = 2; | ||
| string name = 3; | ||
| repeated TypeTag type_params = 4; | ||
| } | ||
|
|
||
| message GenericTag { | ||
| uint32 index = 1; | ||
| } | ||
|
|
||
| // ========== EventsByHandle ========== | ||
|
|
||
| message EventsByHandleRequest { | ||
| bytes account = 1; // 32-byte address | ||
| string event_handle = 2; // Event handle struct tag | ||
| string field_name = 3; // Field in the event handle struct | ||
| optional uint64 start = 4; // Starting sequence number | ||
| optional uint64 limit = 5; // Number of events to return (default 100) | ||
| } | ||
|
|
||
| message EventsByHandleReply { | ||
| repeated Event events = 1; | ||
| } | ||
|
|
||
| message Event { | ||
| uint64 version = 1; // Block version of the event | ||
| string type = 2; // Fully qualified name e.g. 0x1::coin::WithdrawEvent | ||
| optional GUID guid = 3; // Unique identifier (V1 events only) | ||
| uint64 sequence_number = 4; // Sequence number (V1 events only) | ||
| bytes data = 5; // Event data as raw bytes | ||
| } | ||
|
|
||
| message GUID { | ||
| uint64 creation_number = 1; // Number of the GUID | ||
| bytes account_address = 2; // 32-byte account address of creator | ||
| } | ||
|
|
||
| // ========== TransactionByHash ========== | ||
|
|
||
| message TransactionByHashRequest { | ||
| string hash = 1; // Transaction hash (hex string with 0x prefix) | ||
| } | ||
|
|
||
| message TransactionByHashReply { | ||
| optional Transaction transaction = 1; | ||
| } | ||
|
|
||
| enum TransactionVariant { | ||
| TRANSACTION_VARIANT_PENDING = 0; | ||
| TRANSACTION_VARIANT_USER = 1; | ||
| TRANSACTION_VARIANT_GENESIS = 2; | ||
| TRANSACTION_VARIANT_BLOCK_METADATA = 3; | ||
| TRANSACTION_VARIANT_BLOCK_EPILOGUE = 4; | ||
| TRANSACTION_VARIANT_STATE_CHECKPOINT = 5; | ||
| TRANSACTION_VARIANT_VALIDATOR = 6; | ||
| TRANSACTION_VARIANT_UNKNOWN = 7; | ||
| } | ||
|
|
||
| message Transaction { | ||
| TransactionVariant type = 1; | ||
| string hash = 2; | ||
| optional uint64 version = 3; // nil for pending transactions | ||
| optional bool success = 4; // nil for pending/genesis transactions | ||
| bytes data = 5; // Raw transaction data | ||
| } | ||
|
|
||
| // ========== SubmitTransaction ========== | ||
|
|
||
| message SubmitTransactionRequest { | ||
| ModuleID receiver_module_id = 1; | ||
| bytes encoded_payload = 2; | ||
| optional GasConfig gas_config = 3; | ||
| } | ||
|
|
||
| message SubmitTransactionReply { | ||
| TxStatus tx_status = 1; | ||
| string tx_hash = 2; | ||
| string tx_idempotency_key = 3; | ||
| } | ||
|
|
||
| message GasConfig { | ||
| uint64 max_gas_amount = 1; // Maximum gas units willing to pay | ||
| uint64 gas_unit_price = 2; // Price per gas unit in octas | ||
| } | ||
|
|
||
| // ========== WriteReport ========== | ||
|
|
||
| message WriteReportRequest { | ||
| bytes receiver = 1; // 32-byte Aptos account address of the receiver module | ||
| optional GasConfig gas_config = 2; // optional gas configuration | ||
| sdk.v1alpha.ReportResponse report = 3; // signed report from consensus | ||
| } | ||
|
|
||
| message WriteReportReply { | ||
| TxStatus tx_status = 1; | ||
| optional string tx_hash = 2; // transaction hash (hex string with 0x prefix) | ||
| optional uint64 transaction_fee = 3; // gas used in octas | ||
| optional string error_message = 4; | ||
| } | ||
|
|
||
| // ========== Service ========== | ||
|
|
||
| service Client { | ||
| option (tools.generator.v1alpha.capability) = { | ||
| mode: MODE_DON | ||
| capability_id: "aptos@1.0.0" | ||
| labels: { | ||
| // from https://github.com/smartcontractkit/chain-selectors/blob/main/selectors_aptos.yml | ||
| key: "ChainSelector" | ||
| value: { | ||
| uint64_label: { | ||
| defaults: [ | ||
| { | ||
| key: "aptos-mainnet" | ||
| value: 4741433654826277614 | ||
| }, | ||
| { | ||
| key: "aptos-testnet" | ||
| value: 743186221051783445 | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| rpc WriteReport(WriteReportRequest) returns (WriteReportReply); | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we drop one of the
Types? If not, could we substitute another word for one, e.g.Kind?