@@ -2,88 +2,83 @@ package rpc
22
33import "errors"
44
5- // Static errors
65var (
6+ // transaction
7+
78 // ErrMissingTxSignatureOrSigningPubKey is returned when a transaction lacks both TxSignature and SigningPubKey.
89 ErrMissingTxSignatureOrSigningPubKey = errors .New ("transaction must include either TxSignature or SigningPubKey" )
9-
1010 // ErrSignerDataIsEmpty is returned when signer data is empty or missing.
1111 ErrSignerDataIsEmpty = errors .New ("signer data must not be empty" )
12-
13- // ErrCannotFundWalletWithoutClassicAddress is returned when attempting to fund a wallet without a classic address.
14- ErrCannotFundWalletWithoutClassicAddress = errors .New ("cannot fund wallet without a classic address" )
15-
1612 // ErrMissingLastLedgerSequenceInTransaction is returned when LastLedgerSequence is missing from a transaction.
1713 ErrMissingLastLedgerSequenceInTransaction = errors .New ("missing LastLedgerSequence in transaction" )
18-
1914 // ErrMissingWallet is returned when a wallet is required but not provided for an unsigned transaction.
2015 ErrMissingWallet = errors .New ("wallet must be provided when submitting an unsigned transaction" )
16+ // ErrMissingAccountInTransaction is returned when the Account field is missing from a transaction.
17+ ErrMissingAccountInTransaction = errors .New ("missing Account in transaction" )
18+ // ErrTransactionTypeMissing is returned when the transaction type is missing from a transaction.
19+ ErrTransactionTypeMissing = errors .New ("transaction type is missing in transaction" )
20+ // ErrTransactionNotFound is returned when a transaction cannot be found.
21+ ErrTransactionNotFound = errors .New ("transaction not found" )
22+ // ErrInvalidFulfillmentLength is returned when the fulfillment length is invalid.
23+ ErrInvalidFulfillmentLength = errors .New ("invalid fulfillment length" )
24+ // ErrMismatchedTag is returned when a transaction tag field does not match the expected value.
25+ ErrMismatchedTag = errors .New ("transaction tag mismatch" )
26+
27+ // fields
2128
2229 // ErrRawTransactionsFieldIsNotAnArray is returned when the RawTransactions field is not an array type.
2330 ErrRawTransactionsFieldIsNotAnArray = errors .New ("field RawTransactions must be an array" )
24-
2531 // ErrRawTransactionFieldIsNotAnObject is returned when the RawTransaction field is not an object type.
2632 ErrRawTransactionFieldIsNotAnObject = errors .New ("field RawTransaction must be an object" )
27-
2833 // ErrSigningPubKeyFieldMustBeEmpty is returned when the signingPubKey field should be empty but isn't.
2934 ErrSigningPubKeyFieldMustBeEmpty = errors .New ("field SigningPubKey must be empty" )
30-
3135 // ErrTxnSignatureFieldMustBeEmpty is returned when the txnSignature field should be empty but isn't.
3236 ErrTxnSignatureFieldMustBeEmpty = errors .New ("field TxnSignature must be empty" )
33-
3437 // ErrSignersFieldMustBeEmpty is returned when the signers field should be empty but isn't.
3538 ErrSignersFieldMustBeEmpty = errors .New ("field Signers must be empty" )
36-
3739 // ErrAccountFieldIsNotAString is returned when the account field is not a string type.
3840 ErrAccountFieldIsNotAString = errors .New ("field Account must be a string" )
41+ // ErrRawTransactionsFieldMissing is returned when the RawTransactions field is missing from a Batch transaction.
42+ ErrRawTransactionsFieldMissing = errors .New ("RawTransactions field missing from Batch transaction" )
43+ // ErrRawTransactionFieldMissing is returned when the RawTransaction field is missing from a wrapper.
44+ ErrRawTransactionFieldMissing = errors .New ("RawTransaction field missing from wrapper" )
45+ // ErrFeeFieldMissing is returned when the fee field is missing after calculation.
46+ ErrFeeFieldMissing = errors .New ("fee field missing after calculation" )
3947
40- // helpers
48+ // wallet
4149
42- // ErrMissingAccountInTransaction is returned when the Account field is missing from a transaction.
43- ErrMissingAccountInTransaction = errors .New ("missing Account in transaction" )
50+ // ErrCannotFundWalletWithoutClassicAddress is returned when attempting to fund a wallet without a classic address.
51+ ErrCannotFundWalletWithoutClassicAddress = errors .New ("cannot fund wallet without a classic address" )
52+
53+ // fees
4454
4555 // ErrCouldNotGetBaseFeeXrp is returned when BaseFeeXrp cannot be retrieved from ServerInfo.
46- ErrCouldNotGetBaseFeeXrp = errors .New ("getFeeXrp: could not get BaseFeeXrp from ServerInfo" )
56+ ErrCouldNotGetBaseFeeXrp = errors .New ("get fee xrp: could not get BaseFeeXrp from ServerInfo" )
57+ // ErrCouldNotFetchOwnerReserve is returned when the owner reserve fee cannot be fetched.
58+ ErrCouldNotFetchOwnerReserve = errors .New ("could not fetch Owner Reserve" )
59+ // ErrFailedToParseFee is returned when fee parsing fails.
60+ ErrFailedToParseFee = errors .New ("failed to parse fee" )
61+
62+ // account
4763
4864 // ErrAccountCannotBeDeleted is returned when an account cannot be deleted due to associated objects.
4965 ErrAccountCannotBeDeleted = errors .New ("account cannot be deleted; there are Escrows, PayChannels, RippleStates, or Checks associated with the account" )
5066
67+ // payment
68+
5169 // ErrAmountAndDeliverMaxMustBeIdentical is returned when Amount and DeliverMax fields are not identical.
5270 ErrAmountAndDeliverMaxMustBeIdentical = errors .New ("payment transaction: Amount and DeliverMax fields must be identical when both are provided" )
5371
54- // ErrTransactionTypeMissing is returned when the transaction type is missing from a transaction.
55- ErrTransactionTypeMissing = errors .New ("transaction type is missing in transaction" )
56-
57- // ErrTransactionNotFound is returned when a transaction cannot be found.
58- ErrTransactionNotFound = errors .New ("transaction not found" )
59-
60- // ErrCouldNotFetchOwnerReserve is returned when the owner reserve fee cannot be fetched.
61- ErrCouldNotFetchOwnerReserve = errors .New ("could not fetch Owner Reserve" )
62-
63- // ErrRawTransactionsFieldMissing is returned when the RawTransactions field is missing from a Batch transaction.
64- ErrRawTransactionsFieldMissing = errors .New ("RawTransactions field missing from Batch transaction" )
65-
66- // ErrRawTransactionFieldMissing is returned when the RawTransaction field is missing from a wrapper.
67- ErrRawTransactionFieldMissing = errors .New ("RawTransaction field missing from wrapper" )
68-
69- // ErrFeeFieldMissing is returned when the fee field is missing after calculation.
70- ErrFeeFieldMissing = errors .New ("fee field missing after calculation" )
71-
72- // ErrInvalidFulfillmentLength is returned when the fulfillment length is invalid.
73- ErrInvalidFulfillmentLength = errors .New ("invalid fulfillment length" )
72+ // tags
7473
7574 // ErrTagMustEqualAddressTag is returned when a tag must equal the address tag.
7675 ErrTagMustEqualAddressTag = errors .New ("tag, if present, must be equal to the tag of the address" )
7776
77+ // json rpc
78+
7879 // ErrFailedToMarshalJSONRPCRequest is returned when JSON-RPC request marshaling fails.
7980 ErrFailedToMarshalJSONRPCRequest = errors .New ("failed to marshal JSON-RPC request" )
8081
81- // ErrFailedToParseFee is returned when fee parsing fails.
82- ErrFailedToParseFee = errors .New ("failed to parse fee" )
83-
84- // ErrMismatchedTag is returned when a transaction tag field does not match the expected value.
85- ErrMismatchedTag = errors .New ("transaction tag mismatch" )
86-
8782 // config
8883
8984 // ErrEmptyURL is returned when the provided URL is empty (no port or IP specified).
0 commit comments