Skip to main content
Bumped by Community user
Bumped by Community user
added 205 characters in body; edited title
Source Link
qubitz
  • 220
  • 7

How to refer address look up tables in a transactiontransaction's instruction

I'm confused about look up tables. Suppose I want to call a function from a program which requires to pass in a list of transactions. Usually I would pass in a list of accounts as my keys: [{pubkey:... , isWritable: false, isSigner: false}, ....]. According to the docs instead of passing the full address to the look up table I can pass in a 1 byte index corresponding to the index of a given address in my look up table. How can I pass in this 1 byte most online implementations only pass in the look up table but not the indexes. How would the program then know which addresses correspond to which ?

I'm looking for something of the sort:

const instruction = new TransactionInstruction({
 keys: [{pubkey: 1, isSigner: false, isWritable: true}],
 programId: TENSORSWAP_ADDR,
 data,
});```

How to refer address look up tables in a transaction

I'm confused about look up tables. Suppose I want to call a function from a program which requires to pass in a list of transactions. Usually I would pass in a list of accounts as my keys: [{pubkey:... , isWritable: false, isSigner: false}, ....]. According to the docs instead of passing the full address to the look up table I can pass in a 1 byte index corresponding to the index of a given address in my look up table. How can I pass in this 1 byte most online implementations only pass in the look up table but not the indexes. How would the program then know which addresses correspond to which ?

How to refer address look up tables in a transaction's instruction

I'm confused about look up tables. Suppose I want to call a function from a program which requires to pass in a list of transactions. Usually I would pass in a list of accounts as my keys: [{pubkey:... , isWritable: false, isSigner: false}, ....]. According to the docs instead of passing the full address to the look up table I can pass in a 1 byte index corresponding to the index of a given address in my look up table. How can I pass in this 1 byte most online implementations only pass in the look up table but not the indexes. How would the program then know which addresses correspond to which ?

I'm looking for something of the sort:

const instruction = new TransactionInstruction({
 keys: [{pubkey: 1, isSigner: false, isWritable: true}],
 programId: TENSORSWAP_ADDR,
 data,
});```
Source Link
qubitz
  • 220
  • 7

How to refer address look up tables in a transaction

I'm confused about look up tables. Suppose I want to call a function from a program which requires to pass in a list of transactions. Usually I would pass in a list of accounts as my keys: [{pubkey:... , isWritable: false, isSigner: false}, ....]. According to the docs instead of passing the full address to the look up table I can pass in a 1 byte index corresponding to the index of a given address in my look up table. How can I pass in this 1 byte most online implementations only pass in the look up table but not the indexes. How would the program then know which addresses correspond to which ?