Skip to content
CTRL K
    Whose wallet (`owner`)

    Whose wallet (`owner`)

    When you load balances, allowances, or positions (including stake and farm rows), Nutrimatic needs to know which wallet address to look up. That address is the optional owner field on those reads.

    What you should do

    Your situationWhat to do
    The user is connected and you passed a wallet in configOmit owner. Nutrimatic calls wallet.getAddress() and uses that address.
    You already know the address (or you query many addresses)Pass owner: '0x…' (or the ledger’s address format) on each call.
    You have no wallet in configAlways pass owner. If you omit it, the SDK throws WALLET_REQUIRED.

    This is independent of mode: a wallet in config can supply the default address even when you only read.

    Example — connected wallet (omit owner)

    const sdk = createNutrimaticSdk({
      ledgers: [{ id: 'evm:421018', kind: 'evm', chainId: 421018, alias: 'infinite-mainnet' }],
      mode: 'read',
      integrationContext: 'client',
      wallet: myWalletAdapter,
    })
    
    // Uses await myWalletAdapter.getAddress()
    const balance = await sdk.balances.getBalance({
      instrumentId: 'evm:421018:instrument:42',
    })

    Example — pass the address

    const balance = await sdk.balances.getBalance({
      instrumentId: 'evm:421018:instrument:42',
      owner: '0xabc…',
    })

    Use this for backends, indexers, admin tools, or any screen that is not “the connected user”.

    Methods that use owner

    ModuleReads that take owner
    BalancesgetBalance, getAllowance
    PositionslistPositions, getPosition
    Stakingstake position reads
    Farmingfarm position reads

    Related

    GoalStart here
    Put wallet in configConfiguration — wallet · Wallet adapter
    Balances / allowancesBalances
    Portfolio tablePositions
    WALLET_REQUIREDErrors