ccxt k线数据_CCXT中文开发手册

链上交易数据结构

ccxt库中,链上交易(Transaction)的数据结构如下:

{

'info': { ... }, // the JSON response from the exchange as is

'id': '123456', // exchange-specific transaction id, string

'txid': '0x68bfb29821c50ca35ef3762f887fd3211e4405aba1a94e448a4f218b850358f0',

'timestamp': 1534081184515, // timestamp in milliseconds

'datetime': '2018-08-12T13:39:44.515Z', // ISO8601 string of the timestamp

'addressFrom': '0x38b1F8644ED1Dbd5DcAedb3610301Bf5fa640D6f', // sender

'address': '0x02b0a9b7b4cDe774af0f8e47cb4f1c2ccdEa0806', // "from" or "to"

'addressTo': '0x304C68D441EF7EB0E2c056E836E8293BD28F8129', // receiver

'tagFrom', '0xabcdef', // "tag" or "memo" or "payment_id" associated with the sender

'tag': '0xabcdef' // "tag" or "memo" or "payment_id" associated with the address

'tagTo': '0xhijgklmn', // "tag" or "memo" or "payment_id" associated with the receiver

'type': 'deposit', // or 'withdrawal', string

'amount': 1.2345, // float (does not include the fee)

'currency': 'ETH', // a common unified currency code, string

'status': 'pending', // 'ok', 'failed', 'canceled', string

'updated': undefined, // UTC timestamp of most recent status change in ms

'comment': 'a comment or message defined by the user if any',

'fee': { // the entire fee structure may be undefined

'currency': 'ETH', // a unified fee currency code

'cost': 0.1234, // float

'rate': undefined, // approximately, fee['cost'] / amount, float

},

}

补充说明:

如果交易所没有设置交易的方向(买入/卖出), addressFrom 或 addressTo 的值可能为undefined/None/null

address字段的含义是交易所相关的。有些情况下该字段的值表示发送方的地址,有时则可能表示接收方的地址。

update字段表示最近的资金操作的状态变化,以毫秒计算的UTC时间戳。

取决于交易所的支持与否,fee字段的内容可能缺失

comment字段的值可能是undefined/None/null,否则表示用户创建链上交易时传入的消息或备注

处理标签(tag)和地址(address)时需要谨慎,标签不是用户任意指定的字符串,不能在

标签中发送用户消息和评论。标签的目的是正确定位你的钱包。因此应当遵循交易所的要求。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值