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

Ocean: api address list tokens #2960

Merged

Conversation

canonbrother
Copy link
Contributor

@canonbrother canonbrother commented Jul 2, 2024

Summary

  • as per title

Test coverage

listTokens
    ✓ should listTokens (17 ms)
    ✓ should listTokens with pagination (5 ms)
    ✓ should listTokens with undefined next pagination (2 ms)
    ✓ should return empty and page undefined while listTokens with invalid address (2 ms)

@canonbrother canonbrother self-assigned this Jul 2, 2024
@canonbrother canonbrother mentioned this pull request Jul 2, 2024
7 tasks
…#2948)

* script unspent indexer

* list_tx_unspent api

* fmt

* Ocean: indexer script aggregation + api.address.get_balance & get_aggregation (#2949)

* script aggregation indexer

* fmt

* address api: get_balance + get_aggregation

* get_balance return string

* decimal to string as deserialize not support in decimal

* fix NotFoundIndex params

* fix script agg indexer

* ScriptAggregationResponse

* 8 decimal

* decimal -> f64

* map api resp & fix sorting

* fix paginate
@canonbrother canonbrother force-pushed the canonbrother/indexer-script-activity branch from e532596 to 3805d70 Compare July 15, 2024 08:34
@canonbrother canonbrother force-pushed the canonbrother/ocean-api-address-list-tokens branch from f817845 to 59f75f7 Compare July 15, 2024 09:16
Base automatically changed from canonbrother/indexer-script-activity to feature/ocean-archive July 15, 2024 09:48
@canonbrother canonbrother marked this pull request as ready for review July 15, 2024 10:04
@Jouzo Jouzo merged commit 1fc3b4e into feature/ocean-archive Jul 15, 2024
3 of 4 checks passed
@Jouzo Jouzo deleted the canonbrother/ocean-api-address-list-tokens branch July 15, 2024 10:59
canonbrother added a commit that referenced this pull request Jul 16, 2024
* script activity indexer

* refine + helper::check_if_evm_tx + error::NotFoundIndex

* fmt

* api

* fmt

* fix

* fmt

* Ocean: indexer script unspent + api.address.list_transactions_unspent (#2948)

* script unspent indexer

* list_tx_unspent api

* fmt

* Ocean: indexer script aggregation + api.address.get_balance & get_aggregation (#2949)

* script aggregation indexer

* fmt

* address api: get_balance + get_aggregation

* get_balance return string

* decimal to string as deserialize not support in decimal

* fix NotFoundIndex params

* fix script agg indexer

* ScriptAggregationResponse

* 8 decimal

* decimal -> f64

* map api resp & fix sorting

* fix paginate

* fmt

* script activity uses find_tx_vout

* fix tx getvouts sort asc

* fix indexer_script_activity, index_tx order correction, refine find_tx_vout, rm unuse

* resp mapping

* fmt

* rust-defichain-rpc main

* script activity indexer

* address list tokens

* rm dup import

* fmt
prasannavl pushed a commit that referenced this pull request Sep 28, 2024
* Ocean endpoints scaffold

* Model scaffold

* Start ocean server

* Remove storage changes

* Ocean list pagination + json req/res  (#2737)

* add ApiPageResponse + impl json on list_blocks

* refine

* body -> query

* Ocean indexing scaffold

* Ocean API: rocks db  implementation for ocean API (#2728)

* Added `rockdb` to ocean api.
* Implementation of ocean-api database method  all  module.
* Added data_access layer
* Added test case for module.

* WIP: Ocean test suite CI (#2734)

* wip

* fail-fast false

* Fix manger typo

* Add -oceanarchive flag

* Ocean API MN typing (#2744)

* pagination query

* poolpair path api path

* mild refactor on error.rs and block.rs

* masternode typing

* rm debug_handler

* extra line

* default masternodestate

* fix return type

* typo

* pub enum state

* missing import

* clone

* simplified mn

* Adds cached crate

* Fix format

* WIP: Ocean API database implementation to all modules (#2748)

* added block indexing

* added block indexing and query method

* added query methods and extra table

* added query methods to modules

* added oracle price active and prive feed module

* added oracle price active and prive feed module

* rebased indexing ocean-archive

* rebased indexing ocean-archive and updated query methods all modules

* rebased indexing ocean-archive and updated query methods all modules

* fixed white space

* fixed white space

* fixed query method for masternode and masterstats

* Enhance Ocean database implementation (#2762)

* OceanStore building

* With RepositoryOps trait

* Cleanup columns

* Implement put/get/list masternode

* Fix MasternodeByHeight get_key

* Cleanup MasternodeData

* Invalidate masternode

* Remove comments

* cfg(test_off)

---------

Co-authored-by: canonbrother <w.canonbrother@gmail.com>

* Fix ocean ci docker not found (#2759)

* target branch feature/ocean-archive

* docker-build

* on pr master + note

* BlockService

* Finish Masternode indexing impl

* Use serde as default Column trait implementation (#2765)

* Fix build

* Add 404 handler

* Cleanup db iter method

* Remove need for nightly

* Index auction (#2771)

* Use single block context (#2773)

* Fix fmt

* Ocean: block indexing (#2777)

* experimental_allow_proto3_optional

* ffi blockv2info

* update ocean block apis

* pindex->stakeModifier

* rm block.reward

* add missing column block_by_height

* rm unuse

* Index swap and swap result (#2778)

* Ocean: Genesis block indexed + missing mn info update (#2791)

* add mn info

* index genesis

* Ocean: RPC client  (#2793)

* With ApiError into_response

* Client auth

* Response handling

* Expose rpc client to indexer

* Remove unused dep

* Update client type

* Ocean: Highest block endpoint (#2799)

* Ocean endpoints impl for blocks

* Fix default iter mode

* Accept height in /blocks/:id

* WIP: Implementation for ocean-API transaction module (#2781)

* added transaction index

* added transaction api implementation

* fixed .cpp file formats

* fixed id to Txid

* added transction list method by block_hash

* added transaction indexing

* removed transaction by block_hash from trx module

* update txid strong type

* removed method list_trasnction_txid

* added vin and vout index in transaction with query

* updated vin and vout table as Txid

* fixed conflicts in transaction branch

* fixed fmt

* Restore cpp fmt

---------

Co-authored-by: jouzo <jdesclercs@gmail.com>

* Log indexing time

* Ocean: Fix Transaction index typing (#2801)

* Proper transaction typing

* Fix txid type

* Ocean: Governance API (#2805)

* Governance API

* Make query types public

* Format cpp

* Ocean CI Refinement (#2764)

* point to working jf branch

* build on current branch

* test masternode only

* mv docker-build into test

* rm specific test

* rm ci docker build

* defid-e2e/module.api

* rm Response wrapper

* fix wrong e2e path

* serde camelcase on fee api query

* add oceanarchiveport flag

* update ci test path

* update ocean ci target branch

* WIP : Ocean Fixing transaction Indexing bugs   (#2802)

* updated trasnction id while saving vin and vout with invalidate method

* fixed format

* fixed transaction data type and updated index_transaction

* fixed transaction structure for indexing trasnaction,vin and vout

* fixed transaction id to tuple

* Restore cpp fmt

* Remove unwrap in check_if_evm_tx

* Remove ffi exports of index_transaction_*

* Remove transaction clone

* Remove second iteration for total_vout_value

* Index vout by TransactionVoutKey

* Fix TransactionVout typing

* Index vin by TransactionVinKey

* Index from getblock 2 format

* Cleanup

---------

Co-authored-by: jouzo <jdesclercs@gmail.com>

* Fix: Ocean resp get (#2811)

* fix resp get

* rm unuse ci

* Fix RPC port (#2815)

* pagination size serde_with displayfromstr

* deserialize undefined to none

* Ocean: async RPC client (#2817)

* Format rs

* Stats API initial impl (#2819)

* Ocean: Masternode API (#2820)

* Fix masternode API

* fix api page test

---------

Co-authored-by: canonbrother <w.canonbrother@gmail.com>

* Correct API Decimal float serialization

* Ocean: Ocean loan API initial impl (#2823)

* Update PaginationQuery default

* Loan API partial impl

* typo stats/reward/distribution

* Fix list block API (#2826)

* Ocean: Initial Scan support (#2829)

* Fix next not being set

* Temporary fix of burn address

* Add blocks/:hash/transactions endpoint

* Add support for querying list Ascending

* handle ocean api network

* Don't handle including_start at the iter level

* Column implementation to fix ser/deser order issue on usize

* Index txs from 0

* Handle including_start through Paginate trait

---------

Co-authored-by: canonbrother <w.canonbrother@gmail.com>

* Fix block indexing

* Ocean: fix ocean api tx get (#2831)

* serialize f64 to string

* missing txid at struct Transaction

* custom path rejection

* fmt_rs

* Revert Column default impl

* Revert cache changes

* Revert code cache changes

* Clippy cleanup

* Fix TransactionId visibility

* dftx-rs as crate (#2832)

* Restore clippy

* Clippy

* Clippy tests

* Fix RepositoryOps trait arg names

* Fix: ocean api tx getvins (#2833)

* typo

* revert and mv 7e50b03 + 01abcc8 to dedicated resp struct

* wip getvins

* wip getvouts

* Use Decimal for total_vout_value calc

* fix getvins

---------

Co-authored-by: jouzo <jdesclercs@gmail.com>

* Ocean: Use custom axum path extractor (#2836)

* Ocean: Cleanup data acess (#2837)

* Disable cache on build-dev

* Cleanup ocean deps

* Re-enable CI caching

* Fix: ocean api tx get vouts (#2834)

* fix getvouts

* fmt

* refine query pattern

* TransactionVoutKey

* rm unuse

* Set MACOSX_DEPLOYMENT_TARGET in macos cross compile

* Ocean cli (#2844)

* Update rustc version to 1.76

* Add todo fallback poolswap comment

* Clippy

* Add RUST_DEFAULT_VERSION and MACOSX_DEPLOYMENT_TARGET to ci_export_vars

* Overwrite RUST_DEFAULT_VERSION

* Use defich/rust-defichain-rpc

* Network Type for ocean API (#2861)

* added network type to ocean

* added network type to ocean

* Impl ToString for Network

---------

Co-authored-by: jouzo <jdesclercs@gmail.com>

* Implementation of oracle indexing (#2862)

* Implementation of oracle repo and storage for oracle api

* Implementation for indexing oracle

* formatting issue in vscode

* fixed process_inner_values

* added oracle get method API

* fixed error handling

* updated oracles history details

* updated price oracles

* oracles fmt

* implemented price api methods and fixed price_ticker

* fixed pagination for oracles and price and removal price_ticker_key

* fixed invalidate and appointoracle pricefeed and currecny

* fixed update and remove oracle

* remove bigUint crate and fixed index_interval_mapper

* rebase ocean archive

* added price ticker

* added price ticker

* fixed error handling for oracle and invalidate method

* format issue in vs_code

* fixed oracle and added testcase appoint

* implemented of setoracleInterval

* added indexing setoraclinterval

* added indexing setoraclinterval

* added setinterval model

* updated oracles  remove oracle and invalidate method

* fixed update and invalidate oracle

* fixed update and invalidate oracle

* fixed oracles api and price feeds for setoracles

* removed num-bigint

* removed num-bigint

* removed num-bigint and fixed price api

* merge setoracledatainterval into setoracledata

* updated invalidate interval and index mapper

* Restore opcode import

* Remove num-traits

* Clippy

* fixed price_feed api and removed num-traits

* fixed space

* Revert src fmt changes

---------

Co-authored-by: jouzo <jdesclercs@gmail.com>

* Clippy

* Restore txid in Transaction

* Update index mapper and oracle invalidate interval (#2888)

* fixed clippy warning for oracle

* format space

* Revert "format space"

This reverts commit 36c8e21.

* fixed OraclePriceAggregatedIntervalKey

* fixed index_interval_mapper

* removed unwanted println

* Fix clippy

---------

Co-authored-by: jouzo <jdesclercs@gmail.com>

* Handle masternode state (#2889)

* Fix doc

* Add support for mocknet

* Parse 'main' as mainnet network

* Trigger lint on feature/** branches

* Fix missing ethsubscription doc

* Ocean: Api PoolPair (#2838)

* comment unuse poolpairs api

* enable api poolpairs list

* rename struct prefix PoolPair and replace data by response

* fix types

* StringOrF64

* fmt

* char

* rm println

* custom_rewards: Vec<String>

* fix PoolPairsResult de

* filter BURN- and ordering

* creation_height i64

* rm filter since using BTreeMap

* apr and vol -> f64

* getpoolpair

* token typings

* pp list filter_map

* StringOrFloat

* rm StringOrFloat

* wip listpoolswaps

* Implement InitialKeyProvider for PoolSwapRepository

* enable listpoolswapsverbose

* Ocean: poolpair graph (#2855)

* sync_token_graph on initialize

* poolpairs_path

* get_pool_pair_info_cached

* compute_paths_between_tokens + all_simple_paths

* get_pool_pair_info_cached

* add list_paths api

* fix list_paths api

* fix all_simple_paths

* missing Response list_paths api

* temp disable list_pool_pairs_cached + fix get_pool_pair_info_cached

* camelCase TokenIdentifier + Arc for token_graph & tokens_to_swappable_tokens data model

* fix SwapPathPoolPair rename id to pool_pair_id, enable price_ratio

* fix PriceRatio typing

* sync_token_graph: execute first then wait in loop

* estimated_dex_fees_in_pct

* grab fab7f5f defichain-rpc

* rm extra api

* get_best_path

* use rust_decimal

* rm unuse import

* fix estimated_dex_fees_in_pct

* default 1

* mmv list_paths above of get_best_path

* ceil

* format num

* fix typo

* ceil

* id default String

* proper err for`from_token_id != to_token_id`

* fix EstimatedDexFeesInPct typing

* rm unuse comment

* rm tokens_to_swappable_tokens & wip get_swappable_tokens api

* fix get_swappable_tokens

* get_swappable_tokens done

* br

* use format_err.into()

* fix unwrap

* rm println

* sync_token_graph_if_empty

* repl if let else by unwrap_or_default

* rm ceil.. its bug

* rm clone

* refine recur

* partialeq Network

* pool.name

* rm unuse pool dep

* clippy

* poolpair -> pool_pair

* rename get_pool_pair_info_cached -> get_pool_pair_cached

* refactor: mv pool_pair api to a new dir

* fmt_rs

* rm pp dir s

* totalliquidityinusd + refactor + fix gettokencached and getpoolpaircached

* swap DecimalError and SecondaryIndex

* rename DecimalError to DecimalConversionError

* add rust_decimal::Error as DecimalError, OverflowError and UnderflowError

* get_gov_cached

* wip apr

* fmt_rs

* fix token split value type str -> f64, get_blockchain_info eunos.height handling

* total_liquidity usd typing decimal to string

* sync_token_graph in tokio

* fmt_rs

* lint

* undo defichain-rpc dep version

* push latest cargo.lock updue to update of rust-defichain-rpc

* fix list_pool_pairs_cached

* disable cached on list pool pairs temp

* lint

* fmt_cpp

* axum 0.7.5

* refine ocean ci

* fix ocean ci

* fix req: unwrap -> ok_or

* fmt_rs

* use expect on  vec -> arr

* use expect in fold

---------

Co-authored-by: jouzo <jdesclercs@gmail.com>

* Ocean: Remove poolpair API unwraps (#2913)

* Remove unwraps

* Use slice

* Restore GetByteArray()

* Ocean: list pool swap aggregates (#2918)

* wip

* fmt

* rm log

* cleanup

* [index_block_start] sort pool creation_height desc

* faster get_pool_pair

* paginate

* enable pool swap indexer

* default 0 if empty accounts

* [index_block_start] wrap oneday interval

* missing store onehour aggregate

* fix wrong amount token id

* [fix] DeserializeAnyNotSupported decimal, change aggregate token amount type from decimal to string

* fmt

* index_block_start poolswap grab the latest only

* decimal places 8 + convert base unit to logical unit

* fix interval hour

* fmt_rs

* cleanup

* async function is not directly supported yet

* fmt

* impl correct index approach

* cleanup

* missing PoolSwapAggregated and PoolSwapAggregatedKey columns

* fix getting splited arr wrong index

* rm oneday and onehour columns

* rm PoolSwapAggregatedInterval from

* add bucket into key

* refine

* stuck

* Impl Column trait

* revert hiding code

* rm pool_test.rs

* fmt_rs

* clear debug log

* add invalidate poolswapagg

---------

Co-authored-by: jouzo <jdesclercs@gmail.com>

* Impl new in repository macro

* Ocean: list dex prices api (#2923)

* fix unwrap

* wip

* fix query

* filter untradable token

* fmt_rs

* ocean indexing active price (#2892)

* indexing active price

* index implemetation for active_price SetLoanToken

* updated price ticker storage

* updated active price

* updated SetLoanToken from active_price

* handling empty loan_value

* updated pirces api and oracles

* fixed comments

* fixed comments

* updated api method name get_feed and response

* fixed duplicated insertion of oracle

* fixed duplicated insertion

* fixed oracle map_price_feeds

* testing for oralces

* fixed oracles repeating data

* added testcase for oracle_price_feed

* updated api query for oracle get feed and test cases

* updated price api

* price changes made in map_aggregated

* fixed the api amount decimal point

* fix list_prices order

* updated index interval for oracle

* fixed conflicts

* remove of script.sh

* Clippy fix

* Clippy tests

---------

Co-authored-by: canonbrother <w.canonbrother@gmail.com>
Co-authored-by: jouzo <jdesclercs@gmail.com>

* Ocean: poolpair apr & volume (#2925)

* finishing poolpair apr and volume

* fix get_apr

* set default apr instead of none

* grab 2e948d7 defichain-rpc

* fmt

* poolpair fee typo

* get_dex_fees_pct

* fmt_rs

* log path

* enum TokenDirection

* Ocean list pool swap verbose api (#2926)

* rm unuse

* wip

* check_swap_type

* fix check_swap_type

* 20 per page

* enable compositeswap indexer

* rm logs

* fmt

* point rust-bitcoin to main

* fix list_pool_swap res from_amount decimal 8

* run set tx_result only while ocean is enabled

* rm log

* Expose skipped txs to ocean (#2931)

* fix split account by @ (#2934)

* Ocean: Fix cli linking issue. Add rust native skipped_txs

* Ocean: poolswap fallback handling (#2932)

* handle compositeswap empty pools

* fmt

* fallback

* fmt

* Ocean: Index createpoolpair result  (#2936)

* Oceain: Index createpoolpair result

* Add missing cf

* fmt cpp

* Add header guards

* Clippy fix

* Clippy fix

* Ocean: add error field in ApiError (#2938)

* add error field to adopt whale api client error handling

* throw poolpair not found err

* Remove cli indexer

* Flatten dftx check

* Ocean: fix `PoolCreationHeight` sorting & add `CompositeSwap` Aggregated (#2940)

* add desc on PoolPairByHeightKey

* pool_pairs sorted by creationheight

* index composite swap aggregated

* RawTx API  (#2921)

* ocean rawtx api

* updated validate

* updated api for raw_trasaction

* fixed get_raw_tx

* updated request to json rawtx

* updated raw tx api

* added validate to rawtx

* update send_rawtx

* fixed clippy

* resolved issue

* fixed get method

* fixed validate in raw_tx

* fixed pool format

* fixed rawtx bad request test cases

* fixed validate return type

* updated send error message

* fixed lint issue

---------

Co-authored-by: jouzo <jdesclercs@gmail.com>

* Ocean: fix governance APIs (listProposals, getProposal, listProposalVotes) (#2947)

* updated sorting to list_gov_proposals api

* update governance proposal list api

* fixed amount param serializing

* resolved the issue

* fix get_burned_total AccountAmount

* updated governance model

* fixed clippy

* fix ser model

---------

Co-authored-by: canonbrother <w.canonbrother@gmail.com>

* Ocean: address indexers + apis (#2946)

* script activity indexer

* refine + helper::check_if_evm_tx + error::NotFoundIndex

* fmt

* api

* fmt

* fix

* fmt

* Ocean: indexer script unspent + api.address.list_transactions_unspent (#2948)

* script unspent indexer

* list_tx_unspent api

* fmt

* Ocean: indexer script aggregation + api.address.get_balance & get_aggregation (#2949)

* script aggregation indexer

* fmt

* address api: get_balance + get_aggregation

* get_balance return string

* decimal to string as deserialize not support in decimal

* fix NotFoundIndex params

* fix script agg indexer

* ScriptAggregationResponse

* 8 decimal

* decimal -> f64

* map api resp & fix sorting

* fix paginate

* fmt

* script activity uses find_tx_vout

* fix tx getvouts sort asc

* fix indexer_script_activity, index_tx order correction, refine find_tx_vout, rm unuse

* resp mapping

* fmt

* rust-defichain-rpc main

* Ocean: api address list tokens (#2960)

* script activity indexer

* refine + helper::check_if_evm_tx + error::NotFoundIndex

* fmt

* api

* fmt

* fix

* fmt

* Ocean: indexer script unspent + api.address.list_transactions_unspent (#2948)

* script unspent indexer

* list_tx_unspent api

* fmt

* Ocean: indexer script aggregation + api.address.get_balance & get_aggregation (#2949)

* script aggregation indexer

* fmt

* address api: get_balance + get_aggregation

* get_balance return string

* decimal to string as deserialize not support in decimal

* fix NotFoundIndex params

* fix script agg indexer

* ScriptAggregationResponse

* 8 decimal

* decimal -> f64

* map api resp & fix sorting

* fix paginate

* fmt

* script activity uses find_tx_vout

* fix tx getvouts sort asc

* fix indexer_script_activity, index_tx order correction, refine find_tx_vout, rm unuse

* resp mapping

* fmt

* rust-defichain-rpc main

* script activity indexer

* address list tokens

* rm dup import

* fmt

* Ocean: api address get account history (#2967)

* script activity indexer

* refine + helper::check_if_evm_tx + error::NotFoundIndex

* fmt

* api

* fmt

* fix

* fmt

* Ocean: indexer script unspent + api.address.list_transactions_unspent (#2948)

* script unspent indexer

* list_tx_unspent api

* fmt

* Ocean: indexer script aggregation + api.address.get_balance & get_aggregation (#2949)

* script aggregation indexer

* fmt

* address api: get_balance + get_aggregation

* get_balance return string

* decimal to string as deserialize not support in decimal

* fix NotFoundIndex params

* fix script agg indexer

* ScriptAggregationResponse

* 8 decimal

* decimal -> f64

* map api resp & fix sorting

* fix paginate

* fmt

* script activity uses find_tx_vout

* fix tx getvouts sort asc

* fix indexer_script_activity, index_tx order correction, refine find_tx_vout, rm unuse

* resp mapping

* fmt

* rust-defichain-rpc main

* script activity indexer

* address list tokens

* rm dup import

* fmt

* get_acc_history

* rm log

* use anyhow::Context

---------

Co-authored-by: Jouzo <15011228+Jouzo@users.noreply.github.com>

* Ocean: list auctions api (#2942)

* wip

* fix froms

* refine SetLoanToken indexer

* br

* desc

* fmt

* vault state

* update cargo.lock 9a338f8d0ed5e837a67eb8c1aa04a9efc0c5d2ba

* Ocean: vault get + list apis (#2958)

* api get_vault

* list_auctions plural

* list_vaults api

* get_loan_token

* clippy

* use anyhow::Context

* Ocean: finishing get/list loan token api (#2968)

* wip

* add active price and fixed interval price id on struct LoanToken

* sorted by creation_tx

* clippy

* fmt

* rust-defichain-rpc main

* fix fake_paginate

* Ocean: api list vaults by address (#2974)

* refactor + vault by address

* api missing addr path

* Ocean: Implements `index_block_end ` (#2969)

* block end implementation

* invalidate block end implementation

* indexing_block_end implementation

* indexing and invalidating block_end

* ocean:indexing block_end

* ocean:fixed duplicates invalidate_block

* revert cargo.lock e466866

* oop kind refactor

* fix

* rm unuse clone

---------

Co-authored-by: canonbrother <w.canonbrother@gmail.com>

* Ocean: Fixed oracle invalidate methods (#2973)

* update oracle invalidate function

* fixed remove and update oracle invalidate

* Clippy fix

---------

Co-authored-by: jouzo <jdesclercs@gmail.com>

* Ocean: Error handling cleanup (#2978)

* Cleanup oracle

* Cleanup error handling

* Ocean: fix decimal division by zero (#2977)

* fallible division by zero

* fmt

* Remove unwrap (#2979)

* Ocean: `checked_div` default value as 1 (#2981)

* COIN

* neat dec

* rm checked_div for logical conversion

* checked_div default 1 if none

* refine a bit

* fmt_rs

* Ocean: set loopback + cors (#2983)

* default ocean endpoint as loopback

* cors

* refine cors

* fmt_rs

* desc

* Ocean: revamp setoracledata indexer (#2987)

* infer

* revamp setoracle index

* forward aggregate value

* backward aggregate value

* invalidate

* fmt

* note the changes

* rm unuse -.-

* revert -

* div correction

* revert price_ticket by_key

* revert not put at oracle_price_agg by_key

* fmt

* Ocean: fix todo on get_stats (#2989)

* fix:todo get_stats

* get_count: add blocks and prices

* get_mn: tvl * usd

* fmt

* fmt

* weightage u8 (#2992)

* Auto ocean port

* fix typo (#2995)

* Ocean: cache refined (#2999)

* cache ttl 600

* rm init sync_token_graph.. lazy load will do

* rename list_tokens_cached

* gov -> getgov

* enable cache on list_pool_pairs_cached

* Ocean: fix loan token indexer (#2998)

* get_network

* sort desc

* camelcase

* rm dup model - refer OraclePriceActiveNext

* fix map_active_price

* fmt_rs

* add missing oracle_price_aggregated by_key put

* refine

* fmt_rs

* Ocean: CollateralToken.active_price + typing amount: decimal (#2990)

* add active_price on CollateralToken

* fix serde

* fix type

* fmt_rs

* Ocean: cache list pool pairs api (#3000)

* support size

* cache listpoolpairs api

* fmt

* support next

* fmt

* check_evm_tx within vin loop (#3004)

* Ocean: refactor tables (#3014)

* Refactor columns and repository

* Lint

* Cargo fix

* Clippy

* Lint

* Custom key for PoolSwapAggregatedKey

* Ocean: fix rm oracle indexer,  oracle & price apis (#3013)

* rm oracle indexer

* br

* fix oracle & price apis

* fmt

* rm split_key

* naming

* fix prices api 2

* tying

* fmt

---------

Co-authored-by: Jouzo <15011228+Jouzo@users.noreply.github.com>

* Ocean: feat Snafu (#3017)

* wip

* wip

* rough snafu

* rm unuse

* rm unuse

* pub type Token, Currency, Weightage

* parse_token_currency, parse_pool_pair_symbol

* parse_amount

* fmt

* parse_fixed_interval_price

* parse_query_height_txno

* rm unuse

* NotFoundKindToken(id)

* refactor dup

* rm unuse

* track over underflow location

* fmt

* ToPrimitiveError

* track location at invalid format errors

* rm unuse

* snafu display correction

* rm anyhow & thiserror deps ocean

* replace .ok_or by .context

* refine notfound err

* apply alias on Token, Currency and Weightage

* fmt

* fix notfound token with id

* remap rpc error

* rm unuse

* fix vault not found

* typo

* rust_decimal::serde::str

* fix notfound errmsg

* rm skip if none on tokendata.col_addr

* fmt

* fix burn token err msg

* fix collateral token errmsg

* fix burn not tradeable errmsg

* invaliddefiaddress errmsg

* fix getacchis errmsg

* fmt

* fix getloantoken errmsg

* fix gettoken errmsg

* set context false for `?` underlying error

* rm string debug fmt

* Clippy

* Granular ocean flags

* Cleanup logs

* Remove unused macro

* Fix clippy

* Remove unused imports

* Remove unused deps

* Ocean: fix map loan collateral active price (#3027)

* fix map active_price

* rm unuse

* add note on dep list_acc_his

* rm unuse

* clippy

* Ocean: feat. indexer invalidate (#3028)

* ocean_invalidate_block

* invalidate_tx

* invalidate_active_price (invalidate_block_end)

* invalidate(block, dftx, script(activity, unspent, aggregation)

* br

* log

* invalidate without rm key

* index order correction

* recursion OceanIndex

* fix invalidate errmsg

* rm unuse

* throw err notfoundindex

* skip_tx

* fmt_rs

* Ocean: Reduce disk usage (#3045)

* Reduce ScriptUnspent by 100bytes

* Reduce ScriptActivity size

* Reduce TransactionVout size

* Optimize TransactionVin

* hid to [u8;32]

* Lint

* Ocean: fix outdated pool (#3046)

* ffi::getpoolpairs

* use ffi::getPoolPair

* compositeswap poolId from txresult

* rm CreatePoolPair index

* fmt

* rm PoolCreationHeight

* clippy

* Add /debug/dumptables endpoint (#3049)

* Ci/sync with ocena activate

* Revert "Ci/sync with ocena activate"

This reverts commit 6d7ab3a.

* Ocean: refactor consolidate index script loop (#3052)

* consolidate index script

* consolidate invalidate script

* order

* fmt

* update Cargo.lock rust-bitcoin d7cd09b

* derive default on ScriptAggregationStatistic and ScriptAggregationAmount

* typing TransactionVout.value f64

* typing ScriptUnspent

* let..else

* clippy

* fmt

* update Cargo.lock rust-bitcoin fe08844

* store script activity,unspent height as [u8; 4]

* Ocean: cleaup pricefeeds (#3054)

* Add Ocean log category and log block indexing time

* Remove duplicate txid on scriptunspent

* Implement Default for BlockContext

* Cleanup price feeds

* Clippy

* Ocean: refactor `from_script` (#3056)

* type correct network

* test_from_script

* shorter

* fmt

* clippy

* Cleanup tokio

* get to_amount from index (#3055)

* Ocean: chore pool model cleanup (#3057)

* rm model PoolSwap id,sort

* update resp id + sort

* rm model PoolSwapAggregated id,key

* note for bucket usasge

* fmt

* hashmap amount key tokenId as u64

* Log txs

* Log index script and remove clones

* Cleanup clones

* Cleanup ScriptAggregation

* Checked_add weightage

* Accept "test" as testnet name

* invalidate order correction (#3064)

* Ocean feat: replace `rpc::get_token` by `ffi::get_token` (#3061)

* ffi::gettoken

* wip

* fix test ffi

* rename getdsttoken and use guesstokenid

* dtoken id u32

* rename dtoken to dst20tokenverbose

* rename dst20tokenverbose to dsttoken

* dsttoken fields

* symbolkey

* ffi::get_dst_token at mappoolpair

* get_token_usd_value, get_total_liquidity_usd_by_best_path

* add limit field

* add collateralAddress field

* fmt_rs

* rm unuse

* rm clone

* org

* fmt

* cleanup todo

* Add ocean_index_block logs

* Ocean model weightage as u32

* Ocean: chore oracle/price model cleanup (#3067)

* model cleanup dup fields

* fix apis

* fmt_rs

* cleanup PriceTicker 2

* rm oracle_history

* model cleanup

* fix api

* clippy

* fmt_rs

* better naming

* fmt

* fix get_oracle_by_address api

* update rounding strategy

update rounding strategy

* aggregated amt and weigtage typing

* fmt_rs

* Ocean: cache pool utils (#3069)

* cache pool utils

* get_network_info_cached

* guard

* Rename LoanCount to camelCase

* handle diff usdt pool naming (#3070)

* Debug ocean endpoint error

* Terser logs

* Ocean: fix get apr default if any zero (#3075)

* ignore if any zero

* fmt

* Rename ocean rest* to server

* Update gArgs access

* Grammar

* Fix guard

* Cleanup -oceanarchive default

* Fix client host

* Cleanup logs

* Cache with sync_writes

* Revert "Cleanup -oceanarchive default"

This reverts commit 04716fa.

* Sort poolpairs by id

---------

Co-authored-by: canonbrother <w.canonbrother@gmail.com>
Co-authored-by: Nagaraj <144004792+nagarajm22@users.noreply.github.com>
Co-authored-by: Niven <sieniven@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants