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

Incorrect type of property "type" of Permission interface #592

Open
mykhailohordin opened this issue Jan 7, 2025 · 2 comments
Open

Incorrect type of property "type" of Permission interface #592

mykhailohordin opened this issue Jan 7, 2025 · 2 comments

Comments

@mykhailohordin
Copy link

mykhailohordin commented Jan 7, 2025

TronWeb: 6.0.0

From /tronweb/src/types/Contract.ts

export interface Permission {
    type: number;
    /** Owner id=0, Witness id=1, Active id start by 2 */
    id?: number;
    permission_name: string;
    threshold: number;
    operations?: string;
    keys: PermissionKey[];
}

From network

Request:
tronWeb.trx.getAccount('account with updated account permission address').then((account) => {console.log(account)})

Response:
{
...
  owner_permission: {
    permission_name: 'owner',
    threshold: 2,
    keys: [ [Object], [Object], [Object] ]
  },
  active_permission: [
    {
      type: 'Active',
      id: 2,
      permission_name: 'empty',
      threshold: 3,
      operations: '0000000000000000000000000000000000000000000000000000000000000000',
      keys: [Array]
    }
  ],
...
}

P.S. I have checked on several different addresses. Was always returned as string, not a number

@DmytroShalaiev
Copy link

+1

@Satan-web3
Copy link
Contributor

Thanks for your feedback. We'll fix it in the next version.

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

3 participants