Skip to content

Commit

Permalink
chore: rebase with main
Browse files Browse the repository at this point in the history
  • Loading branch information
y3fers0n committed Oct 30, 2024
2 parents 8cb23f1 + ff8bb66 commit 5eacf3e
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 19 deletions.
44 changes: 33 additions & 11 deletions android/lib/src/main/res/raw/trust_min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/cosmos/CosmosProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class CosmosProvider extends BaseProvider implements ICosmosProvider {
},
});

return Buffer.from(hash, 'hex');
return new Uint8Array(Buffer.from(hash, 'hex'));
}

async signArbitrary(
Expand Down
4 changes: 2 additions & 2 deletions packages/ios-web3-provider/swift/trust-min.js
Git LFS file not shown
6 changes: 4 additions & 2 deletions packages/solana/SolanaProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ export class SolanaProvider extends BaseProvider implements ISolanaProvider {
});

return {
signature: Buffer.from(SolanaProvider.messageToBuffer(res).buffer) as any,
signature: new Uint8Array(
Buffer.from(SolanaProvider.messageToBuffer(res).buffer),
),
publicKey: this.publicKey?.toBase58(),
};
}
Expand All @@ -211,7 +213,7 @@ export class SolanaProvider extends BaseProvider implements ISolanaProvider {
) {
transaction.addSignature(
this.publicKey!,
bs58.decode(signatureEncoded) as any,
bs58.decode(signatureEncoded) as Buffer & Uint8Array,
);
return transaction;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/solana/adapter/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export class TrustWallet implements Wallet {
},
);

outputs.push({ signature: bs58.decode(signature) as any });
outputs.push({ signature: new Uint8Array(bs58.decode(signature)) });
} else if (inputs.length > 1) {
for (const input of inputs) {
outputs.push(...(await this.#signAndSendTransaction(input)));
Expand Down
15 changes: 14 additions & 1 deletion packages/ton/MobileAdapter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { TonProvider } from './TonProvider';
import { ConnectItemReply, TonAddressItemReply } from './types/TonBridge';

interface ITransaction {
valid_until: number;
Expand Down Expand Up @@ -41,7 +42,19 @@ export class MobileAdapter {
'requestAccounts',
params,
);
return JSON.parse(res);

// Internally we use nonBounceable value, here we remove it from the response
return JSON.parse(res).map((item: ConnectItemReply) => {
if (item.name === 'ton_addr') {
const { nonBounceable, ...rest } = item as TonAddressItemReply & {
nonBounceable: string;
};

return rest;
}

return item;
});
}

case 'tonConnect_reconnect': {
Expand Down
2 changes: 1 addition & 1 deletion packages/ton/types/TonBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type TonProofItem = {

// Untrusted data returned by the wallet.
// If you need a guarantee that the user owns this address and public key, you need to additionally request a ton_proof.
type TonAddressItemReply = {
export type TonAddressItemReply = {
name: 'ton_addr';
address: string; // TON address raw (`0:<hex>`)
network: NETWORK; // network global_id
Expand Down

0 comments on commit 5eacf3e

Please sign in to comment.