Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uint256 types are converted into string #68

Open
serhanguney opened this issue Mar 3, 2024 · 0 comments
Open

uint256 types are converted into string #68

serhanguney opened this issue Mar 3, 2024 · 0 comments

Comments

@serhanguney
Copy link

serhanguney commented Mar 3, 2024

Below is a method found in the abi I'm transforming:

{
            inputs: [
                {
                    components: [
                        {
                            internalType: 'uint256',
                            name: 'amount',
                            type: 'uint256',
                        },
                        {
                            internalType: 'address',
                            name: 'itemAddress',
                            type: 'address',
                        },
                        {
                            internalType: 'uint8',
                            name: 'propertyType',
                            type: 'uint8',
                        },
                    ],
                    internalType: 'struct SafeRoom.PackageItem[]',
                    name: 'packageList',
                    type: 'tuple[]',
                },
                {
                    internalType: 'address',
                    name: 'recipient',
                    type: 'address',
                },
                {
                    components: [
                        {
                            internalType: 'uint256',
                            name: 'packageAmount',
                            type: 'uint256',
                        },
                        {
                            internalType: 'address',
                            name: 'currencyAddress',
                            type: 'address',
                        },
                    ],
                    internalType: 'struct SafeRoom.PackageCurrency',
                    name: 'currency',
                    type: 'tuple',
                },
                {
                    internalType: 'uint256',
                    name: 'packageLifeTime',
                    type: 'uint256',
                },
                {
                    internalType: 'bool',
                    name: 'isPublishToMarket',
                    type: 'bool',
                },
            ],
            name: 'createPackage',
            outputs: [],
            stateMutability: 'nonpayable',
            type: 'function',
        },
        ...

In the generated file the createPackage method is found to be as such:

createPackage(
    packageList: PackageListRequest[],
    recipient: string,
    currency: CurrencyRequest,
    packageLifeTime: string,
    isPublishToMarket: boolean
  ): MethodReturnContext;

export interface PackageListRequest {
  amount: string;
  itemAddress: string;
  propertyType: string | number;
}

export interface CurrencyRequest {
  packageAmount: string;
  currencyAddress: string;
}

As you can see the uint256 types are being transformed into string. I would expect them to be transformed into bigint type. I checked the documentation and found nothing regarding the uint256 type. Is there something I'm missing ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant