keep-starknet-strange / abi-wan-kanabi

Abi parser for Cairo smart contracts, based on wagmi abitype
The Unlicense
59 stars 19 forks source link

starknet.js Integration #30

Closed haroune-mohammedi closed 1 year ago

haroune-mohammedi commented 1 year ago

This issue is about all the little changes we have to make to integrate abiwan to starknet.js

The first thing I tired is to reproduce the same cairo1 test with typed contract instead of regular contract and here's all the TypeScript complains I got:

TL;DR

All Errors

const tx = await cairo1Contract.increase_balance(
    CallData.compile({
        amount: 100,
    })
);

await account.waitForTransaction(tx.transaction_hash);
const balance = await cairo1Contract.get_balance({
    parseResponse: false,
});
const result1 = await cairo1Contract.test_u256(uint256(2n ** 256n - 2n));
const tx = await cairo1Contract.set_ca('123');
let tx = await cairo1Contract.increase_balance(100);
const status = await cairo1Contract.echo_un_tuple(tuple(77, 123));
const status1 = await cairo1Contract.echo_array_u256([123, 55, 77, 255]);
const status11 = await cairo1Contract.echo_array_u256([
    uint256(123),
    uint256(55),
    uint256(77),
    uint256(255),
]);
const status = await cairo1Contract.get_bet(1, {
    formatResponse: { name: 'string', description: 'string' },
});
haroune-mohammedi commented 1 year ago

It'd better to use export type Address = `0x${string}`; instead of string for ContractAddress, @tabaktoni @ivpavici ?

haroune-mohammedi commented 1 year ago

Related to https://github.com/0xs34n/starknet.js/pull/696