fireblocks / java-sdk

MIT License
7 stars 2 forks source link

cannot list ADA addresses #19

Open PavelNiedoba opened 4 months ago

PavelNiedoba commented 4 months ago

api returns addressFormat":"BASE, which is missing in enums openapi.yaml file, so you need to update that one:

   VaultWalletAddress:
      example:
        bip44AddressIndex: 0
        legacyAddress: legacyAddress
        address: address
        assetId: assetId
        addressFormat: SEGWIT
        userDefined: true
        enterpriseAddress: enterpriseAddress
        description: description
        tag: tag
        type: type
        customerRefId: customerRefId
      properties:
        assetId:
          type: string
          x-fb-entity: asset
        address:
          type: string
        description:
          type: string
        tag:
          type: string
        type:
          type: string
        customerRefId:
          type: string
        addressFormat:
          enum:
          - SEGWIT
          - LEGACY
############          - BASE  is missing here #############
          type: string
        legacyAddress:
          type: string
        enterpriseAddress:
          type: string
        bip44AddressIndex:
          type: integer
        userDefined:
          type: boolean
      type: object

and regenerate java code, because now listing ADA addresses fails with:

Caused by: com.fasterxml.jackson.databind.exc.ValueInstantiationException: Cannot construct instance of `com.fireblocks.sdk.model.VaultWalletAddress$AddressFormatEnum`, problem: Unexpected value 'BASE'
 at [Source: (String)"{"addresses":[{"assetId":"ADA_TEST","address":"addr_test1qrw7kkhv5vcwwvsfpwvflmdmn0myyttxxszr92vj4q07phyp5aw6kmh7rfjha3a00r7gr692yjse84l6yl2s03cv0qnsa2xsmx","description":"","tag":"","type":"Permanent","addressFormat":"BASE","legacyAddress":"","enterpriseAddress":"addr_test1vrw7kkhv5vcwwvsfpwvflmdmn0myyttxxszr92vj4q07phq6nuep4","bip44AddressIndex":0,"userDefined":false},{"assetId":"ADA_TEST","address":"addr_test1vrw7kkhv5vcwwvsfpwvflmdmn0myyttxxszr92vj4q07phq6nuep4","description":"","tag":"","ty"[truncated 735 chars]; line: 1, column: 219] (through reference chain: com.fireblocks.sdk.model.PaginatedAddressResponse["addresses"]->java.util.ArrayList[0]->com.fireblocks.sdk.model.VaultWalletAddress["addressFormat"])
    at com.fasterxml.jackson.databind.exc.ValueInstantiationException.from(ValueInstantiationException.java:47)
    at com.fasterxml.jackson.databind.DeserializationContext.instantiationException(DeserializationContext.java:1735)
    at com.fasterxml.jackson.databind.DeserializationContext.handleInstantiationProblem(DeserializationContext.java:1109)
    at com.fasterxml.jackson.databind.deser.std.FactoryBasedEnumDeserializer.deserialize(FactoryBasedEnumDeserializer.java:146)
    at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:286)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27)
    at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:129)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4218)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3214)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3197)
    at com.fireblocks.sdk.api.VaultsApi.lambda$getVaultAccountAssetAddressesPaginated$19(VaultsApi.java:1545)
    ... 7 more
PavelNiedoba commented 4 months ago

on web https://developers.fireblocks.com/reference/get_vault-accounts-vaultaccountid-assetid-addresses-paginated, there is already correct information

image

asafs932 commented 4 months ago

Thank you for bringing this to our attention! We will look into this issue and will provide an update as soon as we have more information.

PavelNiedoba commented 4 months ago

bug is still present in v2.1.0