Skip to content

feat: Automatically approve blocked deposits#2198

Open
MihaiAndrei98 wants to merge 2 commits into
mainfrom
andrei/int1-632
Open

feat: Automatically approve blocked deposits#2198
MihaiAndrei98 wants to merge 2 commits into
mainfrom
andrei/int1-632

Conversation

@MihaiAndrei98
Copy link
Copy Markdown

Context

  • fixes Linear Issue INT1-632 Automatically approve transactions that are stuck in manual approval phase in GateHub

Changes

Got list of pending manual approval transactions from GateHub
Automatically approved above transactions.

@github-actions github-actions Bot added package: wallet/backend Wallet backend implementations type: source Source changes labels May 22, 2026
}
}

async approveTransactions() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asa the trx are GateHub trx, I think it should be in gatehub service

url,
JSON.stringify(payload)
)
return response
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leave a new line between blocks and returns for better readability

async approveTransactions() {
try {
const transactions = await this.gateHubClient.getPendingTransactions()
const pendingTransactions = transactions.filter(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this filter necessary?

Copy link
Copy Markdown
Contributor

@Tymmmy Tymmmy May 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, getPendingTransactions should already filter for state=3


async processResources() {
process.nextTick(() => this.processPendingTransactions())
setInterval(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the same approach with setTimeout after getting a response, this why the next processing will be set only after the previous one finishes and it will avoid parallel processing in case of slow responses

try {
await this.gateHubClient.approvePendingTransactions(transaction.uuid)
} catch (err) {
console.error(`Error: ${err}`)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use logger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: wallet/backend Wallet backend implementations type: source Source changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants