Stellarで、署名済みトランザクションを生成して、別のマシンからトランザクションを送信する方法について。
参考 https://www.stellar.org/developers/horizon/reference/resources/transaction.html
XDR
XDRとは、External Data Representationの略で、別のstellar coreでトランザクションを扱うためのデータ形式。JSONなどではなくバイナリで、stellar SDKにデータ構造の処理が含まれている。
Transactionに、xdrが入っている。
Attribute | Type | comment |
---|---|---|
envelope_xdr | string | A base64 encoded string of the raw TransactionEnvelope xdr struct for this transaction |
result_xdr | string | A base64 encoded string of the raw TransactionResultPair xdr struct for this transaction |
result_meta_xdr | string | A base64 encoded string of the raw TransactionMeta xdr struct for this transaction |
fee_meta_xdr | string | A base64 encoded string of the raw LedgerEntryChanges xdr struct produced by taking fees for this transaction. |
Post Transaction
参考 Post Transaction
/transactions
パラメータtxにBase64エンコードしたenvelope_xdrを指定する。(例:"AAAAAO…f4yDBA==")
name | loc | notes | example | description |
---|---|---|---|---|
tx | body | required | AAAAAO…f4yDBA== | Base64 representation of transaction envelope XDR |
Response
Name | Type | |
---|---|---|
hash | string | A hex-encoded hash of the submitted transaction. |
ledger | number | The ledger number that the submitted transaction was included in. |
envelope_xdr | string | A base64 encoded TransactionEnvelope XDR object. |
result_xdr | string | A base64 encoded TransactionResult XDR object. |
result_meta_xdr | string | A base64 encoded TransactionMeta XDR object. |