-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathTheOpenNetwork.proto
115 lines (87 loc) · 3.33 KB
/
TheOpenNetwork.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
// SPDX-License-Identifier: Apache-2.0
//
// Copyright © 2017 Trust Wallet.
syntax = "proto3";
package TW.TheOpenNetwork.Proto;
option java_package = "wallet.core.jni.proto";
import "Common.proto";
enum WalletVersion {
WALLET_V3_R1 = 0;
WALLET_V3_R2 = 1;
WALLET_V4_R2 = 2;
WALLET_V5_R1 = 3;
};
enum SendMode {
DEFAULT = 0;
PAY_FEES_SEPARATELY = 1;
IGNORE_ACTION_PHASE_ERRORS = 2;
DESTROY_ON_ZERO_BALANCE = 32;
ATTACH_ALL_INBOUND_MESSAGE_VALUE = 64;
ATTACH_ALL_CONTRACT_BALANCE = 128;
};
message Transfer {
// Recipient address
string dest = 1;
// Amount to send in nanotons
uint64 amount = 2;
// Send mode (optional, 0 by default)
// Learn more: https://ton.org/docs/develop/func/stdlib#send_raw_message
uint32 mode = 3;
// Transfer comment message (optional, empty by default)
// Ignored if `custom_payload` is specified
string comment = 4;
// If the address is bounceable
bool bounceable = 5;
// Optional raw one-cell BoC encoded in Base64.
// Can be used to deploy a smart contract.
string state_init = 6;
// One of the Transfer message payloads (optional).
oneof payload {
// Jetton transfer payload.
JettonTransfer jetton_transfer = 7;
// TON transfer with custom payload (contract call). Raw one-cell BoC encoded in Base64.
string custom_payload = 8;
}
}
message JettonTransfer {
// Arbitrary request number. Default is 0. Optional field.
uint64 query_id = 1;
// Amount of transferred jettons in elementary integer units. The real value transferred is jetton_amount multiplied by ten to the power of token decimal precision
uint64 jetton_amount = 2;
// Address of the new owner of the jettons.
string to_owner = 3;
// Address where to send a response with confirmation of a successful transfer and the rest of the incoming message Toncoins. Usually the sender should get back their toncoins.
string response_address = 4;
// Amount in nanotons to forward to recipient. Basically minimum amount - 1 nanoton should be used
uint64 forward_amount = 5;
// Optional raw one-cell BoC encoded in Base64.
// Can be used in the case of mintless jetton transfers.
string custom_payload = 6;
}
message SigningInput {
// The secret private key used for signing (32 bytes).
bytes private_key = 1;
// Public key of the signer (32 bytes). Used when transaction is going to be signed externally.
bytes public_key = 2;
// Up to 4 internal messages.
repeated Transfer messages = 3;
// Message counter (optional, 0 by default used for the first deploy)
// This field is required, because we need to protect the smart contract against "replay attacks"
// Learn more: https://ton.org/docs/develop/smart-contracts/guidelines/external-messages
uint32 sequence_number = 4;
// Expiration UNIX timestamp (optional, now() + 60 by default)
uint32 expire_at = 5;
// Wallet version
WalletVersion wallet_version = 6;
}
// Transaction signing output.
message SigningOutput {
// Signed and base64 encoded BOC message
string encoded = 1;
// Transaction Cell hash
bytes hash = 2;
// error code, 0 is ok, other codes will be treated as errors
Common.Proto.SigningError error = 3;
// error code description
string error_message = 4;
}