11// A part of standard library for Tolk
2- tolk 0.11
2+ tolk 0.12
33
44/**
55 Gas and payment related primitives.
66 */
77
88/// Returns amount of gas (in gas units) consumed in current Computation Phase.
9- fun getGasConsumedAtTheMoment(): int
9+ fun getGasConsumedAtTheMoment(): coins
1010 asm "GASCONSUMED";
1111
1212/// This function is required to be called when you process an external message (from an outer world)
@@ -33,37 +33,37 @@ fun setGasLimit(limit: int): void
3333 asm "SETGASLIMIT";
3434
3535/// Calculates fee (amount in nanotoncoins to be paid) for a transaction which consumed [gasUsed] gas units.
36- fun calculateGasFee(workchain: int , gasUsed: int): int
36+ fun calculateGasFee(workchain: int8 , gasUsed: int): coins
3737 asm(gasUsed workchain) "GETGASFEE";
3838
3939/// Same as [calculateGasFee], but without flat price (you have supposed to read https://docs.ton.org/develop/howto/fees-low-level)
40- fun calculateGasFeeWithoutFlatPrice(workchain: int , gasUsed: int ): int
40+ fun calculateGasFeeWithoutFlatPrice(workchain: int8 , gasUsed: coins ): coins
4141 asm(gasUsed workchain) "GETGASFEESIMPLE";
4242
4343/// Calculates amount of nanotoncoins you should pay for storing a contract of provided size for [seconds].
4444/// [bits] and [cells] represent contract state (code + data).
45- fun calculateStorageFee(workchain: int , seconds: int, bits: int, cells: int): int
45+ fun calculateStorageFee(workchain: int8 , seconds: int, bits: int, cells: int): coins
4646 asm(cells bits seconds workchain) "GETSTORAGEFEE";
4747
4848/// Calculates amount of nanotoncoins you should pay to send a message of specified size.
49- fun calculateMessageFee(workchain: int , bits: int, cells: int): int
49+ fun calculateMessageFee(workchain: int8 , bits: int, cells: int): coins
5050 asm(cells bits workchain) "GETFORWARDFEE";
5151
5252/// Same as [calculateMessageFee], but without lump price (you have supposed to read https://docs.ton.org/develop/howto/fees-low-level)
53- fun calculateMessageFeeWithoutLumpPrice(workchain: int , bits: int, cells: int): int
53+ fun calculateMessageFeeWithoutLumpPrice(workchain: int8 , bits: int, cells: int): coins
5454 asm(cells bits workchain) "GETFORWARDFEESIMPLE";
5555
5656/// Calculates fee that was paid by the sender of an incoming internal message.
57- fun calculateOriginalMessageFee(workchain: int , incomingFwdFee: int ): int
57+ fun calculateOriginalMessageFee(workchain: int8 , incomingFwdFee: coins ): coins
5858 asm(incomingFwdFee workchain) "GETORIGINALFWDFEE";
5959
6060/// Returns the amount of nanotoncoins current contract debts for storage. ("due" and "debt" are synonyms)
6161/// If it has no debt, `0` is returned.
62- fun getMyStorageDuePayment (): int
62+ fun contract.getStorageDuePayment (): coins
6363 asm "DUEPAYMENT";
6464
6565/// Returns the amount of nanotoncoins charged for storage.
6666/// (during storage phase preceeding to current computation phase)
6767@pure
68- fun getMyStoragePaidPayment (): int
68+ fun contract.getStoragePaidPayment (): coins
6969 asm "STORAGEFEES";
0 commit comments