Skip to content

Support for New 'Data' Field in chunk API receipt Response #17

@UranusLin

Description

@UranusLin

Hello near-java-api Team,

I've encountered an issue related to the handling of NEAR blockchain's API responses in the ReceiptData class. Recently, it appears that the NEAR API response format has been updated, introducing a new data type 'Data'. This new format isn't currently supported by the ReceiptData class in your library.

Issue Description:
The original API response format, which is currently supported by your library, looks like this:

{
    "predecessor_id": "system",
    "receipt": {
        "Action": {
            "actions": [
                {
                    "Transfer": {
                        "deposit": "1168608495296525854253"
                    }
                }
            ],
            "gas_price": "0",
            "input_data_ids": [],
            "output_data_receivers": [],
            "signer_id": "vo8v1h89c37f.users.dev-kaiching.testnet",
            "signer_public_key": "ed25519:QQ9SRodinWiKKwpHYDzD2F3cMY4VYLqWC1k581oY3pf"
        }
    },
    "receipt_id": "AQ81WBKzLqL8tP7WdvUVYE4MgRGbPvTeJx8zsQJKjoqF",
    "receiver_id": "vo8v1h89c37f.users.dev-kaiching.testnet"
}

The new API response format includes an additional 'Data' field as shown below:

{
    "predecessor_id": "wallet.dev-kaiching.testnet",
    "receipt": {
        "Data": {
            "data": "",
            "data_id": "7WNSBrRGVVkr9zUj4GbAP893sQ1QktoeZPkhjsi5qpbS"
        }
    },
    "receipt_id": "HKwaZSD3P8rDxpYMnTts4GR6qKmtTbPHi9PBK1B7Cwr5",
    "receiver_id": "earn.dev-kaiching.testnet"
}

Suggested Solution:
I propose an update to the ReceiptData class to accommodate this new 'Data' field. This could involve adding a new property to the class to parse and store this additional data from the JSON response.

Thank you for your attention to this matter!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions