Skip to content

Conversation

@Ivan-Mahda
Copy link
Contributor

Purpose

_Describe the purpose of the pull request, link to issue describing the problem, etc.

Changes

All changes I have at the moment

Checklist

  • My code follows the style of this project.
  • The code compiles without warnings.
  • I have performed a self-review of the changes.
  • I have documented my code, in particular the intent of the
    hard-to-understand areas.
  • (If necessary) I have updated the CHANGELOG.

CLA acceptance

_Remove if not applicable.

By submitting the contribution I accept the terms and conditions of the
Contributor License Agreement v1.0

msinghster and others added 3 commits December 15, 2025 10:44
Changed TokenHolder to CborAccountAddress
Updated sponsored transactions UI according to design
Fixed transaction handler functions
Removed TS ignore
@Ivan-Mahda Ivan-Mahda marked this pull request as ready for review January 9, 2026 00:31
@Ivan-Mahda Ivan-Mahda requested a review from soerenbf January 9, 2026 09:16
Copy link
Collaborator

@soerenbf soerenbf left a comment

Choose a reason for hiding this comment

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

I would suggest applying the changes suggested here, but otherwise it looks good to me and works with the example.

Great job! 🥇

Comment on lines 270 to 271
type: LaxNumberEnumValue<AccountTransactionType.Transfer>,
payload: SignableTransaction
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a good reason to have the type as an argument as well? It's used in sendTransaction to give better type information with regards to which payload is supported for a transaction type. In the case of the SignableTransaction the transaction type is already available in the payload of the transaction.

Suggested change
type: LaxNumberEnumValue<AccountTransactionType.Transfer>,
payload: SignableTransaction
payload: SignableTransaction

See

Comment on lines 189 to 199
type: AccountTransactionType,
payload: SignableTransaction
): Promise<string> {
const response = await this.messageHandler.sendMessage<MessageStatusWrapper<string>>(
MessageType.SendSponsoredTransaction,
{
type,
accountAddress,
payload: stringify(payload),
}
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would change to

Suggested change
type: AccountTransactionType,
payload: SignableTransaction
): Promise<string> {
const response = await this.messageHandler.sendMessage<MessageStatusWrapper<string>>(
MessageType.SendSponsoredTransaction,
{
type,
accountAddress,
payload: stringify(payload),
}
);
transaction: SignableTransaction
): Promise<string> {
const response = await this.messageHandler.sendMessage<MessageStatusWrapper<string>>(
MessageType.SendSponsoredTransaction,
{
accountAddress,
transaction: stringify(Transaction.toJSON(transaction)),
}
);

Comment on lines 67 to 77
const sponsorResponse = await submitPayloadToSponsor(
AccountAddress.fromBase58(currentAccountAddress),
Transaction.toJSON(transaction)
);

console.log('sponsorResponse', sponsorResponse);

return provider
.sendSponsoredTransaction(currentAccountAddress, 3, sponsorResponse)
.then((sig) => alert(JSON.stringify(sig)))
.catch(alert);
Copy link
Collaborator

Choose a reason for hiding this comment

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

And consequently

Suggested change
const sponsorResponse = await submitPayloadToSponsor(
AccountAddress.fromBase58(currentAccountAddress),
Transaction.toJSON(transaction)
);
console.log('sponsorResponse', sponsorResponse);
return provider
.sendSponsoredTransaction(currentAccountAddress, 3, sponsorResponse)
.then((sig) => alert(JSON.stringify(sig)))
.catch(alert);
const sponsorResponse = await submitPayloadToSponsor(
AccountAddress.fromBase58(currentAccountAddress),
Transaction.toJSON(transaction)
);
const sponsoredParsed = Transaction.signableFromJSON(sponsorResponse);
console.log('sponsorResponse', sponsorResponse);
return provider
.sendSponsoredTransaction(currentAccountAddress, sponsoredParsed)
.then((sig) => alert(JSON.stringify(sig)))
.catch(alert);

Comment on lines 118 to 128
const sponsorResponse = await submitPayloadToSponsor(
AccountAddress.fromBase58(currentAccountAddress),
Transaction.toJSON(transaction)
);

console.log('sponsorResponse', sponsorResponse);

return provider
.sendSponsoredTransaction(currentAccountAddress, 27, sponsorResponse)
.then((sig) => alert(JSON.stringify(sig)))
.catch(alert);
Copy link
Collaborator

Choose a reason for hiding this comment

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

And here

Suggested change
const sponsorResponse = await submitPayloadToSponsor(
AccountAddress.fromBase58(currentAccountAddress),
Transaction.toJSON(transaction)
);
console.log('sponsorResponse', sponsorResponse);
return provider
.sendSponsoredTransaction(currentAccountAddress, 27, sponsorResponse)
.then((sig) => alert(JSON.stringify(sig)))
.catch(alert);
const sponsorResponse = await submitPayloadToSponsor(
AccountAddress.fromBase58(currentAccountAddress),
Transaction.toJSON(transaction)
);
console.log('sponsorResponse', sponsorResponse);
const sponsoredParsed = Transaction.signableFromJSON(sponsorResponse);
return provider
.sendSponsoredTransaction(currentAccountAddress, sponsoredParsed)
.then((sig) => alert(JSON.stringify(sig)))
.catch(alert);


## Unreleased

- Added support for Sponsored Transactions handling. With new method `sendSponsoredTransaction` in wallet-api.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- Added support for Sponsored Transactions handling. With new method `sendSponsoredTransaction` in wallet-api.
## 2.7.1
- Added support for Sponsored Transactions handling. With new method `sendSponsoredTransaction` in wallet-api.

Update transaction type parse from, sponsored transaction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants