Wallet.smali

.class public Linfo/blockchain/api/wallet/Wallet;
.super Ljava/lang/Object;
.source "Wallet.java"


# instance fields
.field private apiCode:Ljava/lang/String;

.field private identifier:Ljava/lang/String;

.field private password:Ljava/lang/String;

.field private secondPassword:Ljava/lang/String;

.field private serviceInterface:Linfo/blockchain/api/interfaces/ServiceWalletInterface;


# direct methods
.method public constructor <init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .registers 11

    .prologue
    .line 35
    const/4 v5, 0x0

    move-object v0, p0

    move-object v1, p1

    move-object v2, p2

    move-object v3, p3

    move-object v4, p4

    invoke-direct/range {v0 .. v5}, Linfo/blockchain/api/wallet/Wallet;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 36
    return-void
.end method

.method public constructor <init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .registers 13

    .prologue
    .line 46
    const/4 v6, 0x0

    move-object v0, p0

    move-object v1, p1

    move-object v2, p2

    move-object v3, p3

    move-object v4, p4

    move-object v5, p5

    invoke-direct/range {v0 .. v6}, Linfo/blockchain/api/wallet/Wallet;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lokhttp3/ah;)V

    .line 47
    return-void
.end method

.method public constructor <init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lokhttp3/ah;)V
    .registers 8

    .prologue
    .line 56
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 57
    iput-object p2, p0, Linfo/blockchain/api/wallet/Wallet;->apiCode:Ljava/lang/String;

    .line 58
    iput-object p3, p0, Linfo/blockchain/api/wallet/Wallet;->identifier:Ljava/lang/String;

    .line 59
    iput-object p4, p0, Linfo/blockchain/api/wallet/Wallet;->password:Ljava/lang/String;

    .line 60
    iput-object p5, p0, Linfo/blockchain/api/wallet/Wallet;->secondPassword:Ljava/lang/String;

    .line 61
    invoke-static {p6, p1}, Linfo/blockchain/api/wallet/Wallet;->getServiceInterface(Lokhttp3/ah;Ljava/lang/String;)Linfo/blockchain/api/interfaces/ServiceWalletInterface;

    move-result-object v0

    iput-object v0, p0, Linfo/blockchain/api/wallet/Wallet;->serviceInterface:Linfo/blockchain/api/interfaces/ServiceWalletInterface;

    .line 62
    return-void
.end method

.method public static createWallet(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lretrofit2/Call;
    .registers 12
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ")",
            "Lretrofit2/Call",
            "<",
            "Linfo/blockchain/api/data/CreateWalletResponse;",
            ">;"
        }
    .end annotation

    .prologue
    .line 82
    const/4 v0, 0x0

    invoke-static {v0, p0}, Linfo/blockchain/api/wallet/Wallet;->getServiceInterface(Lokhttp3/ah;Ljava/lang/String;)Linfo/blockchain/api/interfaces/ServiceWalletInterface;

    move-result-object v0

    move-object v1, p1

    move-object v2, p2

    move-object v3, p3

    move-object v4, p4

    move-object v5, p5

    invoke-interface/range {v0 .. v5}, Linfo/blockchain/api/interfaces/ServiceWalletInterface;->createWallet(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lretrofit2/Call;

    move-result-object v0

    return-object v0
.end method

.method public static createWallet(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lokhttp3/ah;)Lretrofit2/Call;
    .registers 13
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            "Lokhttp3/ah;",
            ")",
            "Lretrofit2/Call",
            "<",
            "Linfo/blockchain/api/data/CreateWalletResponse;",
            ">;"
        }
    .end annotation

    .prologue
    .line 78
    invoke-static {p6, p0}, Linfo/blockchain/api/wallet/Wallet;->getServiceInterface(Lokhttp3/ah;Ljava/lang/String;)Linfo/blockchain/api/interfaces/ServiceWalletInterface;

    move-result-object v0

    move-object v1, p1

    move-object v2, p2

    move-object v3, p3

    move-object v4, p4

    move-object v5, p5

    invoke-interface/range {v0 .. v5}, Linfo/blockchain/api/interfaces/ServiceWalletInterface;->createWallet(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lretrofit2/Call;

    move-result-object v0

    return-object v0
.end method

.method private static getDefaultOkHttpClient()Lokhttp3/ah;
    .registers 4

    .prologue
    const-wide/16 v2, 0xf

    .line 86
    new-instance v0, Lokhttp3/ai;

    invoke-direct {v0}, Lokhttp3/ai;-><init>()V

    sget-object v1, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;

    .line 87
    invoke-virtual {v0, v2, v3, v1}, Lokhttp3/ai;->b(JLjava/util/concurrent/TimeUnit;)Lokhttp3/ai;

    move-result-object v0

    sget-object v1, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;

    .line 88
    invoke-virtual {v0, v2, v3, v1}, Lokhttp3/ai;->c(JLjava/util/concurrent/TimeUnit;)Lokhttp3/ai;

    move-result-object v0

    sget-object v1, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;

    .line 89
    invoke-virtual {v0, v2, v3, v1}, Lokhttp3/ai;->d(JLjava/util/concurrent/TimeUnit;)Lokhttp3/ai;

    move-result-object v0

    .line 1810
    const/4 v1, 0x0

    iput-boolean v1, v0, Lokhttp3/ai;->bxe:Z

    .line 91
    invoke-virtual {v0}, Lokhttp3/ai;->Rq()Lokhttp3/ah;

    move-result-object v0

    .line 86
    return-object v0
.end method

.method private static getServiceInterface(Lokhttp3/ah;Ljava/lang/String;)Linfo/blockchain/api/interfaces/ServiceWalletInterface;
    .registers 4

    .prologue
    .line 96
    if-nez p0, :cond_6

    .line 97
    invoke-static {}, Linfo/blockchain/api/wallet/Wallet;->getDefaultOkHttpClient()Lokhttp3/ah;

    move-result-object p0

    .line 100
    :cond_6
    new-instance v0, Lretrofit2/Retrofit$Builder;

    invoke-direct {v0}, Lretrofit2/Retrofit$Builder;-><init>()V

    .line 101
    invoke-virtual {v0, p1}, Lretrofit2/Retrofit$Builder;->baseUrl(Ljava/lang/String;)Lretrofit2/Retrofit$Builder;

    .line 102
    invoke-virtual {v0, p0}, Lretrofit2/Retrofit$Builder;->client(Lokhttp3/ah;)Lretrofit2/Retrofit$Builder;

    .line 103
    invoke-static {}, Lretrofit2/converter/jackson/JacksonConverterFactory;->create()Lretrofit2/converter/jackson/JacksonConverterFactory;

    move-result-object v1

    invoke-virtual {v0, v1}, Lretrofit2/Retrofit$Builder;->addConverterFactory(Lretrofit2/Converter$Factory;)Lretrofit2/Retrofit$Builder;

    .line 105
    invoke-virtual {v0}, Lretrofit2/Retrofit$Builder;->build()Lretrofit2/Retrofit;

    move-result-object v0

    const-class v1, Linfo/blockchain/api/interfaces/ServiceWalletInterface;

    invoke-virtual {v0, v1}, Lretrofit2/Retrofit;->create(Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Linfo/blockchain/api/interfaces/ServiceWalletInterface;

    return-object v0
.end method


# virtual methods
.method public archiveAddress(Ljava/lang/String;)Lretrofit2/Call;
    .registers 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            ")",
            "Lretrofit2/Call",
            "<",
            "Linfo/blockchain/api/data/WalletAddressArchiveResponse;",
            ">;"
        }
    .end annotation

    .prologue
    .line 213
    iget-object v0, p0, Linfo/blockchain/api/wallet/Wallet;->serviceInterface:Linfo/blockchain/api/interfaces/ServiceWalletInterface;

    iget-object v1, p0, Linfo/blockchain/api/wallet/Wallet;->identifier:Ljava/lang/String;

    iget-object v2, p0, Linfo/blockchain/api/wallet/Wallet;->password:Ljava/lang/String;

    iget-object v3, p0, Linfo/blockchain/api/wallet/Wallet;->apiCode:Ljava/lang/String;

    invoke-interface {v0, v1, v2, v3, p1}, Linfo/blockchain/api/interfaces/ServiceWalletInterface;->archiveAddress(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lretrofit2/Call;

    move-result-object v0

    return-object v0
.end method

.method public getAddress(Ljava/lang/String;)Lretrofit2/Call;
    .registers 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            ")",
            "Lretrofit2/Call",
            "<",
            "Linfo/blockchain/api/data/WalletAddress;",
            ">;"
        }
    .end annotation

    .prologue
    .line 191
    iget-object v0, p0, Linfo/blockchain/api/wallet/Wallet;->serviceInterface:Linfo/blockchain/api/interfaces/ServiceWalletInterface;

    iget-object v1, p0, Linfo/blockchain/api/wallet/Wallet;->identifier:Ljava/lang/String;

    iget-object v2, p0, Linfo/blockchain/api/wallet/Wallet;->password:Ljava/lang/String;

    iget-object v3, p0, Linfo/blockchain/api/wallet/Wallet;->apiCode:Ljava/lang/String;

    invoke-interface {v0, v1, v2, v3, p1}, Linfo/blockchain/api/interfaces/ServiceWalletInterface;->getAddress(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lretrofit2/Call;

    move-result-object v0

    return-object v0
.end method

.method public getAddress(Ljava/lang/String;I)Lretrofit2/Call;
    .registers 7
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "I)",
            "Lretrofit2/Call",
            "<",
            "Linfo/blockchain/api/data/WalletAddress;",
            ">;"
        }
    .end annotation

    .annotation runtime Ljava/lang/Deprecated;
    .end annotation

    .prologue
    .line 253
    iget-object v0, p0, Linfo/blockchain/api/wallet/Wallet;->serviceInterface:Linfo/blockchain/api/interfaces/ServiceWalletInterface;

    iget-object v1, p0, Linfo/blockchain/api/wallet/Wallet;->identifier:Ljava/lang/String;

    iget-object v2, p0, Linfo/blockchain/api/wallet/Wallet;->password:Ljava/lang/String;

    iget-object v3, p0, Linfo/blockchain/api/wallet/Wallet;->apiCode:Ljava/lang/String;

    invoke-interface {v0, v1, v2, v3, p1}, Linfo/blockchain/api/interfaces/ServiceWalletInterface;->getAddress(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lretrofit2/Call;

    move-result-object v0

    return-object v0
.end method

.method public getBalance()Lretrofit2/Call;
    .registers 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Lretrofit2/Call",
            "<",
            "Linfo/blockchain/api/data/WalletBalance;",
            ">;"
        }
    .end annotation

    .prologue
    .line 116
    iget-object v0, p0, Linfo/blockchain/api/wallet/Wallet;->serviceInterface:Linfo/blockchain/api/interfaces/ServiceWalletInterface;

    iget-object v1, p0, Linfo/blockchain/api/wallet/Wallet;->identifier:Ljava/lang/String;

    iget-object v2, p0, Linfo/blockchain/api/wallet/Wallet;->password:Ljava/lang/String;

    iget-object v3, p0, Linfo/blockchain/api/wallet/Wallet;->apiCode:Ljava/lang/String;

    invoke-interface {v0, v1, v2, v3}, Linfo/blockchain/api/interfaces/ServiceWalletInterface;->getBalance(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lretrofit2/Call;

    move-result-object v0

    return-object v0
.end method

.method public listAddresses()Lretrofit2/Call;
    .registers 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Lretrofit2/Call",
            "<",
            "Linfo/blockchain/api/data/WalletAddressList;",
            ">;"
        }
    .end annotation

    .prologue
    .line 180
    iget-object v0, p0, Linfo/blockchain/api/wallet/Wallet;->serviceInterface:Linfo/blockchain/api/interfaces/ServiceWalletInterface;

    iget-object v1, p0, Linfo/blockchain/api/wallet/Wallet;->identifier:Ljava/lang/String;

    iget-object v2, p0, Linfo/blockchain/api/wallet/Wallet;->password:Ljava/lang/String;

    iget-object v3, p0, Linfo/blockchain/api/wallet/Wallet;->apiCode:Ljava/lang/String;

    invoke-interface {v0, v1, v2, v3}, Linfo/blockchain/api/interfaces/ServiceWalletInterface;->listAddresses(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lretrofit2/Call;

    move-result-object v0

    return-object v0
.end method

.method public listAddresses(I)Lretrofit2/Call;
    .registers 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(I)",
            "Lretrofit2/Call",
            "<",
            "Linfo/blockchain/api/data/WalletAddressList;",
            ">;"
        }
    .end annotation

    .annotation runtime Ljava/lang/Deprecated;
    .end annotation

    .prologue
    .line 238
    iget-object v0, p0, Linfo/blockchain/api/wallet/Wallet;->serviceInterface:Linfo/blockchain/api/interfaces/ServiceWalletInterface;

    iget-object v1, p0, Linfo/blockchain/api/wallet/Wallet;->identifier:Ljava/lang/String;

    iget-object v2, p0, Linfo/blockchain/api/wallet/Wallet;->password:Ljava/lang/String;

    iget-object v3, p0, Linfo/blockchain/api/wallet/Wallet;->apiCode:Ljava/lang/String;

    invoke-interface {v0, v1, v2, v3}, Linfo/blockchain/api/interfaces/ServiceWalletInterface;->listAddresses(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lretrofit2/Call;

    move-result-object v0

    return-object v0
.end method

.method public newAddress(Ljava/lang/String;)Lretrofit2/Call;
    .registers 8
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            ")",
            "Lretrofit2/Call",
            "<",
            "Linfo/blockchain/api/data/WalletAddress;",
            ">;"
        }
    .end annotation

    .prologue
    .line 202
    iget-object v0, p0, Linfo/blockchain/api/wallet/Wallet;->serviceInterface:Linfo/blockchain/api/interfaces/ServiceWalletInterface;

    iget-object v1, p0, Linfo/blockchain/api/wallet/Wallet;->identifier:Ljava/lang/String;

    iget-object v2, p0, Linfo/blockchain/api/wallet/Wallet;->password:Ljava/lang/String;

    iget-object v3, p0, Linfo/blockchain/api/wallet/Wallet;->secondPassword:Ljava/lang/String;

    iget-object v4, p0, Linfo/blockchain/api/wallet/Wallet;->apiCode:Ljava/lang/String;

    move-object v5, p1

    invoke-interface/range {v0 .. v5}, Linfo/blockchain/api/interfaces/ServiceWalletInterface;->newAddress(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lretrofit2/Call;

    move-result-object v0

    return-object v0
.end method

.method public send(Ljava/lang/String;JLjava/lang/String;Ljava/lang/Long;Ljava/lang/String;)Lretrofit2/Call;
    .registers 9
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "J",
            "Ljava/lang/String;",
            "Ljava/lang/Long;",
            "Ljava/lang/String;",
            ")",
            "Lretrofit2/Call",
            "<",
            "Linfo/blockchain/api/data/WalletPaymentResponse;",
            ">;"
        }
    .end annotation

    .prologue
    .line 133
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    .line 134
    invoke-static {p2, p3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v1

    invoke-interface {v0, p1, v1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 136
    invoke-virtual {p0, v0, p4, p5, p6}, Linfo/blockchain/api/wallet/Wallet;->sendMany(Ljava/util/Map;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/String;)Lretrofit2/Call;

    move-result-object v0

    return-object v0
.end method

.method public sendMany(Ljava/util/Map;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/String;)Lretrofit2/Call;
    .registers 18
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/Long;",
            ">;",
            "Ljava/lang/String;",
            "Ljava/lang/Long;",
            "Ljava/lang/String;",
            ")",
            "Lretrofit2/Call",
            "<",
            "Linfo/blockchain/api/data/WalletPaymentResponse;",
            ">;"
        }
    .end annotation

    .prologue
    .line 153
    const/4 v6, 0x0

    .line 154
    const/4 v7, 0x0

    .line 155
    const/4 v8, 0x0

    .line 157
    invoke-interface {p1}, Ljava/util/Map;->size()I

    move-result v0

    const/4 v1, 0x1

    if-ne v0, v1, :cond_41

    .line 158
    const-string v2, "payment"

    .line 159
    invoke-interface {p1}, Ljava/util/Map;->entrySet()Ljava/util/Set;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/Map$Entry;

    .line 160
    invoke-interface {v0}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/String;

    .line 161
    invoke-interface {v0}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Long;

    invoke-virtual {v0}, Ljava/lang/Long;->toString()Ljava/lang/String;

    move-result-object v7

    move-object v6, v1

    .line 167
    :goto_2b
    iget-object v0, p0, Linfo/blockchain/api/wallet/Wallet;->serviceInterface:Linfo/blockchain/api/interfaces/ServiceWalletInterface;

    iget-object v1, p0, Linfo/blockchain/api/wallet/Wallet;->identifier:Ljava/lang/String;

    iget-object v3, p0, Linfo/blockchain/api/wallet/Wallet;->password:Ljava/lang/String;

    iget-object v4, p0, Linfo/blockchain/api/wallet/Wallet;->secondPassword:Ljava/lang/String;

    iget-object v5, p0, Linfo/blockchain/api/wallet/Wallet;->apiCode:Ljava/lang/String;

    .line 170
    invoke-virtual/range {p3 .. p3}, Ljava/lang/Long;->longValue()J

    move-result-wide v10

    move-object v9, p2

    move-object/from16 v12, p4

    .line 167
    invoke-interface/range {v0 .. v12}, Linfo/blockchain/api/interfaces/ServiceWalletInterface;->send(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;JLjava/lang/String;)Lretrofit2/Call;

    move-result-object v0

    return-object v0

    .line 163
    :cond_41
    const-string v2, "sendmany"

    .line 164
    new-instance v0, Lcom/fasterxml/jackson/databind/ObjectMapper;

    invoke-direct {v0}, Lcom/fasterxml/jackson/databind/ObjectMapper;-><init>()V

    invoke-virtual {v0, p1}, Lcom/fasterxml/jackson/databind/ObjectMapper;->writeValueAsString(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v8

    goto :goto_2b
.end method

.method public unarchiveAddress(Ljava/lang/String;)Lretrofit2/Call;
    .registers 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            ")",
            "Lretrofit2/Call",
            "<",
            "Linfo/blockchain/api/data/WalletAddressUnarchiveResponse;",
            ">;"
        }
    .end annotation

    .prologue
    .line 224
    iget-object v0, p0, Linfo/blockchain/api/wallet/Wallet;->serviceInterface:Linfo/blockchain/api/interfaces/ServiceWalletInterface;

    iget-object v1, p0, Linfo/blockchain/api/wallet/Wallet;->identifier:Ljava/lang/String;

    iget-object v2, p0, Linfo/blockchain/api/wallet/Wallet;->password:Ljava/lang/String;

    iget-object v3, p0, Linfo/blockchain/api/wallet/Wallet;->apiCode:Ljava/lang/String;

    invoke-interface {v0, v1, v2, v3, p1}, Linfo/blockchain/api/interfaces/ServiceWalletInterface;->unarchiveAddress(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lretrofit2/Call;

    move-result-object v0

    return-object v0
.end method