Skip to content

Commit 92b1ae4

Browse files
authored
fix: Ton reported issues (#578)
1 parent 6f2bcea commit 92b1ae4

File tree

5 files changed

+17
-6
lines changed

5 files changed

+17
-6
lines changed

android/lib/src/main/res/raw/trust_min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bun.lockb

-2.03 KB
Binary file not shown.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:5db373ecd452dcc54638df9768dfc737145c26e83a952a140aaf3236b11eed2c
3-
size 791008
2+
oid sha256:8995f57f23b65f57ca18d8ae11ef39734012a327f772401040c30d20c23f3f53
3+
size 791291

packages/ton/MobileAdapter.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,15 @@ export class MobileAdapter {
4646
// Internally we use nonBounceable value, here we remove it from the response
4747
return JSON.parse(res).map((item: ConnectItemReply) => {
4848
if (item.name === 'ton_addr') {
49-
const { nonBounceable, ...rest } = item as TonAddressItemReply & {
50-
nonBounceable: string;
51-
};
49+
const { nonBounceable, type, ...rest } =
50+
item as TonAddressItemReply & {
51+
nonBounceable: string;
52+
type?: string;
53+
};
54+
55+
if (type) {
56+
console.warn('type parameter removed from request');
57+
}
5258

5359
return rest;
5460
}

packages/ton/TonBridge.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export class TonBridge implements TonConnectBridge {
4040

4141
private provider!: TonProvider;
4242
private callbacks: TonConnectCallback[] = [];
43+
private connectionAttempts = 0;
4344

4445
constructor(config: ITonBridgeConfig, provider: TonProvider) {
4546
if (config) {
@@ -82,7 +83,10 @@ export class TonBridge implements TonConnectBridge {
8283
if ((items as any)?.event === 'connect_error') {
8384
return this.emit(items as any);
8485
} else {
86+
this.connectionAttempts += 1;
87+
8588
return this.emit({
89+
id: this.connectionAttempts,
8690
event: 'connect',
8791
payload: { items, device: this.deviceInfo },
8892
});
@@ -123,6 +127,7 @@ export class TonBridge implements TonConnectBridge {
123127
);
124128

125129
return this.emit({
130+
id: this.connectionAttempts,
126131
event: 'connect',
127132
payload: {
128133
items,

0 commit comments

Comments
 (0)