@dailydotdev/schema 0.2.7 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,7 +20,11 @@ declare enum TransferType {
20
20
  *
21
21
  * @generated from enum value: TRANSFER = 0;
22
22
  */
23
- TRANSFER = 0
23
+ TRANSFER = 0,
24
+ /**
25
+ * @generated from enum value: FEE = 1;
26
+ */
27
+ FEE = 1
24
28
  }
25
29
  /**
26
30
  * @generated from enum njord.transactions.EntityType
@@ -37,6 +41,27 @@ declare enum EntityType {
37
41
  */
38
42
  USER = 1
39
43
  }
44
+ /**
45
+ * @generated from enum njord.transactions.TransferStatus
46
+ */
47
+ declare enum TransferStatus {
48
+ /**
49
+ * @generated from enum value: SUCCESS = 0;
50
+ */
51
+ SUCCESS = 0,
52
+ /**
53
+ * Business logic failures
54
+ *
55
+ * @generated from enum value: INSUFFICIENT_FUNDS = 1;
56
+ */
57
+ INSUFFICIENT_FUNDS = 1,
58
+ /**
59
+ * Technical failures
60
+ *
61
+ * @generated from enum value: INTERNAL_ERROR = 100;
62
+ */
63
+ INTERNAL_ERROR = 100
64
+ }
40
65
  /**
41
66
  * @generated from message njord.transactions.TransferParticipant
42
67
  */
@@ -61,109 +86,124 @@ declare class TransferParticipant extends Message<TransferParticipant> {
61
86
  static equals(a: TransferParticipant | PlainMessage<TransferParticipant> | undefined, b: TransferParticipant | PlainMessage<TransferParticipant> | undefined): boolean;
62
87
  }
63
88
  /**
64
- * @generated from message njord.transactions.TransferRequest
89
+ * @generated from message njord.transactions.TransferFee
65
90
  */
66
- declare class TransferRequest extends Message<TransferRequest> {
91
+ declare class TransferFee extends Message<TransferFee> {
67
92
  /**
68
- * id to insure operation idempotency (UUID)
93
+ * e.g., 25 for 25% or 0.25 multiplier
69
94
  *
70
- * @generated from field: string idempotency_key = 1;
95
+ * @generated from field: int32 percentage = 1;
71
96
  */
72
- idempotencyKey: string;
97
+ percentage: number;
98
+ constructor(data?: PartialMessage<TransferFee>);
99
+ static readonly runtime: typeof proto3;
100
+ static readonly typeName = "njord.transactions.TransferFee";
101
+ static readonly fields: FieldList;
102
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TransferFee;
103
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TransferFee;
104
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TransferFee;
105
+ static equals(a: TransferFee | PlainMessage<TransferFee> | undefined, b: TransferFee | PlainMessage<TransferFee> | undefined): boolean;
106
+ }
107
+ /**
108
+ * @generated from message njord.transactions.Transfer
109
+ */
110
+ declare class Transfer extends Message<Transfer> {
73
111
  /**
74
112
  * user sending currency
75
113
  *
76
- * @generated from field: njord.transactions.TransferParticipant sender = 2;
114
+ * @generated from field: njord.transactions.TransferParticipant sender = 1;
77
115
  */
78
116
  sender?: TransferParticipant;
79
117
  /**
80
118
  * user receiving currency
81
119
  *
82
- * @generated from field: njord.transactions.TransferParticipant receiver = 3;
120
+ * @generated from field: njord.transactions.TransferParticipant receiver = 2;
83
121
  */
84
122
  receiver?: TransferParticipant;
85
123
  /**
86
- * @generated from field: njord.transactions.Currency currency = 4;
124
+ * @generated from field: njord.transactions.Currency currency = 3;
87
125
  */
88
126
  currency: Currency;
89
127
  /**
90
- * Amount of change in the balance (could be positive or negative)
128
+ * Amount transferred from sendr to receiver, always positive
91
129
  *
92
- * @generated from field: int64 amount = 5;
130
+ * @generated from field: int64 amount = 4;
93
131
  */
94
132
  amount: any;
95
133
  /**
96
134
  * Type of change (e.g., "deposit", "withdrawal"). It is not limited to above values and can be any kind of label, like "promotion_reward" or "admin_action".
97
135
  *
98
- * @generated from field: njord.transactions.TransferType transfer_type = 6;
136
+ * @generated from field: njord.transactions.TransferType transfer_type = 5;
99
137
  */
100
138
  transferType: TransferType;
101
139
  /**
102
140
  * Free form description
103
141
  *
104
- * @generated from field: string description = 7;
142
+ * @generated from field: string description = 6;
105
143
  */
106
144
  description: string;
107
145
  /**
108
146
  * flag to allow credited account to become negative. Default false
109
147
  *
110
- * @generated from field: bool allow_negative = 9;
148
+ * @generated from field: bool allow_negative = 7;
111
149
  */
112
150
  allowNegative: boolean;
113
- constructor(data?: PartialMessage<TransferRequest>);
151
+ /**
152
+ * @generated from field: njord.transactions.TransferFee fee = 8;
153
+ */
154
+ fee?: TransferFee;
155
+ constructor(data?: PartialMessage<Transfer>);
114
156
  static readonly runtime: typeof proto3;
115
- static readonly typeName = "njord.transactions.TransferRequest";
157
+ static readonly typeName = "njord.transactions.Transfer";
116
158
  static readonly fields: FieldList;
117
- static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TransferRequest;
118
- static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TransferRequest;
119
- static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TransferRequest;
120
- static equals(a: TransferRequest | PlainMessage<TransferRequest> | undefined, b: TransferRequest | PlainMessage<TransferRequest> | undefined): boolean;
159
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): Transfer;
160
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): Transfer;
161
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): Transfer;
162
+ static equals(a: Transfer | PlainMessage<Transfer> | undefined, b: Transfer | PlainMessage<Transfer> | undefined): boolean;
121
163
  }
122
164
  /**
123
- * @generated from message njord.transactions.UserAccount
165
+ * @generated from message njord.transactions.TransferRequest
124
166
  */
125
- declare class UserAccount extends Message<UserAccount> {
167
+ declare class TransferRequest extends Message<TransferRequest> {
126
168
  /**
127
- * @generated from field: string user_id = 1;
169
+ * id to insure operation idempotency (UUID)
170
+ *
171
+ * @generated from field: string idempotency_key = 1;
128
172
  */
129
- userId: string;
173
+ idempotencyKey: string;
130
174
  /**
131
- * @generated from field: njord.transactions.Currency currency = 2;
175
+ * @generated from field: repeated njord.transactions.Transfer transfers = 2;
132
176
  */
133
- currency: Currency;
134
- constructor(data?: PartialMessage<UserAccount>);
177
+ transfers: Transfer[];
178
+ constructor(data?: PartialMessage<TransferRequest>);
135
179
  static readonly runtime: typeof proto3;
136
- static readonly typeName = "njord.transactions.UserAccount";
180
+ static readonly typeName = "njord.transactions.TransferRequest";
137
181
  static readonly fields: FieldList;
138
- static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): UserAccount;
139
- static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): UserAccount;
140
- static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): UserAccount;
141
- static equals(a: UserAccount | PlainMessage<UserAccount> | undefined, b: UserAccount | PlainMessage<UserAccount> | undefined): boolean;
182
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TransferRequest;
183
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TransferRequest;
184
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TransferRequest;
185
+ static equals(a: TransferRequest | PlainMessage<TransferRequest> | undefined, b: TransferRequest | PlainMessage<TransferRequest> | undefined): boolean;
142
186
  }
143
187
  /**
144
188
  * @generated from message njord.transactions.BalanceChange
145
189
  */
146
190
  declare class BalanceChange extends Message<BalanceChange> {
147
- /**
148
- * @generated from field: njord.transactions.UserAccount account = 1;
149
- */
150
- account?: UserAccount;
151
191
  /**
152
192
  * Balance before the update
153
193
  *
154
- * @generated from field: int64 previous_balance = 2;
194
+ * @generated from field: int64 previous_balance = 1;
155
195
  */
156
196
  previousBalance: any;
157
197
  /**
158
198
  * Balance after the update
159
199
  *
160
- * @generated from field: int64 new_balance = 3;
200
+ * @generated from field: int64 new_balance = 2;
161
201
  */
162
202
  newBalance: any;
163
203
  /**
164
204
  * Amount of change in the balance (could be positive or negative)
165
205
  *
166
- * @generated from field: int64 change_amount = 4;
206
+ * @generated from field: int64 change_amount = 3;
167
207
  */
168
208
  changeAmount: any;
169
209
  constructor(data?: PartialMessage<BalanceChange>);
@@ -176,6 +216,65 @@ declare class BalanceChange extends Message<BalanceChange> {
176
216
  static equals(a: BalanceChange | PlainMessage<BalanceChange> | undefined, b: BalanceChange | PlainMessage<BalanceChange> | undefined): boolean;
177
217
  }
178
218
  /**
219
+ * Result of a single transfer operation, fee is treated as a separate transfer operation
220
+ *
221
+ * @generated from message njord.transactions.TransferResult
222
+ */
223
+ declare class TransferResult extends Message<TransferResult> {
224
+ /**
225
+ * Operation unique ID
226
+ *
227
+ * @generated from field: string id = 1;
228
+ */
229
+ id: string;
230
+ /**
231
+ * user sending currency
232
+ *
233
+ * @generated from field: string sender_id = 2;
234
+ */
235
+ senderId: string;
236
+ /**
237
+ * user receiving currency
238
+ *
239
+ * @generated from field: string receiver_id = 3;
240
+ */
241
+ receiverId: string;
242
+ /**
243
+ * @generated from field: njord.transactions.Currency currency = 4;
244
+ */
245
+ currency: Currency;
246
+ /**
247
+ * Sender's balance after deducting amount
248
+ *
249
+ * @generated from field: njord.transactions.BalanceChange sender_balance = 5;
250
+ */
251
+ senderBalance?: BalanceChange;
252
+ /**
253
+ * Receiver's balance after receiving amount
254
+ *
255
+ * @generated from field: njord.transactions.BalanceChange receiver_balance = 6;
256
+ */
257
+ receiverBalance?: BalanceChange;
258
+ /**
259
+ * @generated from field: njord.transactions.TransferType transfer_type = 7;
260
+ */
261
+ transferType: TransferType;
262
+ /**
263
+ * @generated from field: string description = 8;
264
+ */
265
+ description: string;
266
+ constructor(data?: PartialMessage<TransferResult>);
267
+ static readonly runtime: typeof proto3;
268
+ static readonly typeName = "njord.transactions.TransferResult";
269
+ static readonly fields: FieldList;
270
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TransferResult;
271
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TransferResult;
272
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TransferResult;
273
+ static equals(a: TransferResult | PlainMessage<TransferResult> | undefined, b: TransferResult | PlainMessage<TransferResult> | undefined): boolean;
274
+ }
275
+ /**
276
+ * Same message is posted to transfer log stream
277
+ *
179
278
  * @generated from message njord.transactions.TransferResponse
180
279
  */
181
280
  declare class TransferResponse extends Message<TransferResponse> {
@@ -184,15 +283,27 @@ declare class TransferResponse extends Message<TransferResponse> {
184
283
  */
185
284
  idempotencyKey: string;
186
285
  /**
187
- * @generated from field: njord.transactions.BalanceChange sender_balance = 2;
286
+ * Whole transfer status (only SUCCESS or failure statuses)
287
+ *
288
+ * @generated from field: njord.transactions.TransferStatus status = 2;
188
289
  */
189
- senderBalance?: BalanceChange;
290
+ status: TransferStatus;
190
291
  /**
191
- * @generated from field: njord.transactions.BalanceChange receiver_balance = 3;
292
+ * Descriptive error message, present only when status is not SUCCESS
293
+ *
294
+ * @generated from field: string error_message = 3;
192
295
  */
193
- receiverBalance?: BalanceChange;
296
+ errorMessage: string;
194
297
  /**
195
- * @generated from field: int64 timestamp = 4;
298
+ * Individual transfer results, present only if status is SUCCESS
299
+ *
300
+ * @generated from field: repeated njord.transactions.TransferResult results = 4;
301
+ */
302
+ results: TransferResult[];
303
+ /**
304
+ * Unix epoch timestamp milliseconds
305
+ *
306
+ * @generated from field: int64 timestamp = 5;
196
307
  */
197
308
  timestamp: any;
198
309
  constructor(data?: PartialMessage<TransferResponse>);
@@ -204,6 +315,27 @@ declare class TransferResponse extends Message<TransferResponse> {
204
315
  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TransferResponse;
205
316
  static equals(a: TransferResponse | PlainMessage<TransferResponse> | undefined, b: TransferResponse | PlainMessage<TransferResponse> | undefined): boolean;
206
317
  }
318
+ /**
319
+ * @generated from message njord.transactions.UserAccount
320
+ */
321
+ declare class UserAccount extends Message<UserAccount> {
322
+ /**
323
+ * @generated from field: string user_id = 1;
324
+ */
325
+ userId: string;
326
+ /**
327
+ * @generated from field: njord.transactions.Currency currency = 2;
328
+ */
329
+ currency: Currency;
330
+ constructor(data?: PartialMessage<UserAccount>);
331
+ static readonly runtime: typeof proto3;
332
+ static readonly typeName = "njord.transactions.UserAccount";
333
+ static readonly fields: FieldList;
334
+ static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): UserAccount;
335
+ static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): UserAccount;
336
+ static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): UserAccount;
337
+ static equals(a: UserAccount | PlainMessage<UserAccount> | undefined, b: UserAccount | PlainMessage<UserAccount> | undefined): boolean;
338
+ }
207
339
  /**
208
340
  * @generated from message njord.transactions.GetBalanceRequest
209
341
  */
@@ -240,58 +372,5 @@ declare class GetBalanceResponse extends Message<GetBalanceResponse> {
240
372
  static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): GetBalanceResponse;
241
373
  static equals(a: GetBalanceResponse | PlainMessage<GetBalanceResponse> | undefined, b: GetBalanceResponse | PlainMessage<GetBalanceResponse> | undefined): boolean;
242
374
  }
243
- /**
244
- * @generated from message njord.transactions.TransactionLogEntry
245
- */
246
- declare class TransactionLogEntry extends Message<TransactionLogEntry> {
247
- /**
248
- * unique identifier based on transfer id and user
249
- *
250
- * @generated from field: string transaction_id = 1;
251
- */
252
- transactionId: string;
253
- /**
254
- * @generated from field: string user_id = 2;
255
- */
256
- userId: string;
257
- /**
258
- * @generated from field: njord.transactions.Currency currency = 3;
259
- */
260
- currency: Currency;
261
- /**
262
- * @generated from field: int64 amount = 4;
263
- */
264
- amount: any;
265
- /**
266
- * @generated from field: int64 previous_balance = 5;
267
- */
268
- previousBalance: any;
269
- /**
270
- * @generated from field: int64 current_balance = 6;
271
- */
272
- currentBalance: any;
273
- /**
274
- * Type of change (e.g., "deposit", "withdrawal"). It is not limited to above values and can be any kind of label, like "promotion_reward" or "admin_action".
275
- *
276
- * @generated from field: njord.transactions.TransferType transfer_type = 7;
277
- */
278
- transferType: TransferType;
279
- /**
280
- * @generated from field: string description = 8;
281
- */
282
- description: string;
283
- /**
284
- * @generated from field: int64 timestamp = 9;
285
- */
286
- timestamp: any;
287
- constructor(data?: PartialMessage<TransactionLogEntry>);
288
- static readonly runtime: typeof proto3;
289
- static readonly typeName = "njord.transactions.TransactionLogEntry";
290
- static readonly fields: FieldList;
291
- static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TransactionLogEntry;
292
- static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): TransactionLogEntry;
293
- static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): TransactionLogEntry;
294
- static equals(a: TransactionLogEntry | PlainMessage<TransactionLogEntry> | undefined, b: TransactionLogEntry | PlainMessage<TransactionLogEntry> | undefined): boolean;
295
- }
296
375
 
297
- export { BalanceChange, Currency, EntityType, GetBalanceRequest, GetBalanceResponse, TransactionLogEntry, TransferParticipant, TransferRequest, TransferResponse, TransferType, UserAccount };
376
+ export { BalanceChange, Currency, EntityType, GetBalanceRequest, GetBalanceResponse, Transfer, TransferFee, TransferParticipant, TransferRequest, TransferResponse, TransferResult, TransferStatus, TransferType, UserAccount };
@@ -1 +1 @@
1
- import{Message as n,proto3 as t,protoInt64 as e}from"@bufbuild/protobuf";var r=(n=>(n[n.CORES=0]="CORES",n))(r||{});t.util.setEnumType(r,"njord.transactions.Currency",[{no:0,name:"CORES"}]);var a=(n=>(n[n.TRANSFER=0]="TRANSFER",n))(a||{});t.util.setEnumType(a,"njord.transactions.TransferType",[{no:0,name:"TRANSFER"}]);var s=(n=>(n[n.SYSTEM=0]="SYSTEM",n[n.USER=1]="USER",n))(s||{});t.util.setEnumType(s,"njord.transactions.EntityType",[{no:0,name:"SYSTEM"},{no:1,name:"USER"}]);class i extends n{type=0;id="";constructor(n){super(),t.util.initPartial(n,this)}static runtime=t;static typeName="njord.transactions.TransferParticipant";static fields=t.util.newFieldList((()=>[{no:1,name:"type",kind:"enum",T:t.getEnumType(s)},{no:2,name:"id",kind:"scalar",T:9}]));static fromBinary(n,t){return(new i).fromBinary(n,t)}static fromJson(n,t){return(new i).fromJson(n,t)}static fromJsonString(n,t){return(new i).fromJsonString(n,t)}static equals(n,e){return t.util.equals(i,n,e)}}class o extends n{idempotencyKey="";sender;receiver;currency=0;amount=e.zero;transferType=0;description="";allowNegative=!1;constructor(n){super(),t.util.initPartial(n,this)}static runtime=t;static typeName="njord.transactions.TransferRequest";static fields=t.util.newFieldList((()=>[{no:1,name:"idempotency_key",kind:"scalar",T:9},{no:2,name:"sender",kind:"message",T:i},{no:3,name:"receiver",kind:"message",T:i},{no:4,name:"currency",kind:"enum",T:t.getEnumType(r)},{no:5,name:"amount",kind:"scalar",T:3},{no:6,name:"transfer_type",kind:"enum",T:t.getEnumType(a)},{no:7,name:"description",kind:"scalar",T:9},{no:9,name:"allow_negative",kind:"scalar",T:8}]));static fromBinary(n,t){return(new o).fromBinary(n,t)}static fromJson(n,t){return(new o).fromJson(n,t)}static fromJsonString(n,t){return(new o).fromJsonString(n,t)}static equals(n,e){return t.util.equals(o,n,e)}}class c extends n{userId="";currency=0;constructor(n){super(),t.util.initPartial(n,this)}static runtime=t;static typeName="njord.transactions.UserAccount";static fields=t.util.newFieldList((()=>[{no:1,name:"user_id",kind:"scalar",T:9},{no:2,name:"currency",kind:"enum",T:t.getEnumType(r)}]));static fromBinary(n,t){return(new c).fromBinary(n,t)}static fromJson(n,t){return(new c).fromJson(n,t)}static fromJsonString(n,t){return(new c).fromJsonString(n,t)}static equals(n,e){return t.util.equals(c,n,e)}}class u extends n{account;previousBalance=e.zero;newBalance=e.zero;changeAmount=e.zero;constructor(n){super(),t.util.initPartial(n,this)}static runtime=t;static typeName="njord.transactions.BalanceChange";static fields=t.util.newFieldList((()=>[{no:1,name:"account",kind:"message",T:c},{no:2,name:"previous_balance",kind:"scalar",T:3},{no:3,name:"new_balance",kind:"scalar",T:3},{no:4,name:"change_amount",kind:"scalar",T:3}]));static fromBinary(n,t){return(new u).fromBinary(n,t)}static fromJson(n,t){return(new u).fromJson(n,t)}static fromJsonString(n,t){return(new u).fromJsonString(n,t)}static equals(n,e){return t.util.equals(u,n,e)}}class m extends n{idempotencyKey="";senderBalance;receiverBalance;timestamp=e.zero;constructor(n){super(),t.util.initPartial(n,this)}static runtime=t;static typeName="njord.transactions.TransferResponse";static fields=t.util.newFieldList((()=>[{no:1,name:"idempotency_key",kind:"scalar",T:9},{no:2,name:"sender_balance",kind:"message",T:u},{no:3,name:"receiver_balance",kind:"message",T:u},{no:4,name:"timestamp",kind:"scalar",T:3}]));static fromBinary(n,t){return(new m).fromBinary(n,t)}static fromJson(n,t){return(new m).fromJson(n,t)}static fromJsonString(n,t){return(new m).fromJsonString(n,t)}static equals(n,e){return t.util.equals(m,n,e)}}class l extends n{account;constructor(n){super(),t.util.initPartial(n,this)}static runtime=t;static typeName="njord.transactions.GetBalanceRequest";static fields=t.util.newFieldList((()=>[{no:1,name:"account",kind:"message",T:c}]));static fromBinary(n,t){return(new l).fromBinary(n,t)}static fromJson(n,t){return(new l).fromJson(n,t)}static fromJsonString(n,t){return(new l).fromJsonString(n,t)}static equals(n,e){return t.util.equals(l,n,e)}}class d extends n{amount=e.zero;constructor(n){super(),t.util.initPartial(n,this)}static runtime=t;static typeName="njord.transactions.GetBalanceResponse";static fields=t.util.newFieldList((()=>[{no:1,name:"amount",kind:"scalar",T:3}]));static fromBinary(n,t){return(new d).fromBinary(n,t)}static fromJson(n,t){return(new d).fromJson(n,t)}static fromJsonString(n,t){return(new d).fromJsonString(n,t)}static equals(n,e){return t.util.equals(d,n,e)}}class f extends n{transactionId="";userId="";currency=0;amount=e.zero;previousBalance=e.zero;currentBalance=e.zero;transferType=0;description="";timestamp=e.zero;constructor(n){super(),t.util.initPartial(n,this)}static runtime=t;static typeName="njord.transactions.TransactionLogEntry";static fields=t.util.newFieldList((()=>[{no:1,name:"transaction_id",kind:"scalar",T:9},{no:2,name:"user_id",kind:"scalar",T:9},{no:3,name:"currency",kind:"enum",T:t.getEnumType(r)},{no:4,name:"amount",kind:"scalar",T:3},{no:5,name:"previous_balance",kind:"scalar",T:3},{no:6,name:"current_balance",kind:"scalar",T:3},{no:7,name:"transfer_type",kind:"enum",T:t.getEnumType(a)},{no:8,name:"description",kind:"scalar",T:9},{no:9,name:"timestamp",kind:"scalar",T:3}]));static fromBinary(n,t){return(new f).fromBinary(n,t)}static fromJson(n,t){return(new f).fromJson(n,t)}static fromJsonString(n,t){return(new f).fromJsonString(n,t)}static equals(n,e){return t.util.equals(f,n,e)}}export{u as BalanceChange,r as Currency,s as EntityType,l as GetBalanceRequest,d as GetBalanceResponse,f as TransactionLogEntry,i as TransferParticipant,o as TransferRequest,m as TransferResponse,a as TransferType,c as UserAccount};
1
+ import{Message as n,proto3 as t,protoInt64 as e}from"@bufbuild/protobuf";var r=(n=>(n[n.CORES=0]="CORES",n))(r||{});t.util.setEnumType(r,"njord.transactions.Currency",[{no:0,name:"CORES"}]);var a=(n=>(n[n.TRANSFER=0]="TRANSFER",n[n.FEE=1]="FEE",n))(a||{});t.util.setEnumType(a,"njord.transactions.TransferType",[{no:0,name:"TRANSFER"},{no:1,name:"FEE"}]);var s=(n=>(n[n.SYSTEM=0]="SYSTEM",n[n.USER=1]="USER",n))(s||{});t.util.setEnumType(s,"njord.transactions.EntityType",[{no:0,name:"SYSTEM"},{no:1,name:"USER"}]);var i=(n=>(n[n.SUCCESS=0]="SUCCESS",n[n.INSUFFICIENT_FUNDS=1]="INSUFFICIENT_FUNDS",n[n.INTERNAL_ERROR=100]="INTERNAL_ERROR",n))(i||{});t.util.setEnumType(i,"njord.transactions.TransferStatus",[{no:0,name:"SUCCESS"},{no:1,name:"INSUFFICIENT_FUNDS"},{no:100,name:"INTERNAL_ERROR"}]);class o extends n{type=0;id="";constructor(n){super(),t.util.initPartial(n,this)}static runtime=t;static typeName="njord.transactions.TransferParticipant";static fields=t.util.newFieldList((()=>[{no:1,name:"type",kind:"enum",T:t.getEnumType(s)},{no:2,name:"id",kind:"scalar",T:9}]));static fromBinary(n,t){return(new o).fromBinary(n,t)}static fromJson(n,t){return(new o).fromJson(n,t)}static fromJsonString(n,t){return(new o).fromJsonString(n,t)}static equals(n,e){return t.util.equals(o,n,e)}}class c extends n{percentage=0;constructor(n){super(),t.util.initPartial(n,this)}static runtime=t;static typeName="njord.transactions.TransferFee";static fields=t.util.newFieldList((()=>[{no:1,name:"percentage",kind:"scalar",T:5}]));static fromBinary(n,t){return(new c).fromBinary(n,t)}static fromJson(n,t){return(new c).fromJson(n,t)}static fromJsonString(n,t){return(new c).fromJsonString(n,t)}static equals(n,e){return t.util.equals(c,n,e)}}class u extends n{sender;receiver;currency=0;amount=e.zero;transferType=0;description="";allowNegative=!1;fee;constructor(n){super(),t.util.initPartial(n,this)}static runtime=t;static typeName="njord.transactions.Transfer";static fields=t.util.newFieldList((()=>[{no:1,name:"sender",kind:"message",T:o},{no:2,name:"receiver",kind:"message",T:o},{no:3,name:"currency",kind:"enum",T:t.getEnumType(r)},{no:4,name:"amount",kind:"scalar",T:3},{no:5,name:"transfer_type",kind:"enum",T:t.getEnumType(a)},{no:6,name:"description",kind:"scalar",T:9},{no:7,name:"allow_negative",kind:"scalar",T:8},{no:8,name:"fee",kind:"message",T:c}]));static fromBinary(n,t){return(new u).fromBinary(n,t)}static fromJson(n,t){return(new u).fromJson(n,t)}static fromJsonString(n,t){return(new u).fromJsonString(n,t)}static equals(n,e){return t.util.equals(u,n,e)}}class m extends n{idempotencyKey="";transfers=[];constructor(n){super(),t.util.initPartial(n,this)}static runtime=t;static typeName="njord.transactions.TransferRequest";static fields=t.util.newFieldList((()=>[{no:1,name:"idempotency_key",kind:"scalar",T:9},{no:2,name:"transfers",kind:"message",T:u,repeated:!0}]));static fromBinary(n,t){return(new m).fromBinary(n,t)}static fromJson(n,t){return(new m).fromJson(n,t)}static fromJsonString(n,t){return(new m).fromJsonString(n,t)}static equals(n,e){return t.util.equals(m,n,e)}}class l extends n{previousBalance=e.zero;newBalance=e.zero;changeAmount=e.zero;constructor(n){super(),t.util.initPartial(n,this)}static runtime=t;static typeName="njord.transactions.BalanceChange";static fields=t.util.newFieldList((()=>[{no:1,name:"previous_balance",kind:"scalar",T:3},{no:2,name:"new_balance",kind:"scalar",T:3},{no:3,name:"change_amount",kind:"scalar",T:3}]));static fromBinary(n,t){return(new l).fromBinary(n,t)}static fromJson(n,t){return(new l).fromJson(n,t)}static fromJsonString(n,t){return(new l).fromJsonString(n,t)}static equals(n,e){return t.util.equals(l,n,e)}}class d extends n{id="";senderId="";receiverId="";currency=0;senderBalance;receiverBalance;transferType=0;description="";constructor(n){super(),t.util.initPartial(n,this)}static runtime=t;static typeName="njord.transactions.TransferResult";static fields=t.util.newFieldList((()=>[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"sender_id",kind:"scalar",T:9},{no:3,name:"receiver_id",kind:"scalar",T:9},{no:4,name:"currency",kind:"enum",T:t.getEnumType(r)},{no:5,name:"sender_balance",kind:"message",T:l},{no:6,name:"receiver_balance",kind:"message",T:l},{no:7,name:"transfer_type",kind:"enum",T:t.getEnumType(a)},{no:8,name:"description",kind:"scalar",T:9}]));static fromBinary(n,t){return(new d).fromBinary(n,t)}static fromJson(n,t){return(new d).fromJson(n,t)}static fromJsonString(n,t){return(new d).fromJsonString(n,t)}static equals(n,e){return t.util.equals(d,n,e)}}class f extends n{idempotencyKey="";status=0;errorMessage="";results=[];timestamp=e.zero;constructor(n){super(),t.util.initPartial(n,this)}static runtime=t;static typeName="njord.transactions.TransferResponse";static fields=t.util.newFieldList((()=>[{no:1,name:"idempotency_key",kind:"scalar",T:9},{no:2,name:"status",kind:"enum",T:t.getEnumType(i)},{no:3,name:"error_message",kind:"scalar",T:9},{no:4,name:"results",kind:"message",T:d,repeated:!0},{no:5,name:"timestamp",kind:"scalar",T:3}]));static fromBinary(n,t){return(new f).fromBinary(n,t)}static fromJson(n,t){return(new f).fromJson(n,t)}static fromJsonString(n,t){return(new f).fromJsonString(n,t)}static equals(n,e){return t.util.equals(f,n,e)}}class T extends n{userId="";currency=0;constructor(n){super(),t.util.initPartial(n,this)}static runtime=t;static typeName="njord.transactions.UserAccount";static fields=t.util.newFieldList((()=>[{no:1,name:"user_id",kind:"scalar",T:9},{no:2,name:"currency",kind:"enum",T:t.getEnumType(r)}]));static fromBinary(n,t){return(new T).fromBinary(n,t)}static fromJson(n,t){return(new T).fromJson(n,t)}static fromJsonString(n,t){return(new T).fromJsonString(n,t)}static equals(n,e){return t.util.equals(T,n,e)}}class y extends n{account;constructor(n){super(),t.util.initPartial(n,this)}static runtime=t;static typeName="njord.transactions.GetBalanceRequest";static fields=t.util.newFieldList((()=>[{no:1,name:"account",kind:"message",T:T}]));static fromBinary(n,t){return(new y).fromBinary(n,t)}static fromJson(n,t){return(new y).fromJson(n,t)}static fromJsonString(n,t){return(new y).fromJsonString(n,t)}static equals(n,e){return t.util.equals(y,n,e)}}class p extends n{amount=e.zero;constructor(n){super(),t.util.initPartial(n,this)}static runtime=t;static typeName="njord.transactions.GetBalanceResponse";static fields=t.util.newFieldList((()=>[{no:1,name:"amount",kind:"scalar",T:3}]));static fromBinary(n,t){return(new p).fromBinary(n,t)}static fromJson(n,t){return(new p).fromJson(n,t)}static fromJsonString(n,t){return(new p).fromJsonString(n,t)}static equals(n,e){return t.util.equals(p,n,e)}}export{l as BalanceChange,r as Currency,s as EntityType,y as GetBalanceRequest,p as GetBalanceResponse,u as Transfer,c as TransferFee,o as TransferParticipant,m as TransferRequest,f as TransferResponse,d as TransferResult,i as TransferStatus,a as TransferType,T as UserAccount};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dailydotdev/schema",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "author": "@dailydotdev",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",