forked from oxheadalpha/nft-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathminter-combinators.ts
63 lines (56 loc) · 2.12 KB
/
minter-combinators.ts
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import {
ContractAbstraction,
ContractProvider,
Wallet
} from '@taquito/taquito';
import {
CreateFungibleTokenParam,
FreezableContract,
FungibleBurnableContract,
FungibleMintableContract,
FungibleMintBurnParam,
MultiFungibleBurnableContract,
MultiFungibleMintableContract,
MultiFungibleMintBurnParam,
NftBurnableContract,
NftBurnParam,
NftMintableContract,
NftMintParam
} from './minter';
export const BurnNft = <TProvider extends ContractProvider | Wallet>(
contract: ContractAbstraction<TProvider>
): NftBurnableContract<TProvider> => ({
burn: (params: NftBurnParam[]) => contract.methods.burn(params)
});
export const MintNft = <TProvider extends ContractProvider | Wallet>(
contract: ContractAbstraction<TProvider>
): NftMintableContract<TProvider> => ({
mint: (params: NftMintParam[]) => contract.methods.mint(params)
});
export const BurnFungible = <TProvider extends ContractProvider | Wallet>(
contract: ContractAbstraction<TProvider>
): FungibleBurnableContract<TProvider> => ({
burn: (params: FungibleMintBurnParam[]) => contract.methods.burn(params)
});
export const MintFungible = <TProvider extends ContractProvider | Wallet>(
contract: ContractAbstraction<TProvider>
): FungibleMintableContract<TProvider> => ({
mint: (params: FungibleMintBurnParam[]) => contract.methods.mint(params)
});
export const BurnMultiFungible = <TProvider extends ContractProvider | Wallet>(
contract: ContractAbstraction<TProvider>
): MultiFungibleBurnableContract<TProvider> => ({
burn: (params: MultiFungibleMintBurnParam[]) => contract.methods.burn(params)
});
export const MintMultiFungible = <TProvider extends ContractProvider | Wallet>(
contract: ContractAbstraction<TProvider>
): MultiFungibleMintableContract<TProvider> => ({
mint: (params: MultiFungibleMintBurnParam[]) => contract.methods.mint(params),
createTokens: (params: CreateFungibleTokenParam[]) =>
contract.methods.create_tokens(params)
});
export const Freeze = <TProvider extends ContractProvider | Wallet>(
contract: ContractAbstraction<TProvider>
): FreezableContract<TProvider> => ({
mintFreeze: () => contract.methods.mint_freeze()
});