Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

266
Visualizações
How to fetch secondary EOSIO table index with i128 type in eosjs

I want to get data using get_table_rows(). The index of the data is i128 type.

uint128_t by_corp_id_timestamp() const {
      return uint128_t(corp_id) << 64 | timestamp.elapsed.count();
}

So I tried in the order below.

First, the timestamp was converted into time_point.

const time_point = dateToTimePoint(timestamp);

If the timestamp is 2021-09-19T14:32:00.000, the time_point is 1632061920000000.

I succeeded in getting a value with time_point.

Then i tried to make i128 key by combining time_point with corp_id.

buffer_time_stamp.pushArray(numeric.decimalToBinary(16, '' + corp_id + time_point));
const bound_time = numeric.binaryToDecimal(buffer_time_stamp.getUint8Array(16));

If corp_id is 1000 and time_stamp is 2021-09-19T14:32:00.000, bound_time is 10001632061920000000.

According to by_corp_id_timestamp(), I think I properly obtained the key. However, the above bound_time does not work.

Please help me.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda