/payg/:deployment API
new header: X-Channel-Block: multiple or X-Channel-Block: single.
when is multiple, it will use a multiple times signature for query without sign agian.
the AUTHORIZATION keep use base64 style.
QueryState
new encode: QueryState -> serialize to bytes -> base64 encode
old encode: QueryState -> json -> serialize to bytes -> base64 encode, old still on support, but in future it will be deleted.
new encode bytes:
channel_id: [0, 32), // u256 with big endian
indexer: [32, 52), // address
consumer: [52, 72), // address
spent: [72, 104), // u256 with big endian
remote: [104, 136), // u256 with big endian
is_final: 36, // 0 is false, 1 is true
indexer_sign: [137..202), // signature with r, s, v
consumer_sign: [202..267), // signature with r, s, v
MultipleQueryState encode bytes
active: 0, // 0 is ok, 1 is ok, but need pay middle, 2 is failure, and need pay end
channel_id: [1..33), // u256 with big endian
start: [33..65), // u256 with big endian
end: [65..97), // u256 with big endian
sign: [97..162),// signature with r, s, v
/payg-pay API, use for pay with QueryState
use new base64 encode style with QueryState, and put it in body. response also use base64 style.
CHANGELOGS:
/payg/:deployment
API new header:X-Channel-Block: multiple
orX-Channel-Block: single
. when ismultiple
, it will use a multiple times signature for query without sign agian. the AUTHORIZATION keep use base64 style.QueryState
new encode:QueryState -> serialize to bytes -> base64 encode
old encode:QueryState -> json -> serialize to bytes -> base64 encode
, old still on support, but in future it will be deleted.new encode
bytes
:MultipleQueryState
encodebytes
/payg-pay
API, use for pay withQueryState
use new base64 encode style with QueryState, and put it in body. response also use base64 style.