Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion e2e/zombienet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@polkadot/keyring": "^13.5.5",
"@polkadot/types": "^16.4.4",
"@polkadot/util-crypto": "^13.5.6",
"dedot": "^0.16.0",
"dedot": "^0.17.0",
"happy-dom": "^15.11.7",
"typink": "workspace:*"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/demo-general/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@dedot/react-identicon": "^0.1.0",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"dedot": "^0.16.0",
"dedot": "^0.17.0",
"framer-motion": "^10.18.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/demo-inkv5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@chakra-ui/system": "^2.6.2",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"dedot": "^0.16.0",
"dedot": "^0.17.0",
"framer-motion": "^10.18.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/demo-inkv6/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@chakra-ui/system": "^2.6.2",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"dedot": "^0.16.0",
"dedot": "^0.17.0",
"framer-motion": "^10.18.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
8 changes: 5 additions & 3 deletions examples/demo-inkv6/src/components/Psp22Board.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { toEvmAddress } from 'dedot/contracts';

export default function Psp22Board() {
const { contract } = useContract<Psp22ContractApi>(ContractId.PSP22);
const { connectedAccount, network } = useTypink();
const { connectedAccount } = useTypink();
const mintTx = useContractTx(contract, 'psp22MintableMint');
const { data: tokenName, isLoading: loadingTokenName } = useContractQuery({
contract,
Expand Down Expand Up @@ -74,6 +74,8 @@ export default function Psp22Board() {
}
};

const tokenFormatOptions = { symbol: tokenSymbol, decimals: tokenDecimal };

return (
<Box>
<Heading size='md'>PSP22 Contract</Heading>
Expand All @@ -99,15 +101,15 @@ export default function Psp22Board() {
<Box mb={2}>
Total Supply:{' '}
<PendingText fontWeight='600' isLoading={loadingTotalSupply}>
{formatBalance(totalSupply, network)}
{formatBalance(totalSupply, tokenFormatOptions)}
</PendingText>
</Box>
<Divider my={4} />
<Box>
My Balance:{' '}
{connectedAccount ? (
<PendingText fontWeight='600' isLoading={loadingBalance}>
{formatBalance(myBalance, network)}
{formatBalance(myBalance, tokenFormatOptions)}
</PendingText>
) : (
<WalletSelection buttonProps={{ size: 'xs' }} />
Expand Down
2 changes: 1 addition & 1 deletion examples/demo-multi-clients/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@dedot/react-identicon": "^0.1.0",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"dedot": "^0.16.0",
"dedot": "^0.17.0",
"framer-motion": "^10.18.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/demo-subconnect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@subwallet-connect/react": "^1.0.8",
"@subwallet-connect/subwallet-polkadot": "^1.0.8",
"@subwallet-connect/talisman": "^1.0.8",
"dedot": "^0.16.0",
"dedot": "^0.17.0",
"framer-motion": "^10.18.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/demo-talisman-connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@talismn/connect-components": "^1.1.9",
"@talismn/connect-ui": "^1.1.4",
"@talismn/connect-wallets": "^1.2.8",
"dedot": "^0.16.0",
"dedot": "^0.17.0",
"framer-motion": "^10.18.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-typink/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"bin": "./bin/create-typink.mjs",
"dependencies": {
"@dedot/utils": "^0.16.0",
"@dedot/utils": "^0.17.0",
"arg": "^5.0.2",
"chalk": "^5.6.2",
"execa": "^9.6.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@radix-ui/react-slot": "^1.2.3",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"dedot": "^0.16.0",
"dedot": "^0.17.0",
"lucide-react": "^0.544.0",
"next": "^15.5.3",
"next-themes": "^0.4.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-typink/templates/v6-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@radix-ui/react-slot": "^1.2.3",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"dedot": "^0.16.0",
"dedot": "^0.17.0",
"lucide-react": "^0.544.0",
"next": "^15.5.3",
"next-themes": "^0.4.6",
Expand Down
1 change: 0 additions & 1 deletion packages/typink/src/hooks/useContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ export function useContract<T extends GenericContractApi = GenericContractApi>(
}

const contract = new Contract<T>(
// @ts-ignore
client,
deployment.metadata,
deployment.address, // prettier-end-here
Expand Down
1 change: 0 additions & 1 deletion packages/typink/src/hooks/useDeployer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export function useDeployer<T extends GenericContractApi = GenericContractApi>(
}

const deployer = new ContractDeployer<T>(
// @ts-ignore
client,
metadata,
codeHashOrWasm, // prettier-end-here
Expand Down
1 change: 0 additions & 1 deletion packages/typink/src/hooks/useRawContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export function useRawContract<T extends GenericContractApi = GenericContractApi
}

const newContract = new Contract<T>(
// @ts-ignore
client,
metadata as any,
address, // prettier-end-here
Expand Down
10 changes: 3 additions & 7 deletions packages/typink/src/hooks/useTx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ export function useTx<
};

await generalTx({
// @ts-ignore
client,
txBuilder,
args,
Expand Down Expand Up @@ -158,12 +157,9 @@ export function useTx<
};
}

export async function generalTx<
ChainApi extends VersionedGenericSubstrateApi = SubstrateApi,
TxFn extends (...args: any[]) => ISubmittableExtrinsic<ISubmittableResult> = any,
>(parameters: {
client: CompatibleSubstrateApi<ChainApi>;
txBuilder: TxBuilder<ChainApi, TxFn>;
export async function generalTx(parameters: {
client: CompatibleSubstrateApi;
txBuilder: TxBuilder<any>;
args?: any[];
caller: string;
txOptions?: Partial<SignerOptions>;
Expand Down
Loading