-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdappTransferItem.ts
More file actions
22 lines (17 loc) · 919 Bytes
/
dappTransferItem.ts
File metadata and controls
22 lines (17 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { Address, toNano } from 'ton-core';
import { BlockchainProgram } from '../wrappers/BlockchainProgram';
import { NetworkProvider } from '@ton-community/blueprint';
import { randomAddress } from '@ton-community/test-utils';
export async function run(provider: NetworkProvider, args: string[]) {
const ui = provider.ui();
const address = Address.parse(args.length > 0 ? args[0] : await ui.input('Dapp address'));
const blockchainProgram = provider.open(BlockchainProgram.createFromAddress(address));
await blockchainProgram.sendTransferItemMsg(provider.sender(), {
fwdAmount: toNano('0.01'),
queryId: Date.now(),
newOwner: randomAddress(),
responseAddress: provider.sender().address as Address,
itemAddress: Address.parse("EQBfXWiU8wvHqNUZVNo3c-2g1VzNvuGDx-uM9-vrXEkl0G0S")
});
ui.write('Transfered successfully!');
}