Skip to content

Commit 13d22bc

Browse files
committed
feat(sdk): enhance subscription request handling with dynamic 'from' and 'network' fields
1 parent bf5edef commit 13d22bc

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/sdk/src/ton-connect.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,9 +565,14 @@ export class TonConnect implements ITonConnect {
565565

566566
this.tracker.trackCreateSubscriptionV2Initiated(this.wallet, data);
567567

568+
const from = data.from ?? this.account!.address; // TODO: verify if data.from is needed or can be removed in favor of always using this.account!.address
569+
const network = data.network ?? this.account!.chain;
570+
568571
const response = await this.provider!.sendRequest(
569572
createSubscriptionV2Parser.convertToRpcRequest({
570573
...data,
574+
from,
575+
network,
571576
valid_until: data.validUntil,
572577
subscription: {
573578
...data.subscription,
@@ -619,9 +624,14 @@ export class TonConnect implements ITonConnect {
619624

620625
this.tracker.trackCancelSubscriptionV2Initiated(this.wallet, data);
621626

627+
const from = data.from ?? this.account!.address; // TODO: verify if data.from is needed or can be removed in favor of always using this.account!.address
628+
const network = data.network ?? this.account!.chain;
629+
622630
const response = await this.provider!.sendRequest(
623631
cancelSubscriptionV2Parser.convertToRpcRequest({
624632
...data,
633+
from,
634+
network,
625635
valid_until: data.validUntil,
626636
extension_address: data.extensionAddress
627637
}),

0 commit comments

Comments
 (0)