diff --git a/CHANGELOG.md b/CHANGELOG.md index d27abef7..2dc4a5cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Adds `PermissionedDomain` ledger entry type (XLS-80d). +#### binary-codec + +- `Number` and `AssetScale` fields to `definitions.json` + +### Fixed + +#### xrpl + +- `OracleSet` transaction to Flatten correctly and `Oracle` PriceDataSeries array. + +#### binary-codec + +- `definitions.json` where `LastUpdatedTime` had a typo issue. + ## [v0.1.11] ### BREAKING CHANGES diff --git a/binary-codec/definitions/definitions.json b/binary-codec/definitions/definitions.json index acfc7aa4..aa802379 100644 --- a/binary-codec/definitions/definitions.json +++ b/binary-codec/definitions/definitions.json @@ -13,6 +13,7 @@ "LedgerEntry": 10002, "Metadata": 10004, "NotPresent": 0, + "Number": 9, "PathSet": 18, "STArray": 15, "STObject": 14, @@ -236,6 +237,16 @@ "type": "UInt8" } ], + [ + "AssetScale", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 5, + "type": "UInt8" + } + ], [ "TickSize", { @@ -527,7 +538,7 @@ } ], [ - "LastUpdateTime", + "LastUpdatedTime", { "nth": 15, "isVLEncoded": false, @@ -2416,6 +2427,16 @@ "type": "AccountID" } ], + [ + "Number", + { + "isSerialized": true, + "isSigningField": true, + "isVLEncoded": false, + "nth": 1, + "type": "Number" + } + ], [ "TransactionMetaData", { diff --git a/binary-codec/types/currency.go b/binary-codec/types/currency.go index 13ef084b..2aa7c333 100644 --- a/binary-codec/types/currency.go +++ b/binary-codec/types/currency.go @@ -29,11 +29,13 @@ func (c *Currency) FromJSON(json any) ([]byte, error) { // ToJSON serializes a binary currency value into a JSON-compatible format. // It requires a length option specifying the byte length to read. func (c *Currency) ToJSON(p interfaces.BinaryParser, opts ...int) (any, error) { - if len(opts) == 0 { - return nil, ErrMissingCurrencyLengthOption + // default to 20 bytes, https://xrpl.org/docs/references/protocol/ledger-data/ledger-entry-types/oracle#currency-internal-format + length := 20 + if len(opts) > 0 && opts[0] > 0 { + length = opts[0] } - currencyBytes, err := p.ReadBytes(opts[0]) + currencyBytes, err := p.ReadBytes(length) if err != nil { return nil, err } diff --git a/examples/oracle/rpc/main.go b/examples/oracle/rpc/main.go new file mode 100644 index 00000000..b4e80e98 --- /dev/null +++ b/examples/oracle/rpc/main.go @@ -0,0 +1,144 @@ +package main + +import ( + "encoding/hex" + "encoding/json" + "fmt" + "time" + + "github.com/Peersyst/xrpl-go/examples/clients" + "github.com/Peersyst/xrpl-go/pkg/crypto" + "github.com/Peersyst/xrpl-go/xrpl/currency" + "github.com/Peersyst/xrpl-go/xrpl/ledger-entry-types" + "github.com/Peersyst/xrpl-go/xrpl/rpc/types" + "github.com/Peersyst/xrpl-go/xrpl/transaction" + "github.com/Peersyst/xrpl-go/xrpl/wallet" +) + +func safeInt64ToUint32(value int64) uint32 { + if value < 0 { + return 0 + } + if value > int64(^uint32(0)) { + return ^uint32(0) // max uint32 value + } + return uint32(value) +} + +func printJSON(data interface{}) { + jsonBytes, err := json.MarshalIndent(data, "", " ") + if err != nil { + fmt.Printf("❌ Error marshaling to JSON: %s\n", err) + return + } + fmt.Println(string(jsonBytes)) +} + +func main() { + // + // Configure client + // + fmt.Println("⏳ Setting up testnet RPC client...") + client := clients.GetTestnetRPCClient() + + // + // Configure wallets + // + fmt.Println("⏳ Setting up wallets...") + oracleIssuer, err := wallet.New(crypto.ED25519()) + if err != nil { + fmt.Printf("❌ Error creating oracle issuer wallet: %s\n", err) + return + } + err = client.FundWallet(&oracleIssuer) + if err != nil { + fmt.Printf("❌ Error funding oracle issuer wallet: %s\n", err) + return + } + fmt.Println("💸 Oracle issuer wallet funded!") + fmt.Println() + + // + // Create oracle set transaction + // + fmt.Println("⏳ Creating oracle set transaction...") + + // 1 minute ago + lastUpdatedTime := safeInt64ToUint32(time.Now().Add(-time.Second).Unix()) + oracleDocumentID := uint32(1) + + oracleSet := transaction.OracleSet{ + BaseTx: transaction.BaseTx{ + Account: oracleIssuer.ClassicAddress, + }, + OracleDocumentID: oracleDocumentID, + LastUpdatedTime: lastUpdatedTime, + URI: hex.EncodeToString([]byte("https://example.com")), + Provider: hex.EncodeToString([]byte("Chainlink")), + AssetClass: hex.EncodeToString([]byte("currency")), + PriceDataSeries: []ledger.PriceDataWrapper{ + { + PriceData: ledger.PriceData{ + BaseAsset: currency.ConvertStringToHex("ACGB"), + QuoteAsset: "USD", + AssetPrice: 123, + Scale: 3, + }, + }, + }, + } + + flatOracleSet := oracleSet.Flatten() + + fmt.Println("📄 Oracle Set Transaction JSON:") + printJSON(flatOracleSet) + fmt.Println() + + response, err := client.SubmitTxAndWait(flatOracleSet, &types.SubmitOptions{ + Wallet: &oracleIssuer, + Autofill: true, + }) + if err != nil { + fmt.Println(err) + return + } + + fmt.Println("✅ Oracle set transaction submitted") + fmt.Printf("🌐 Hash: %s\n", response.Hash.String()) + fmt.Printf("🌐 Validated: %t\n", response.Validated) + + if !response.Validated { + fmt.Println("❌ Oracle set transaction failed") + return + } + fmt.Println() + + // Delete oracle + fmt.Println("⏳ Deleting oracle...") + + oracleDelete := transaction.OracleDelete{ + BaseTx: transaction.BaseTx{ + Account: oracleIssuer.ClassicAddress, + }, + OracleDocumentID: oracleDocumentID, + } + + flatOracleDelete := oracleDelete.Flatten() + + fmt.Println("📄 Oracle Delete Transaction JSON:") + printJSON(flatOracleDelete) + fmt.Println() + + responseDelete, err := client.SubmitTxAndWait(flatOracleDelete, &types.SubmitOptions{ + Wallet: &oracleIssuer, + Autofill: true, + }) + if err != nil { + fmt.Println(err) + return + } + + fmt.Println("✅ Oracle deleted") + fmt.Printf("🌐 Hash: %s\n", responseDelete.Hash.String()) + fmt.Printf("🌐 Validated: %t\n", responseDelete.Validated) +} diff --git a/examples/oracle/ws/main.go b/examples/oracle/ws/main.go new file mode 100644 index 00000000..669a26e4 --- /dev/null +++ b/examples/oracle/ws/main.go @@ -0,0 +1,160 @@ +package main + +import ( + "encoding/hex" + "encoding/json" + "fmt" + "time" + + "github.com/Peersyst/xrpl-go/examples/clients" + "github.com/Peersyst/xrpl-go/pkg/crypto" + "github.com/Peersyst/xrpl-go/xrpl/currency" + "github.com/Peersyst/xrpl-go/xrpl/ledger-entry-types" + "github.com/Peersyst/xrpl-go/xrpl/transaction" + "github.com/Peersyst/xrpl-go/xrpl/wallet" + wstypes "github.com/Peersyst/xrpl-go/xrpl/websocket/types" +) + +func safeInt64ToUint32(value int64) uint32 { + if value < 0 { + return 0 + } + if value > int64(^uint32(0)) { + return ^uint32(0) // max uint32 value + } + return uint32(value) +} + +func printJSON(data interface{}) { + jsonBytes, err := json.MarshalIndent(data, "", " ") + if err != nil { + fmt.Printf("❌ Error marshaling to JSON: %s\n", err) + return + } + fmt.Println(string(jsonBytes)) +} + +func main() { + // Setup client + fmt.Println("⏳ Setting up testnet WebSocket client...") + client := clients.GetTestnetWebsocketClient() + defer func() { + if err := client.Disconnect(); err != nil { + fmt.Printf("Error disconnecting: %s\n", err) + } + }() + + if err := client.Connect(); err != nil { + fmt.Printf("❌ Error connecting to testnet: %s\n", err) + return + } + + if !client.IsConnected() { + fmt.Println("❌ Failed to connect to testnet") + return + } + + fmt.Println("✅ Connected to testnet") + fmt.Println() + + // + // Configure wallets + // + fmt.Println("⏳ Setting up wallets...") + oracleIssuer, err := wallet.New(crypto.ED25519()) + if err != nil { + fmt.Printf("❌ Error creating oracle issuer wallet: %s\n", err) + return + } + err = client.FundWallet(&oracleIssuer) + if err != nil { + fmt.Printf("❌ Error funding oracle issuer wallet: %s\n", err) + return + } + fmt.Println("💸 Oracle issuer wallet funded!") + fmt.Println() + + // + // Create oracle set transaction + // + fmt.Println("⏳ Creating oracle set transaction...") + + // 1 minute ago + lastUpdatedTime := safeInt64ToUint32(time.Now().Add(-time.Second).Unix()) + oracleDocumentID := uint32(1) + + oracleSet := transaction.OracleSet{ + BaseTx: transaction.BaseTx{ + Account: oracleIssuer.ClassicAddress, + }, + OracleDocumentID: oracleDocumentID, + LastUpdatedTime: lastUpdatedTime, + URI: hex.EncodeToString([]byte("https://example.com")), + Provider: hex.EncodeToString([]byte("Chainlink")), + AssetClass: hex.EncodeToString([]byte("currency")), + PriceDataSeries: []ledger.PriceDataWrapper{ + { + PriceData: ledger.PriceData{ + BaseAsset: currency.ConvertStringToHex("ACGB"), + QuoteAsset: "USD", + AssetPrice: 123, + Scale: 3, + }, + }, + }, + } + + flatOracleSet := oracleSet.Flatten() + + fmt.Println("📄 Oracle Set Transaction JSON:") + printJSON(flatOracleSet) + fmt.Println() + + response, err := client.SubmitTxAndWait(flatOracleSet, &wstypes.SubmitOptions{ + Wallet: &oracleIssuer, + Autofill: true, + }) + if err != nil { + fmt.Println(err) + return + } + + fmt.Println("✅ Oracle set transaction submitted") + fmt.Printf("🌐 Hash: %s\n", response.Hash.String()) + fmt.Printf("🌐 Validated: %t\n", response.Validated) + + if !response.Validated { + fmt.Println("❌ Oracle set transaction failed") + return + } + fmt.Println() + + // Delete oracle + fmt.Println("⏳ Deleting oracle...") + + oracleDelete := transaction.OracleDelete{ + BaseTx: transaction.BaseTx{ + Account: oracleIssuer.ClassicAddress, + }, + OracleDocumentID: oracleDocumentID, + } + + flatOracleDelete := oracleDelete.Flatten() + + fmt.Println("📄 Oracle Delete Transaction JSON:") + printJSON(flatOracleDelete) + fmt.Println() + + responseDelete, err := client.SubmitTxAndWait(flatOracleDelete, &wstypes.SubmitOptions{ + Wallet: &oracleIssuer, + Autofill: true, + }) + if err != nil { + fmt.Println(err) + return + } + + fmt.Println("✅ Oracle deleted") + fmt.Printf("🌐 Hash: %s\n", responseDelete.Hash.String()) + fmt.Printf("🌐 Validated: %t\n", responseDelete.Validated) +} diff --git a/xrpl/ledger-entry-types/oracle.go b/xrpl/ledger-entry-types/oracle.go index 0d9e2218..83ece0bc 100644 --- a/xrpl/ledger-entry-types/oracle.go +++ b/xrpl/ledger-entry-types/oracle.go @@ -1,6 +1,8 @@ package ledger import ( + "strconv" + "github.com/Peersyst/xrpl-go/xrpl/transaction/types" ) @@ -9,6 +11,11 @@ const ( PriceDataScaleMax uint8 = 10 ) +// PriceDataWrapper represents a wrapper for the PriceData struct. +type PriceDataWrapper struct { + PriceData PriceData +} + // A PriceData object represents the price information for a token pair. type PriceData struct { // The primary asset in a trading pair. Any valid identifier, such as a stock symbol, @@ -52,28 +59,37 @@ func (priceData *PriceData) Validate() error { return nil } -// FlatPriceData represents a flattened map of PriceData fields for JSON serialization. -type FlatPriceData map[string]interface{} +// Flatten returns a map containing the PriceData if it is set, or nil otherwise. +func (mw *PriceDataWrapper) Flatten() map[string]any { + if mw.PriceData != (PriceData{}) { + flattened := make(map[string]any) + flattened["PriceData"] = mw.PriceData.Flatten() + return flattened + } + return nil +} // Flatten flattens the price data. -func (priceData *PriceData) Flatten() FlatPriceData { +func (priceData *PriceData) Flatten() map[string]any { mapKeys := 2 if priceData.Scale != 0 && priceData.AssetPrice != 0 { mapKeys = 4 } - flattened := make(FlatPriceData, mapKeys) + flattened := make(map[string]any, mapKeys) + if priceData.AssetPrice != 0 { + // AssetPrice needs to be a string + flatAssetPrice := strconv.FormatUint(priceData.AssetPrice, 10) + flattened["AssetPrice"] = flatAssetPrice + } if priceData.BaseAsset != "" { flattened["BaseAsset"] = priceData.BaseAsset } if priceData.QuoteAsset != "" { flattened["QuoteAsset"] = priceData.QuoteAsset } - if priceData.AssetPrice != 0 { - flattened["AssetPrice"] = priceData.AssetPrice - } flattened["Scale"] = priceData.Scale @@ -119,7 +135,7 @@ type Oracle struct { Provider string // An array of up to 10 PriceData objects, each representing the price information for a token pair. // More than five PriceData objects require two owner reserves. - PriceDataSeries []PriceData + PriceDataSeries []PriceDataWrapper // The time the data was last updated, represented in Unix time. LastUpdateTime uint32 // An optional Universal Resource Identifier to reference price data off-chain. diff --git a/xrpl/ledger-entry-types/oracle_test.go b/xrpl/ledger-entry-types/oracle_test.go index 996478d4..10497e58 100644 --- a/xrpl/ledger-entry-types/oracle_test.go +++ b/xrpl/ledger-entry-types/oracle_test.go @@ -15,12 +15,12 @@ func TestPriceData_Flatten(t *testing.T) { testcases := []struct { name string priceData *PriceData - expected FlatPriceData + expected map[string]any }{ { name: "pass - empty", priceData: &PriceData{}, - expected: FlatPriceData{ + expected: map[string]any{ "Scale": uint8(0), }, }, @@ -32,13 +32,86 @@ func TestPriceData_Flatten(t *testing.T) { AssetPrice: 740, Scale: 3, }, - expected: FlatPriceData{ + expected: map[string]any{ "BaseAsset": "XRP", "QuoteAsset": "USD", - "AssetPrice": uint64(740), + "AssetPrice": "740", "Scale": uint8(3), }, }, + { + name: "pass - complete with currency more than 3 characters", + priceData: &PriceData{ + BaseAsset: "XRP", + QuoteAsset: "ACGBD", + AssetPrice: 740, + Scale: 3, + }, + expected: map[string]any{ + "BaseAsset": "XRP", + "QuoteAsset": "ACGBD", + "AssetPrice": "740", + "Scale": uint8(3), + }, + }, + } + + for _, testcase := range testcases { + t.Run(testcase.name, func(t *testing.T) { + assert.Equal(t, testcase.priceData.Flatten(), testcase.expected) + }) + } +} + +func TestPriceDataWrapper_Flatten(t *testing.T) { + testcases := []struct { + name string + priceData *PriceDataWrapper + expected map[string]any + }{ + { + name: "pass - empty", + priceData: &PriceDataWrapper{}, + expected: nil, + }, + { + name: "pass - complete", + priceData: &PriceDataWrapper{ + PriceData: PriceData{ + BaseAsset: "XRP", + QuoteAsset: "USD", + AssetPrice: 740, + Scale: 3, + }, + }, + expected: map[string]any{ + "PriceData": map[string]any{ + "BaseAsset": "XRP", + "QuoteAsset": "USD", + "AssetPrice": "740", + "Scale": uint8(3), + }, + }, + }, + { + name: "pass - complete with currency more than 3 characters", + priceData: &PriceDataWrapper{ + PriceData: PriceData{ + BaseAsset: "XRP", + QuoteAsset: "ACGBD", + AssetPrice: 740, + Scale: 3, + }, + }, + expected: map[string]any{ + "PriceData": map[string]any{ + "BaseAsset": "XRP", + "QuoteAsset": "ACGBD", + "AssetPrice": "740", + "Scale": uint8(3), + }, + }, + }, } for _, testcase := range testcases { diff --git a/xrpl/transaction/oracle_set.go b/xrpl/transaction/oracle_set.go index 2947efba..62dbf8d9 100644 --- a/xrpl/transaction/oracle_set.go +++ b/xrpl/transaction/oracle_set.go @@ -56,7 +56,7 @@ type OracleSet struct { // This field is required when creating a new Oracle ledger entry, but is optional for updates. AssetClass string `json:",omitempty"` // An array of up to 10 PriceData objects, each representing the price information for a token pair. More than five PriceData objects require two owner reserves. - PriceDataSeries []ledger.PriceData + PriceDataSeries []ledger.PriceDataWrapper } // TxType returns the TxType for OracleSet transactions. @@ -68,7 +68,7 @@ func (tx *OracleSet) TxType() TxType { func (tx *OracleSet) Flatten() map[string]interface{} { flattened := tx.BaseTx.Flatten() - flattened["TransactionType"] = tx.TxType() + flattened["TransactionType"] = tx.TxType().String() if tx.Account != "" { flattened["Account"] = tx.Account.String() @@ -90,9 +90,9 @@ func (tx *OracleSet) Flatten() map[string]interface{} { } if len(tx.PriceDataSeries) > 0 { - flattenedPriceDataSeries := make([]map[string]interface{}, 0, len(tx.PriceDataSeries)) - for _, priceData := range tx.PriceDataSeries { - flattenedPriceDataSeries = append(flattenedPriceDataSeries, priceData.Flatten()) + flattenedPriceDataSeries := make([]map[string]any, len(tx.PriceDataSeries)) + for i, priceDataWrapper := range tx.PriceDataSeries { + flattenedPriceDataSeries[i] = priceDataWrapper.Flatten() } flattened["PriceDataSeries"] = flattenedPriceDataSeries } @@ -120,8 +120,8 @@ func (tx *OracleSet) Validate() (bool, error) { } } - for _, priceData := range tx.PriceDataSeries { - if err := priceData.Validate(); err != nil { + for _, priceDataWrapper := range tx.PriceDataSeries { + if err := priceDataWrapper.PriceData.Validate(); err != nil { return false, err } } diff --git a/xrpl/transaction/oracle_set_test.go b/xrpl/transaction/oracle_set_test.go index 94a6da38..bd39dc63 100644 --- a/xrpl/transaction/oracle_set_test.go +++ b/xrpl/transaction/oracle_set_test.go @@ -24,7 +24,7 @@ func TestOracleSet_Flatten(t *testing.T) { name: "pass - empty", tx: &OracleSet{}, expected: map[string]interface{}{ - "TransactionType": OracleSetTx, + "TransactionType": OracleSetTx.String(), "OracleDocumentID": uint32(0), "LastUpdatedTime": uint32(0), }, @@ -43,17 +43,19 @@ func TestOracleSet_Flatten(t *testing.T) { URI: "https://example.com", LastUpdatedTime: 1715702400, AssetClass: "currency", - PriceDataSeries: []ledger.PriceData{ + PriceDataSeries: []ledger.PriceDataWrapper{ { - BaseAsset: "XRP", - QuoteAsset: "USD", - AssetPrice: 740, - Scale: 3, + PriceData: ledger.PriceData{ + BaseAsset: "XRP", + QuoteAsset: "USD", + AssetPrice: 740, + Scale: 3, + }, }, }, }, expected: map[string]interface{}{ - "TransactionType": OracleSetTx, + "TransactionType": OracleSetTx.String(), "Account": "r9cZA1mTh4KVPD5PXPBGVdqw9XRybCz6z", "Fee": "1000000", "Sequence": uint32(1), @@ -63,12 +65,14 @@ func TestOracleSet_Flatten(t *testing.T) { "URI": "https://example.com", "LastUpdatedTime": uint32(1715702400), "AssetClass": "currency", - "PriceDataSeries": []map[string]interface{}{ + "PriceDataSeries": []map[string]any{ { - "BaseAsset": "XRP", - "QuoteAsset": "USD", - "AssetPrice": uint64(740), - "Scale": uint8(3), + "PriceData": map[string]any{ + "AssetPrice": "740", + "BaseAsset": "XRP", + "QuoteAsset": "USD", + "Scale": uint8(3), + }, }, }, }, @@ -118,7 +122,7 @@ func TestOracleSet_Validate(t *testing.T) { Account: "r9cZA1mTh4KVPD5PXPBGVdqw9XRybCz6z", TransactionType: OracleSetTx, }, - PriceDataSeries: make([]ledger.PriceData, 100), + PriceDataSeries: make([]ledger.PriceDataWrapper, 100), }, expected: ErrOraclePriceDataSeriesItems{ Length: 100, @@ -132,9 +136,11 @@ func TestOracleSet_Validate(t *testing.T) { Account: "r9cZA1mTh4KVPD5PXPBGVdqw9XRybCz6z", TransactionType: OracleSetTx, }, - PriceDataSeries: []ledger.PriceData{ + PriceDataSeries: []ledger.PriceDataWrapper{ { - BaseAsset: "XRP", + PriceData: ledger.PriceData{ + BaseAsset: "XRP", + }, }, }, }, @@ -147,11 +153,13 @@ func TestOracleSet_Validate(t *testing.T) { Account: "r9cZA1mTh4KVPD5PXPBGVdqw9XRybCz6z", TransactionType: OracleSetTx, }, - PriceDataSeries: []ledger.PriceData{ + PriceDataSeries: []ledger.PriceDataWrapper{ { - BaseAsset: "XRP", - QuoteAsset: "USD", - Scale: 11, + PriceData: ledger.PriceData{ + BaseAsset: "XRP", + QuoteAsset: "USD", + Scale: 11, + }, }, }, }, @@ -167,11 +175,13 @@ func TestOracleSet_Validate(t *testing.T) { Account: "r9cZA1mTh4KVPD5PXPBGVdqw9XRybCz6z", TransactionType: OracleSetTx, }, - PriceDataSeries: []ledger.PriceData{ + PriceDataSeries: []ledger.PriceDataWrapper{ { - BaseAsset: "XRP", - QuoteAsset: "USD", - Scale: 10, + PriceData: ledger.PriceData{ + BaseAsset: "XRP", + QuoteAsset: "USD", + Scale: 10, + }, }, }, }, @@ -189,12 +199,14 @@ func TestOracleSet_Validate(t *testing.T) { URI: "https://example.com", LastUpdatedTime: 1715702400, AssetClass: "currency", - PriceDataSeries: []ledger.PriceData{ + PriceDataSeries: []ledger.PriceDataWrapper{ { - BaseAsset: "XRP", - QuoteAsset: "USD", - AssetPrice: 740, - Scale: 3, + PriceData: ledger.PriceData{ + BaseAsset: "XRP", + QuoteAsset: "USD", + AssetPrice: 740, + Scale: 3, + }, }, }, }, diff --git a/xrpl/transaction/types/authorize_credential.go b/xrpl/transaction/types/authorize_credential.go index b640b3f9..031039fc 100644 --- a/xrpl/transaction/types/authorize_credential.go +++ b/xrpl/transaction/types/authorize_credential.go @@ -1,3 +1,4 @@ +//revive:disable:var-naming package types // MaxAcceptedCredentials is the maximum number of accepted credentials. diff --git a/xrpl/transaction/types/authorize_credential_list.go b/xrpl/transaction/types/authorize_credential_list.go index b6d5a911..c914e323 100644 --- a/xrpl/transaction/types/authorize_credential_list.go +++ b/xrpl/transaction/types/authorize_credential_list.go @@ -1,3 +1,4 @@ +//revive:disable:var-naming package types // AuthorizeCredentialList represents a list of AuthorizeCredential entries with validation and flattening. diff --git a/xrpl/transaction/types/authorize_credentials.go b/xrpl/transaction/types/authorize_credentials.go index 1d544f57..d22a00be 100644 --- a/xrpl/transaction/types/authorize_credentials.go +++ b/xrpl/transaction/types/authorize_credentials.go @@ -1,3 +1,4 @@ +//revive:disable:var-naming package types import ( diff --git a/xrpl/transaction/types/credential.go b/xrpl/transaction/types/credential.go index 5b85bce4..3afc2e32 100644 --- a/xrpl/transaction/types/credential.go +++ b/xrpl/transaction/types/credential.go @@ -1,3 +1,4 @@ +//revive:disable:var-naming package types // Credential represents an XRPL credential, including the issuer address and credential type. diff --git a/xrpl/transaction/types/currency_amount.go b/xrpl/transaction/types/currency_amount.go index 6fe606ff..bc18c867 100644 --- a/xrpl/transaction/types/currency_amount.go +++ b/xrpl/transaction/types/currency_amount.go @@ -1,3 +1,4 @@ +//revive:disable:var-naming package types import ( diff --git a/xrpl/transaction/types/domain.go b/xrpl/transaction/types/domain.go index 523a505e..ddd44dc4 100644 --- a/xrpl/transaction/types/domain.go +++ b/xrpl/transaction/types/domain.go @@ -1,3 +1,4 @@ +//revive:disable:var-naming package types // Domain returns the domain that owns this account, as a string of hex representing the. diff --git a/xrpl/transaction/types/domain_id.go b/xrpl/transaction/types/domain_id.go index b4ea5d73..38266e02 100644 --- a/xrpl/transaction/types/domain_id.go +++ b/xrpl/transaction/types/domain_id.go @@ -1,3 +1,4 @@ +//revive:disable:var-naming package types // DomainID returns the domain ID as a string. diff --git a/xrpl/transaction/types/errors.go b/xrpl/transaction/types/errors.go index e6876849..733729f1 100644 --- a/xrpl/transaction/types/errors.go +++ b/xrpl/transaction/types/errors.go @@ -1,3 +1,4 @@ +//revive:disable:var-naming package types import "errors" diff --git a/xrpl/transaction/types/issued_currency.go b/xrpl/transaction/types/issued_currency.go index 7fd1f2a1..5879ac4c 100644 --- a/xrpl/transaction/types/issued_currency.go +++ b/xrpl/transaction/types/issued_currency.go @@ -1,3 +1,4 @@ +//revive:disable:var-naming package types // IssuedCurrency represents an amount of a non-XRP currency issued by an account. diff --git a/xrpl/transaction/types/wallet_locator.go b/xrpl/transaction/types/wallet_locator.go index b472cef4..d3479a9d 100644 --- a/xrpl/transaction/types/wallet_locator.go +++ b/xrpl/transaction/types/wallet_locator.go @@ -1,3 +1,4 @@ +//revive:disable:var-naming package types // WalletLocator returns a pointer to a Hash256 representing an arbitrary 256-bit value (optional).