<Swap> Interface

Obtain the calldata information of the swap through the txInfo returned by the Price Inquiry Interface: for the wallet to call

Request Address: /api/v1/meta/swap

Request Method: POST

Request Parameter:

Field Name
Field Description
Type
Required or not
Notes

equipmentNo

Device id

string

Y

userAddr

Initiating transaction user address

string

Y

txInfo

Price inquiry information

Object

Y

Need submit txinfo in the original format

platformId

Platform primary key id

integer

Y

List interface return to platform unique ID

orderSide

1:Buy,0:Sell

string

Y

nftId

NFT primary key id

integer

Y

List interface return to NFT unique ID

Output Parameter:

Field Name
Field Description
Type

from

Transaction initiate address

string

to

Called contract address

string

value

Call contract amount

string

gas

Gas Limit

integer

data

Call contract data

string

Input Example:

{
    "equipmentNo": "0x76336d2903e8f6d62cc3f5d0528310",
    "userAddr": "0x76336d2903e8f6d62cc3f5d05283108e3d2785e0",
    "txInfo": {
        "fromTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
        "fromChain": "BSC",
        "orderId": 420532,
        "isOrigin": true
    },
    "platformId": "386405400144891905",
    "orderSide": "1",
    "nftId": "392206623639753728"
}

Output Example:

{
    "resCode": "100",
    "resMsg": "Success",
    "data": {
        "txData": {
            "from": "0x76336d2903e8f6d62cc3f5d05283108e3d2785e0",
            "to": "0x76265575b884f2f7b26b6071e26ce17235184053",
            "value": "0x7bfd5d76a94000",
            "gas": 400000,
            "data": "0xab834bab00000000000000000000000076265575b884f2f7b26b6071e26ce1723518405300000000000000000000000076336d2903e8f6d62cc3f5d05283108e3d2785e0000000000000000000000000a1f4de8b9d05f78ee01cfd9e175eb60bb8fd677200000000000000000000000000000000000000000000000000000000000000000000000000000000000000009f0225d5c92b9cee4024f6406c4f13e546fd91a80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000076265575b884f2f7b26b6071e26ce17235184053000000000000000000000000a1f4de8b9d05f78ee01cfd9e175eb60bb8fd6772000000000000000000000000000000000000000000000000000000000000000000000000000000000000000046b8a16a8e40a1e8b32ecad531fdf00104471fb60000000000000000000000009f0225d5c92b9cee4024f6406c4f13e546fd91a80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007bfd5d76a940000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006207d01800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000017eee84ddc000000000000000000000000000000000000000000000000000000000000000c8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007bfd5d76a940000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006207d01800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000017eee84ddc00000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006a0000000000000000000000000000000000000000000000000000000000000074000000000000000000000000000000000000000000000000000000000000007e0000000000000000000000000000000000000000000000000000000000000088000000000000000000000000000000000000000000000000000000000000009200000000000000000000000000000000000000000000000000000000000000940000000000000000000000000000000000000000000000000000000000000001b000000000000000000000000000000000000000000000000000000000000001b712b2c7fdd85a0976c696af82e1b3d366126e002b1718f82357a10558a98d04d181c9bbd0c34524bea6d50b0204a058df5cee1e216eaf9bc8f1ff2eccff4b66c712b2c7fdd85a0976c696af82e1b3d366126e002b1718f82357a10558a98d04d181c9bbd0c34524bea6d50b0204a058df5cee1e216eaf9bc8f1ff2eccff4b66c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006423b872dd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000076336d2903e8f6d62cc3f5d05283108e3d2785e000000000000000000000000000000000000000000000000000000000000fe68400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006423b872dd000000000000000000000000a1f4de8b9d05f78ee01cfd9e175eb60bb8fd6772000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000fe68400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006400000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
        }
    }
}

Postman Call Example

Last updated