-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdappDeployCollectionNew.ts
More file actions
38 lines (30 loc) · 1.25 KB
/
dappDeployCollectionNew.ts
File metadata and controls
38 lines (30 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { BlockchainProgram } from '../wrappers/BlockchainProgram';
import { compile, NetworkProvider } from '@ton-community/blueprint';
import { Address } from 'ton-core';
import { buildNftCollectionDataCell } from '../wrappers/utils/collectionHelpers';
import { sleep } from '@ton-community/blueprint/dist/utils';
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));
const collectionDataCell = buildNftCollectionDataCell({
ownerAddress: address,
nextItemIndex: 0,
collectionContent: '',
commonContent: '',
nftItemCode: await compile('AdminNft'),
royaltyParams: {
royaltyFactor: 12,
royaltyBase: 100,
royaltyAddress: randomAddress()
}
});
await blockchainProgram.sendDeployCollectionMsg(provider.sender(), {
collectionCode: await compile('AdminCollection'),
collectionData: collectionDataCell,
queryId: Date.now(),
});
sleep(3500);
ui.write("Collection deployed!");
}