Skip to content

Commit

Permalink
fix: ton transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteZhang1024 committed Oct 15, 2024
1 parent 20b0129 commit 37b0a00
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 18 deletions.
8 changes: 4 additions & 4 deletions packages/core/src/api/ton/TonSignMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ export default class TonSignMessage extends BaseMethod<HardwareTonSignMessage> {
{ name: 'destination', type: 'string' },
{ name: 'jettonMasterAddress', type: 'string' },
{ name: 'jettonWalletAddress', type: 'string' },
{ name: 'tonAmount', type: 'number' },
{ name: 'jettonAmount', type: 'number' },
{ name: 'fwdFee', type: 'number' },
{ name: 'tonAmount' },
{ name: 'jettonAmount' },
{ name: 'fwdFee' },
{ name: 'comment', type: 'string' },
{ name: 'isRawData', type: 'boolean' },
{ name: 'mode', type: 'number' },
{ name: 'seqno', type: 'number' },
{ name: 'expireAt', type: 'number' },
{ name: 'expireAt' },
{ name: 'walletVersion' },
{ name: 'walletId', type: 'number' },
{ name: 'workchain' },
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/api/ton/TonSignProof.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default class TonSignProof extends BaseMethod<HardwareTonSignProof> {
{ name: 'path', required: true },
{ name: 'appdomain', type: 'string' },
{ name: 'comment', type: 'string' },
{ name: 'expireAt', type: 'number' },
{ name: 'expireAt' },
{ name: 'walletVersion' },
{ name: 'walletId', type: 'number' },
{ name: 'workchain' },
Expand Down
17 changes: 11 additions & 6 deletions packages/core/src/types/api/tonSignMessage.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
import { TonSignedMessage, TonWalletVersion, TonWorkChain } from '@onekeyfe/hd-transport';
import type {
TonSignedMessage,
TonWalletVersion,
TonWorkChain,
UintType,
} from '@onekeyfe/hd-transport';
import type { CommonParams, Response } from '../params';

export type TonSignMessageParams = {
path: string | number[];
destination: string;
jettonMasterAddress?: string;
jettonWalletAddress?: string;
tonAmount: number;
jettonAmount?: number;
fwdFee?: number;
tonAmount: UintType;
jettonAmount?: UintType;
fwdFee?: UintType;
comment?: string;
isRawData?: boolean;
mode?: number;
seqno: number;
expireAt: number;
expireAt: UintType;
walletVersion?: TonWalletVersion;
walletId?: number;
workchain?: TonWorkChain;
isBounceable?: boolean;
isTestnetOnly?: boolean;
extDestination?: string[];
extTonAmount?: number[];
extTonAmount?: UintType[];
extPayload?: string[];
};

Expand Down
9 changes: 7 additions & 2 deletions packages/core/src/types/api/tonSignProof.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import { TonSignedProof, TonWalletVersion, TonWorkChain } from '@onekeyfe/hd-transport';
import type {
TonSignedProof,
TonWalletVersion,
TonWorkChain,
UintType,
} from '@onekeyfe/hd-transport';
import type { CommonParams, Response } from '../params';

export type TonSignProofParams = {
path: string | number[];
appdomain: string;
comment?: string;
expireAt: number;
expireAt: UintType;
walletVersion?: TonWalletVersion;
walletId?: number;
workchain?: TonWorkChain;
Expand Down
5 changes: 5 additions & 0 deletions packages/hd-transport/scripts/protobuf-patches/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,11 @@ const TYPE_PATCH = {
'TezosDelegationOp.source': 'Uint8Array',
'TezosDelegationOp.delegate': 'Uint8Array',
'TezosSignTx.branch': 'Uint8Array',
'TonSignMessage.ton_amount': UINT_TYPE,
'TonSignMessage.jetton_amount': UINT_TYPE,
'TonSignMessage.fwd_fee': UINT_TYPE,
'TonSignMessage.ext_ton_amount': UINT_TYPE,
'TonSignProof.expire_at': UINT_TYPE,
};

const DEFINITION_PATCH = {
Expand Down
10 changes: 5 additions & 5 deletions packages/hd-transport/src/types/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3891,9 +3891,9 @@ export type TonSignMessage = {
destination: string;
jetton_master_address?: string;
jetton_wallet_address?: string;
ton_amount: number;
jetton_amount?: number;
fwd_fee?: number;
ton_amount: UintType;
jetton_amount?: UintType;
fwd_fee?: UintType;
comment?: string;
is_raw_data?: boolean;
mode?: number;
Expand All @@ -3905,7 +3905,7 @@ export type TonSignMessage = {
is_bounceable?: boolean;
is_testnet_only?: boolean;
ext_destination: string[];
ext_ton_amount: number[];
ext_ton_amount: UintType[];
ext_payload: string[];
};

Expand All @@ -3920,7 +3920,7 @@ export type TonSignProof = {
address_n: number[];
appdomain: string;
comment?: string;
expire_at: number;
expire_at: UintType;
wallet_version?: TonWalletVersion;
wallet_id?: number;
workchain?: TonWorkChain;
Expand Down

0 comments on commit 37b0a00

Please sign in to comment.