feat: Add Horizon-based transaction tracking and keyring settlement for trustline operation status tracking#51
feat: Add Horizon-based transaction tracking and keyring settlement for trustline operation status tracking#51
Conversation
| @@ -48,10 +50,15 @@ export const TrackTransactionParamsStruct = type({ | |||
| txId: nonempty(string()), | |||
| scope: KnownCaip2ChainIdStruct, | |||
| accountIds: nonempty(array(UuidStruct)), | |||
There was a problem hiding this comment.
just wonder do we need accountIds
becoz txId is the source of truth, and we should only play with the accounts in the tx
| attempt: attemptRaw ?? 0, | ||
| }); | ||
|
|
||
| const accounts = await this.#accountService.findByIds(accountIds); |
There was a problem hiding this comment.
i think the idea is first poll transactions,
so we have to make the txid is exist first, and we know what accounts is invoke from that transaction
then if a status update
we update the tx status from the sender (add todo to remove it, becoz if we do txn history sync, it will be racing condition)
then we find the accounts (
becoz you dont use background job, but it will ensure the sync happen after status confirm,
however, keep in mind horizon is later than RPC
)
and we start to sync accounts in the transaction
| * @param scope - CAIP-2 chain id (Horizon endpoint). | ||
| * @returns `pending` when the tx is not yet available (404); `success` / `failed` when present. | ||
| */ | ||
| async getHorizonTransactionInclusionStatus( |
There was a problem hiding this comment.
do we still need this method?
| { | ||
| "name": "@metamask/stellar-wallet-snap", | ||
| "version": "0.0.1", | ||
| "version": "0.0.1-dev.170", |
There was a problem hiding this comment.
do we need to update the version?
| * @param params.accountIds - Accounts that may hold the tx (from the track job). | ||
| * @param params.status - {@link TransactionStatus.Confirmed} or {@link TransactionStatus.Failed}. | ||
| */ | ||
| async updateKeyringTransactionStatus(params: { |
There was a problem hiding this comment.
add a todo comment to make sure we will drop this txn history scanning was done
Explanation
References
Checklist