Skip to content

Commit

Permalink
fix: postcondition
Browse files Browse the repository at this point in the history
  • Loading branch information
alter-eggo committed Nov 28, 2024
1 parent ceb92e3 commit ad2d49f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"@emotion/core": "11.0.0",
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
"@stacks/prettier-config": "0.0.10",
"@stacks/stacks-blockchain-api-types": "7.14.1",
"@stacks/stacks-blockchain-api-types": "7.3.2",
"@trivago/prettier-plugin-sort-imports": "4.1.1",
"@types/jest": "29.5.2",
"@types/node": "20.3.1",
Expand Down
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ import { NavigateFunction } from 'react-router-dom';

import { ContractCallRegularOptions, openContractCall } from '@stacks/connect';
import { StacksNetwork } from '@stacks/network';
import {
FungibleConditionCode,
contractPrincipalCV,
noneCV,
uintCV,
makeStandardSTXPostCondition
} from '@stacks/transactions';
import { StxPostCondition, contractPrincipalCV, noneCV, uintCV } from '@stacks/transactions';
import * as yup from 'yup';

import { UI_IMPOSED_MAX_STACKING_AMOUNT_USTX } from '@constants/app';
Expand Down Expand Up @@ -79,16 +73,23 @@ function getOptions(values: EditingFormValues, network: StacksNetwork): Contract
: protocol.liquidContract === LiquidContractName.Lisa
? { functionArgs: [uintCV(stxAmount)], functionName: 'request-mint' }
: { functionArgs: [], functionName: 'deposit' };
const postConditions = [
makeStandardSTXPostCondition(stxAddress, FungibleConditionCode.LessEqual, stxAmount),

const postConditions: StxPostCondition[] = [
{
type: 'stx-postcondition',
address: stxAddress,
condition: 'lte',
amount: stxAmount,
},
];

return {
contractAddress,
contractName,
functionName,
functionArgs,
postConditions,
network,
postConditions,
};
}
interface CreateHandleSubmitArgs {
Expand Down

0 comments on commit ad2d49f

Please sign in to comment.