github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-core-master/families/smallbank/protos/smallbank.proto (about) 1 // Copyright 2017 Intel Corporation 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 // ----------------------------------------------------------------------------- 15 16 syntax = "proto3"; 17 option go_package = "smallbank_pb2"; 18 19 message Account { 20 // Customer ID 21 uint32 customer_id = 1; 22 23 // Customer Name 24 string customer_name = 2; 25 26 // Savings Balance (in cents to avoid float) 27 uint32 savings_balance = 3; 28 29 // Checking Balance (in cents to avoid float) 30 uint32 checking_balance = 4; 31 } 32 33 message SmallbankTransactionPayload { 34 message CreateAccountTransactionData { 35 // The CreateAccountTransaction creates an account 36 37 // Customer ID 38 uint32 customer_id = 1; 39 40 // Customer Name 41 string customer_name = 2; 42 43 // Initial Savings Balance (in cents to avoid float) 44 uint32 initial_savings_balance = 3; 45 46 // Initial Checking Balance (in cents to avoid float) 47 uint32 initial_checking_balance = 4; 48 } 49 50 message DepositCheckingTransactionData { 51 // The DepositCheckingTransction adds an amount to the customer's 52 // checking account. 53 54 // Customer ID 55 uint32 customer_id = 1; 56 57 // Amount 58 uint32 amount = 2; 59 } 60 61 message WriteCheckTransactionData { 62 // The WriteCheckTransaction removes an amount from the customer's 63 // checking account. 64 65 // Customer ID 66 uint32 customer_id = 1; 67 68 // Amount 69 uint32 amount = 2; 70 } 71 72 message TransactSavingsTransactionData { 73 // The TransactSavingsTransaction adds an amount to the customer's 74 // savings account. Amount may be a negative number. 75 76 // Customer ID 77 uint32 customer_id = 1; 78 79 // Amount 80 int32 amount = 2; 81 } 82 83 message SendPaymentTransactionData { 84 // The SendPaymentTransaction transfers an amount from one customer's 85 // checking account to another customer's checking account. 86 87 // Source Customer ID 88 uint32 source_customer_id = 1; 89 90 // Destination Customer ID 91 uint32 dest_customer_id = 2; 92 93 // Amount 94 uint32 amount = 3; 95 } 96 97 message AmalgamateTransactionData { 98 // The AmalgamateTransaction transfers the entire contents of one 99 // customer's savings account into another customer's checking 100 // account. 101 102 // Source Customer ID 103 uint32 source_customer_id = 1; 104 105 // Destination Customer ID 106 uint32 dest_customer_id = 2; 107 } 108 109 enum PayloadType { 110 PAYLOAD_TYPE_UNSET = 0; 111 CREATE_ACCOUNT = 1; 112 DEPOSIT_CHECKING = 2; 113 WRITE_CHECK = 3; 114 TRANSACT_SAVINGS = 4; 115 SEND_PAYMENT = 5; 116 AMALGAMATE = 6; 117 } 118 119 PayloadType payload_type = 1; 120 CreateAccountTransactionData create_account = 2; 121 DepositCheckingTransactionData deposit_checking = 3; 122 WriteCheckTransactionData write_check = 4; 123 TransactSavingsTransactionData transact_savings = 5; 124 SendPaymentTransactionData send_payment = 6; 125 AmalgamateTransactionData amalgamate = 7; 126 }