-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1306 from madfish-solutions/v3.3.4
v3.3.4
- Loading branch information
Showing
171 changed files
with
2,093 additions
and
1,511 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { TezosToolkit, TransferParams } from '@taquito/taquito'; | ||
import BigNumber from 'bignumber.js'; | ||
|
||
import { WTEZ_TOKEN } from '@config/tokens'; | ||
import { getContract } from '@shared/dapp'; | ||
|
||
import { sendBatch } from './send-batch'; | ||
|
||
export const getWithWtezBurnOnOutputParams = async ( | ||
tezos: TezosToolkit, | ||
mutezAmount: BigNumber, | ||
accountPkh: string, | ||
operationParams: TransferParams[] | ||
) => { | ||
if (mutezAmount.isZero()) { | ||
return operationParams; | ||
} | ||
|
||
const wTezContract = await getContract(tezos, WTEZ_TOKEN.contractAddress); | ||
|
||
return operationParams.concat(wTezContract.methods.burn(accountPkh, accountPkh, mutezAmount).toTransferParams()); | ||
}; | ||
|
||
export const withWtezBurnOnOutput = async ( | ||
tezos: TezosToolkit, | ||
mutezAmount: BigNumber, | ||
accountPkh: string, | ||
operationParams: TransferParams[] | ||
) => await sendBatch(tezos, await getWithWtezBurnOnOutputParams(tezos, mutezAmount, accountPkh, operationParams)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { TezosToolkit, TransferParams } from '@taquito/taquito'; | ||
import BigNumber from 'bignumber.js'; | ||
|
||
import { WTEZ_TOKEN } from '@config/tokens'; | ||
import { getContract } from '@shared/dapp'; | ||
|
||
import { sendBatch } from './send-batch'; | ||
|
||
export const getWithWtezMintOnInputParams = async ( | ||
tezos: TezosToolkit, | ||
mutezAmount: BigNumber, | ||
accountPkh: string, | ||
operationParams: TransferParams[] | ||
) => { | ||
if (mutezAmount.isZero()) { | ||
return operationParams; | ||
} | ||
|
||
const wTezContract = await getContract(tezos, WTEZ_TOKEN.contractAddress); | ||
|
||
return [ | ||
wTezContract.methods.mint(accountPkh).toTransferParams({ amount: mutezAmount.toNumber(), mutez: true }) | ||
].concat(operationParams); | ||
}; | ||
|
||
export const withWtezMintOnInput = async ( | ||
tezos: TezosToolkit, | ||
mutezAmount: BigNumber, | ||
accountPkh: string, | ||
operationParams: TransferParams[] | ||
) => await sendBatch(tezos, await getWithWtezMintOnInputParams(tezos, mutezAmount, accountPkh, operationParams)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.