-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ANCHOR-849] Add
get_transaction
rpc method (#1112)
* wip * address comments
- Loading branch information
Showing
15 changed files
with
1,360 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
openrpc/src/anchor-platform/examples/platform_transaction.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
{ | ||
"platformTransactionResponse": { | ||
"name": "platformTransactionResponse", | ||
"value": { | ||
"id": "1c186184-09ee-486c-82a7-aa7a0ab1119d", | ||
"sep": "31", | ||
"kind": "receive", | ||
"status": "completed", | ||
"funding_method": "SWIFT", | ||
"amount_expected": { | ||
"amount": "100", | ||
"asset": "iso4217:USD" | ||
}, | ||
"amount_in": { | ||
"amount": "100.0000", | ||
"asset": "iso4217:USD" | ||
}, | ||
"amount_out": { | ||
"amount": "98.0000000", | ||
"asset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5" | ||
}, | ||
"fee_details": { | ||
"total": "2.0000", | ||
"asset": "iso4217:USD" | ||
}, | ||
"quote_id": "quote-id", | ||
"message": "Please don\u0027t forget to foo bar", | ||
"refunds": { | ||
"amount_refunded": { | ||
"amount": "90.0000", | ||
"asset": "iso4217:USD" | ||
}, | ||
"amount_fee": { | ||
"amount": "8.0000", | ||
"asset": "iso4217:USD" | ||
}, | ||
"payments": [ | ||
{ | ||
"id": "1111", | ||
"id_type": "stellar", | ||
"amount": { | ||
"amount": "50.0000", | ||
"asset": "iso4217:USD" | ||
}, | ||
"fee": { | ||
"amount": "4.0000", | ||
"asset": "iso4217:USD" | ||
} | ||
}, | ||
{ | ||
"id": "2222", | ||
"id_type": "stellar", | ||
"amount": { | ||
"amount": "40.0000", | ||
"asset": "iso4217:USD" | ||
}, | ||
"fee": { | ||
"amount": "4.0000", | ||
"asset": "iso4217:USD" | ||
} | ||
} | ||
] | ||
}, | ||
"stellar_transactions": [ | ||
{ | ||
"id": "stellar-tx-id", | ||
"memo": "my-memo", | ||
"memo_type": "text", | ||
"envelope": "here_comes_the_envelope", | ||
"payments": [ | ||
{ | ||
"id": "payment-id", | ||
"amount": { | ||
"amount": "100.0000", | ||
"asset": "iso4217:USD" | ||
}, | ||
"payment_type": "payment", | ||
"source_account": "GB4GJAV4Q7DPGU7WI3H5TMVKEYZJ4JFLFEF3O3TRJKDPXK7NAMRBXWFL", | ||
"destination_account": "GDIN5ZULIOT5YPBIXJXFGNH4TCNTDKIA4ZF6QQE3S2P5P44BHCQQJNDC" | ||
} | ||
] | ||
} | ||
], | ||
"external_transaction_id": "external-tx-id", | ||
"customers": { | ||
"sender": { | ||
"id": "sender-id" | ||
}, | ||
"receiver": { | ||
"id": "receiver-id" | ||
} | ||
}, | ||
"creator": { | ||
"id": "creator-id" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"name": "get_transaction", | ||
"summary": "Retrieve a transaction.", | ||
"description": "Retrieve a transaction by its ID.", | ||
"paramStructure": "by-name", | ||
"tags": [ | ||
{ "name": "SEP-6" }, | ||
{ "name": "SEP-24" }, | ||
{ "name": "SEP-31" } | ||
], | ||
"params": [ | ||
{ "$ref": "#/components/contentDescriptors/id" } | ||
], | ||
"result": { | ||
"name": "get_transactionResponse", | ||
"schema": { | ||
"$ref": "#/components/schemas/platform_transaction" | ||
} | ||
}, | ||
"examples": [ | ||
{ | ||
"name": "get_transactionExample", | ||
"description": "Example request to the `get_transaction` method.", | ||
"params": [ | ||
{ "$ref": "#/components/examples/id" } | ||
], | ||
"result": { | ||
"$ref": "#/components/examples/platformTransactionResponse" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"source_account": { | ||
"title": "source_account", | ||
"description":"The account being debited in the Stellar Network.", | ||
"type": "string" | ||
}, | ||
"destination_account": { | ||
"title": "destination_account", | ||
"description":"The account being credited in the Stellar Network.", | ||
"type": "string" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"stellar_id": { | ||
"description": "A object that identify end-user. \nFor a SEP-12 customer, the `id` field should be sufficient to fully identify the customer in the business' Backend. \nFor a SEP-31 Sending Anchor, the `account` and `memo` fields should be used. \nFor a SEP-6 or SEP-24 Anchor, the `account` and `memo` fields should be used.", | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"description": "The `id` of the customer registered through SEP-12." | ||
}, | ||
"account": { | ||
"type": "string", | ||
"description": "Either the Stellar account or Muxed account address of the on-chain entity." | ||
}, | ||
"memo": { | ||
"type": "string", | ||
"description": "The memo value identifying a customer with a shared account, where the shared account is `account`." | ||
} | ||
} | ||
}, | ||
"customers": { | ||
"description": "The Identification info of the sending and receiving customers. If they were created through [SEP-12](https://stellar.org/protocol/sep-12),\n this object should contain the SEP-12 customer `id`. Otherwise, the `account` address of the customer.", | ||
"type": "object", | ||
"properties": { | ||
"sender": { | ||
"$ref": "#/components/schemas/stellar_id" | ||
}, | ||
"receiver": { | ||
"$ref": "#/components/schemas/stellar_id" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"memo": { | ||
"title": "memo", | ||
"type": "string" | ||
}, | ||
"memo_type": { | ||
"title": "memo_type", | ||
"description": "The memo type of the transaction in the Stellar network. Should be present if memo is not null.", | ||
"type": "string", | ||
"enum": ["id", "hash", "text"] | ||
} | ||
} |
107 changes: 107 additions & 0 deletions
107
openrpc/src/anchor-platform/schemas/platform_transaction.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
{ | ||
"platform_transaction": { | ||
"title": "Platform Transaction", | ||
"description": "A platform transaction object", | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"$ref": "#/components/schemas/transaction_id" | ||
}, | ||
"sep": { | ||
"$ref": "#/components/schemas/sep" | ||
}, | ||
"kind": { | ||
"$ref": "#/components/schemas/kind" | ||
}, | ||
"status": { | ||
"$ref": "#/components/schemas/status" | ||
}, | ||
"funding_method": { | ||
"description": "Funding method used for transferring or settling assets.", | ||
"type": "string" | ||
}, | ||
"type": { | ||
"description": "DEPRECATED in favor of funding_method. Type of deposit, withdrawal or receive.", | ||
"type": "string" | ||
}, | ||
"amount_expected": { | ||
"$ref": "#/components/schemas/amount_expected" | ||
}, | ||
"amount_in": { | ||
"$ref": "#/components/schemas/amount_in" | ||
}, | ||
"amount_out": { | ||
"$ref": "#/components/schemas/amount_out" | ||
}, | ||
"fee_details": { | ||
"$ref": "#/components/schemas/fee_details" | ||
}, | ||
"quote_id": { | ||
"$ref": "#/components/schemas/quote_id" | ||
}, | ||
"started_at": { | ||
"$ref": "#/components/schemas/started_at" | ||
}, | ||
"updated_at": { | ||
"$ref": "#/components/schemas/updated_at" | ||
}, | ||
"completed_at": { | ||
"$ref": "#/components/schemas/completed_at" | ||
}, | ||
"transfer_received_at": { | ||
"$ref": "#/components/schemas/transfer_received_at" | ||
}, | ||
"user_action_required_by": { | ||
"$ref": "#/components/schemas/user_action_required_by" | ||
}, | ||
"message": { | ||
"description": "Human readable explanation of transaction status", | ||
"$ref": "#/components/schemas/message" | ||
}, | ||
"refunds": { | ||
"$ref": "#/components/schemas/refunds" | ||
}, | ||
"stellar_transactions": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/stellar_transaction" | ||
} | ||
}, | ||
"source_account": { | ||
"$ref": "#/components/schemas/source_account" | ||
}, | ||
"destination_account": { | ||
"$ref": "#/components/schemas/destination_account" | ||
}, | ||
"external_transaction_id": { | ||
"$ref": "#/components/schemas/transaction_id" | ||
}, | ||
"memo": { | ||
"$ref": "#/components/schemas/memo" | ||
}, | ||
"memo_type": { | ||
"$ref": "#/components/schemas/memo_type" | ||
}, | ||
"refund_memo": { | ||
"$ref": "#/components/schemas/memo" | ||
}, | ||
"refund_memo_type": { | ||
"$ref": "#/components/schemas/memo_type" | ||
}, | ||
"client_domain": { | ||
"description": "The domain of the client.", | ||
"type": "string" | ||
}, | ||
"client_name": { | ||
"description": "The domain of the client.", | ||
"type": "string" | ||
}, | ||
"customers": { | ||
"$ref": "#/components/schemas/customers" | ||
}, | ||
"creator": { | ||
"$ref": "#/components/schemas/stellar_id" | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.