Skip to content

Commit

Permalink
first adaption to new tag backend
Browse files Browse the repository at this point in the history
  • Loading branch information
soad003 committed Nov 28, 2024
1 parent d8181cc commit 7326b00
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 29 deletions.
2 changes: 1 addition & 1 deletion openapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ GraphSense API provides programmatic access to various ledgers' addresses, entit
## Overview
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate an API client.

- API version: 1.7.0
- API version: 1.8.0
- Package version:
- Build package: org.openapitools.codegen.languages.ElmClientCodegen
8 changes: 4 additions & 4 deletions openapi/src/Api/Data.elm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
GraphSense API
GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks.
The version of the OpenAPI document: 1.7.0
The version of the OpenAPI document: 1.8.0
Contact: [email protected]
NOTE: This file is auto generated by the openapi-generator.
Expand Down Expand Up @@ -247,7 +247,6 @@ type alias AddressTag =
, tagpackTitle : String
, tagpackUri : Maybe String
, address : String
, entity : Int
}


Expand Down Expand Up @@ -639,6 +638,7 @@ type alias TxUtxo =

type alias TxValue =
{ address : List (String)
, index : Maybe Int
, value : Values
}

Expand Down Expand Up @@ -808,7 +808,6 @@ encodeAddressTagPairs model =
, encode "tagpack_title" Json.Encode.string model.tagpackTitle
, maybeEncode "tagpack_uri" Json.Encode.string model.tagpackUri
, encode "address" Json.Encode.string model.address
, encode "entity" Json.Encode.int model.entity
]
in
pairs
Expand Down Expand Up @@ -1857,6 +1856,7 @@ encodeTxValuePairs model =
let
pairs =
[ encode "address" (Json.Encode.list Json.Encode.string) model.address
, maybeEncode "index" Json.Encode.int model.index
, encode "value" encodeValues model.value
]
in
Expand Down Expand Up @@ -1976,7 +1976,6 @@ addressTagDecoder =
|> decode "tagpack_title" Json.Decode.string
|> maybeDecode "tagpack_uri" Json.Decode.string Nothing
|> decode "address" Json.Decode.string
|> decode "entity" Json.Decode.int


addressTagInheritedFromDecoder : Json.Decode.Decoder AddressTagInheritedFrom
Expand Down Expand Up @@ -2465,6 +2464,7 @@ txValueDecoder : Json.Decode.Decoder TxValue
txValueDecoder =
Json.Decode.succeed TxValue
|> decode "address" (Json.Decode.list Json.Decode.string)
|> maybeDecode "index" Json.Decode.int Nothing
|> decode "value" valuesDecoder


Expand Down
8 changes: 4 additions & 4 deletions openapi/src/Api/Request/Addresses.elm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
GraphSense API
GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks.
The version of the OpenAPI document: 1.7.0
The version of the OpenAPI document: 1.8.0
Contact: [email protected]
NOTE: This file is auto generated by the openapi-generator.
Expand Down Expand Up @@ -120,13 +120,13 @@ getAddress currency_path address_path includeActors_query =



getAddressEntity : (String) -> (String) -> Api.Request Api.Data.Entity
getAddressEntity currency_path address_path =
getAddressEntity : (String) -> (String) -> Maybe (Bool) -> Api.Request Api.Data.Entity
getAddressEntity currency_path address_path includeActors_query =
Api.request
"GET"
"/{currency}/addresses/{address}/entity"
[ ( "currency", identity currency_path ), ( "address", identity address_path ) ]
[]
[ ( "include_actors", Maybe.map ((\val -> if val then "true" else "false")) includeActors_query ) ]
[]
Nothing
Api.Data.entityDecoder
Expand Down
2 changes: 1 addition & 1 deletion openapi/src/Api/Request/Blocks.elm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
GraphSense API
GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks.
The version of the OpenAPI document: 1.7.0
The version of the OpenAPI document: 1.8.0
Contact: [email protected]
NOTE: This file is auto generated by the openapi-generator.
Expand Down
2 changes: 1 addition & 1 deletion openapi/src/Api/Request/Entities.elm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
GraphSense API
GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks.
The version of the OpenAPI document: 1.7.0
The version of the OpenAPI document: 1.8.0
Contact: [email protected]
NOTE: This file is auto generated by the openapi-generator.
Expand Down
2 changes: 1 addition & 1 deletion openapi/src/Api/Request/General.elm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
GraphSense API
GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks.
The version of the OpenAPI document: 1.7.0
The version of the OpenAPI document: 1.8.0
Contact: [email protected]
NOTE: This file is auto generated by the openapi-generator.
Expand Down
2 changes: 1 addition & 1 deletion openapi/src/Api/Request/Rates.elm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
GraphSense API
GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks.
The version of the OpenAPI document: 1.7.0
The version of the OpenAPI document: 1.8.0
Contact: [email protected]
NOTE: This file is auto generated by the openapi-generator.
Expand Down
2 changes: 1 addition & 1 deletion openapi/src/Api/Request/Tags.elm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
GraphSense API
GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks.
The version of the OpenAPI document: 1.7.0
The version of the OpenAPI document: 1.8.0
Contact: [email protected]
NOTE: This file is auto generated by the openapi-generator.
Expand Down
2 changes: 1 addition & 1 deletion openapi/src/Api/Request/Tokens.elm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
GraphSense API
GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks.
The version of the OpenAPI document: 1.7.0
The version of the OpenAPI document: 1.8.0
Contact: [email protected]
NOTE: This file is auto generated by the openapi-generator.
Expand Down
14 changes: 7 additions & 7 deletions openapi/src/Api/Request/Txs.elm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
GraphSense API
GraphSense API provides programmatic access to various ledgers' addresses, entities, blocks, transactions and tags for automated and highly efficient forensics tasks.
The version of the OpenAPI document: 1.7.0
The version of the OpenAPI document: 1.8.0
Contact: [email protected]
NOTE: This file is auto generated by the openapi-generator.
Expand Down Expand Up @@ -89,26 +89,26 @@ getSpentInTxs currency_path txHash_path ioIndex_query =



getTx : (String) -> (String) -> Maybe (Bool) -> Maybe (Int) -> Api.Request Api.Data.Tx
getTx currency_path txHash_path includeIo_query tokenTxId_query =
getTx : (String) -> (String) -> Maybe (Bool) -> Maybe (Bool) -> Maybe (Bool) -> Maybe (Int) -> Api.Request Api.Data.Tx
getTx currency_path txHash_path includeIo_query includeNonstandardIo_query includeIoIndex_query tokenTxId_query =
Api.request
"GET"
"/{currency}/txs/{txHash}"
[ ( "currency", identity currency_path ), ( "txHash", identity txHash_path ) ]
[ ( "include_io", Maybe.map ((\val -> if val then "true" else "false")) includeIo_query ), ( "token_tx_id", Maybe.map (String.fromInt) tokenTxId_query ) ]
[ ( "include_io", Maybe.map ((\val -> if val then "true" else "false")) includeIo_query ), ( "include_nonstandard_io", Maybe.map ((\val -> if val then "true" else "false")) includeNonstandardIo_query ), ( "include_io_index", Maybe.map ((\val -> if val then "true" else "false")) includeIoIndex_query ), ( "token_tx_id", Maybe.map (String.fromInt) tokenTxId_query ) ]
[]
Nothing
Api.Data.txDecoder



getTxIo : (String) -> (String) -> (Io) -> Api.Request (List Api.Data.TxValue)
getTxIo currency_path txHash_path io_path =
getTxIo : (String) -> (String) -> (Io) -> Maybe (Bool) -> Maybe (Bool) -> Api.Request (List Api.Data.TxValue)
getTxIo currency_path txHash_path io_path includeNonstandardIo_query includeIoIndex_query =
Api.request
"GET"
"/{currency}/txs/{txHash}/{io}"
[ ( "currency", identity currency_path ), ( "txHash", identity txHash_path ), ( "io", stringFromIo io_path ) ]
[]
[ ( "include_nonstandard_io", Maybe.map ((\val -> if val then "true" else "false")) includeNonstandardIo_query ), ( "include_io_index", Maybe.map ((\val -> if val then "true" else "false")) includeIoIndex_query ) ]
[]
Nothing
(Json.Decode.list Api.Data.txValueDecoder)
Expand Down
6 changes: 3 additions & 3 deletions src/Effect/Api.elm
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ perform apiKey wrapMsg effect =
|> send apiKey wrapMsg effect toMsg

GetEntityForAddressEffect { currency, address } toMsg ->
Api.Request.Addresses.getAddressEntity currency address
Api.Request.Addresses.getAddressEntity currency address Nothing
|> send apiKey wrapMsg effect toMsg

GetAddressTxsEffect { currency, address, direction, minHeight, maxHeight, order, pagesize, nextpage } toMsg ->
Expand Down Expand Up @@ -641,7 +641,7 @@ perform apiKey wrapMsg effect =
|> send apiKey wrapMsg effect toMsg

GetTxEffect { currency, txHash, tokenTxId, includeIo } toMsg ->
Api.Request.Txs.getTx currency txHash (Just includeIo) tokenTxId
Api.Request.Txs.getTx currency txHash (Just includeIo) Nothing Nothing tokenTxId
|> send apiKey wrapMsg effect toMsg

GetTxUtxoAddressesEffect { currency, txHash, isOutgoing } toMsg ->
Expand All @@ -653,7 +653,7 @@ perform apiKey wrapMsg effect =
else
Api.Request.Txs.IoInputs
in
Api.Request.Txs.getTxIo currency txHash io
Api.Request.Txs.getTxIo currency txHash io Nothing Nothing
|> send apiKey wrapMsg effect toMsg

SearchEntityNeighborsEffect e toMsg ->
Expand Down
5 changes: 3 additions & 2 deletions src/Model/Graph/Tag.elm
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ type alias Input =


userTagToApiTag : { currency : String, entity : Int, address : String } -> Bool -> UserTag -> Api.Data.AddressTag
userTagToApiTag { currency, address, entity } isClusterDefiner tag =
userTagToApiTag { currency, address} isClusterDefiner tag =
{ abuse = tag.abuse
, address = address
, entity = entity

-- , entity = entity
, category = tag.category
, confidence = Nothing
, confidenceLevel = Nothing
Expand Down
2 changes: 1 addition & 1 deletion src/Util/Data.elm
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ absValues x =

negateTxValue : Api.Data.TxValue -> Api.Data.TxValue
negateTxValue tv =
{ address = tv.address, value = negateValues tv.value }
{ address = tv.address, index = tv.index, value = negateValues tv.value }


addValues : Api.Data.Values -> Api.Data.Values -> Api.Data.Values
Expand Down
3 changes: 2 additions & 1 deletion src/View/Graph/Table/LabelAddressTagsTable.elm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ config vc =
data.address
]
)
, T.stringColumn styles vc "Entity" (.entity >> String.fromInt)

-- , T.stringColumn styles vc "Entity" (.entity >> String.fromInt)
, T.stringColumn styles vc "Currency" (.currency >> String.toUpper)
, T.stringColumn styles vc "Label" .label
, T.htmlColumn styles
Expand Down

0 comments on commit 7326b00

Please sign in to comment.