Skip to content
Draft

wip #709

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions examples/go/custody_transfer.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
package main

import (
"context"
"fmt"
"log"

"github.com/coinbase/cdp-sdk/go/openapi"
)

func CustodyTransferExample() {
ctx := context.Background()

client, err := createCDPClient()
if err != nil {
log.Fatalf("Failed to create CDP client: %v", err)
}

// 1. List accounts
accountsResp, err := client.ListFoundationAccountsWithResponse(ctx, &openapi.ListFoundationAccountsParams{})
if err != nil {
log.Fatalf("Failed to list accounts: %v", err)
}
if accountsResp.JSON200 == nil {
log.Fatalf("Failed to list accounts: %s", string(accountsResp.Body))
}
accounts := accountsResp.JSON200.Accounts
fmt.Printf("Found %d accounts:\n", len(accounts))
for _, account := range accounts {
fmt.Printf(" %s (%s) - type: %s\n", account.AccountId, account.Name, account.Type)
}

if len(accounts) == 0 {
fmt.Println("No accounts found. Create one in the CDP dashboard first.")
return
}

// 2. Get balances for the first account
account := accounts[0]
balancesResp, err := client.ListBalancesWithResponse(ctx, account.AccountId, &openapi.ListBalancesParams{})
if err != nil {
log.Fatalf("Failed to list balances: %v", err)
}
fmt.Printf("\nBalances for %s:\n", account.Name)
for _, balance := range balancesResp.JSON200.Balances {
fmt.Printf(" %s: %s\n", balance.Asset, balance.Amount)
}

// 3. Create a quoted transfer (execute=false — no funds move)
var source openapi.CreateTransferSource
if err := source.FromTransfersAccount(openapi.TransfersAccount{
AccountId: account.AccountId,
Asset: "usd",
}); err != nil {
log.Fatalf("Failed to build transfer source: %v", err)
}

var target openapi.TransferTarget
if err := target.FromOnchainAddress(openapi.OnchainAddress{
Address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
Network: "base",
Asset: "usdc",
}); err != nil {
log.Fatalf("Failed to build transfer target: %v", err)
}

transferResp, err := client.CreateTransferWithResponse(ctx, &openapi.CreateTransferParams{},
openapi.CreateTransferJSONRequestBody{
Source: source,
Target: target,
Amount: "10.00",
Asset: "usd",
Execute: false,
},
)
if err != nil {
log.Fatalf("Failed to create transfer: %v", err)
}
transfer := transferResp.JSON200
fmt.Printf("\nCreated transfer %s:\n", transfer.TransferId)
fmt.Printf(" Status: %s\n", transfer.Status)
fmt.Printf(" Source: %s %s\n", transfer.SourceAmount, transfer.SourceAsset)
fmt.Printf(" Target: %s %s\n", transfer.TargetAmount, transfer.TargetAsset)
fmt.Printf(" Expires: %s\n", transfer.ExpiresAt)

// 4. List recent transfers
status := openapi.TransferStatus("quoted")
transfersResp, err := client.ListTransfersWithResponse(ctx, &openapi.ListTransfersParams{Status: &status})
if err != nil {
log.Fatalf("Failed to list transfers: %v", err)
}
fmt.Printf("\n%d quoted transfers found.\n", len(transfersResp.JSON200.Transfers))
}
6 changes: 4 additions & 2 deletions examples/go/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module example.com/m/v2

go 1.24.0
go 1.24.3

require (
github.com/coinbase/cdp-sdk/go v0.0.0-20251024190004-8f3878c202dc
Expand All @@ -27,7 +27,7 @@ require (
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/holiman/uint256 v1.3.2 // indirect
github.com/oapi-codegen/runtime v1.1.1 // indirect
github.com/oapi-codegen/runtime v1.4.1 // indirect
github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible // indirect
github.com/supranational/blst v0.3.16 // indirect
github.com/tklauser/go-sysconf v0.3.12 // indirect
Expand All @@ -40,3 +40,5 @@ require (
golang.org/x/sync v0.18.0 // indirect
golang.org/x/sys v0.41.0 // indirect
)

replace github.com/coinbase/cdp-sdk/go => ../../go
31 changes: 16 additions & 15 deletions examples/go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,15 @@ github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwP
github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo=
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ=
github.com/coinbase/cdp-sdk/go v0.0.0-20251024190004-8f3878c202dc h1:nkYJEEEHRIHYqkdXD74cK0RhlKRDlQ3gIlw6OG5+dOU=
github.com/coinbase/cdp-sdk/go v0.0.0-20251024190004-8f3878c202dc/go.mod h1:7SCUyseVQvmT158f23xvVghYF7dYxypj0sw+558F+7g=
github.com/consensys/gnark-crypto v0.19.2 h1:qrEAIXq3T4egxqiliFFoNrepkIWVEeIYwt3UL0fvS80=
github.com/consensys/gnark-crypto v0.19.2/go.mod h1:rT23F0XSZqE0mUA0+pRtnL56IbPxs6gp4CeRsBk4XS0=
github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc=
github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/crate-crypto/go-eth-kzg v1.4.0 h1:WzDGjHk4gFg6YzV0rJOAsTK4z3Qkz5jd4RE3DAvPFkg=
github.com/crate-crypto/go-eth-kzg v1.4.0/go.mod h1:J9/u5sWfznSObptgfa92Jq8rTswn6ahQWEuiLHOjCUI=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dchest/siphash v1.2.3 h1:QXwFc8cFOR2dSa/gE6o/HokBMWtLUaNDVd+22aKHeEA=
github.com/dchest/siphash v1.2.3/go.mod h1:0NvQU092bT0ipiFN++/rXm69QG9tVxLAlQHIXMPAkHc=
github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM=
Expand Down Expand Up @@ -108,8 +106,8 @@ github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwA
github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE=
github.com/klauspost/compress v1.17.8 h1:YcnTYrq7MikUT7k0Yb5eceMmALQPYBW/Xltxn0NAMnU=
github.com/klauspost/compress v1.17.8/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw=
github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=
github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM=
github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
Expand All @@ -118,8 +116,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/leanovate/gopter v0.2.11 h1:vRjThO1EKPb/1NsDXuDrzldR28RLkBflWYcU9CvzWu4=
github.com/leanovate/gopter v0.2.11/go.mod h1:aK3tzZP/C+p1m3SPRE4SYZFGP7jjkuSI4f7Xvpt0S9c=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
Expand All @@ -130,8 +128,10 @@ github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxd
github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mitchellh/pointerstructure v1.2.0 h1:O+i9nHnXS3l/9Wu7r4NrEdwA2VFTicjUEN1uBnDo34A=
github.com/mitchellh/pointerstructure v1.2.0/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4=
github.com/oapi-codegen/runtime v1.1.1 h1:EXLHh0DXIJnWhdRPN2w4MXAzFyE4CskzhNLUmtpMYro=
github.com/oapi-codegen/runtime v1.1.1/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg=
github.com/oapi-codegen/nullable v1.1.0 h1:eAh8JVc5430VtYVnq00Hrbpag9PFRGWLjxR1/3KntMs=
github.com/oapi-codegen/nullable v1.1.0/go.mod h1:KUZ3vUzkmEKY90ksAmit2+5juDIhIZhfDl+0PwOQlFY=
github.com/oapi-codegen/runtime v1.4.1 h1:9nwLoI+KrWxzbBcp0jO/R8uXqbik/HUyCvPeU68Y/qo=
github.com/oapi-codegen/runtime v1.4.1/go.mod h1:GwV7hC2hviaMzj+ITfHVRESK5J2W/GefVwIND/bMGvU=
github.com/pion/dtls/v2 v2.2.7 h1:cSUBsETxepsCSFSxC3mc/aDo14qQLMSL+O6IjG28yV8=
github.com/pion/dtls/v2 v2.2.7/go.mod h1:8WiMkebSHFD0T+dIU+UeBaoV7kDhOW5oDCzZ7WZ/F9s=
github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY=
Expand All @@ -144,8 +144,9 @@ github.com/pion/transport/v3 v3.0.1 h1:gDTlPJwROfSfz6QfSi0ZmeCSkFcnWWiiR9ES0ouAN
github.com/pion/transport/v3 v3.0.1/go.mod h1:UY7kiITrlMv7/IKgd5eTUcaahZx5oUN3l9SzK5f5xE0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v1.15.0 h1:5fCgGYogn0hFdhyhLbw7hEsWxufKtY9klyvdNfFlFhM=
github.com/prometheus/client_golang v1.15.0/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk=
github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4=
Expand Down Expand Up @@ -191,8 +192,8 @@ go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6
go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA=
golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts=
golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos=
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME=
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8=
golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI=
golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I=
golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand All @@ -203,8 +204,8 @@ golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk=
golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA=
golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY=
golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc=
Expand Down
5 changes: 4 additions & 1 deletion examples/go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ func main() {
SendTransactionExample()
case "send_user_operation":
SendUserOperationExample()
case "custody_transfer":
CustodyTransferExample()
default:
fmt.Printf("Unknown example: %s\n", exampleName)
printUsage()
Expand All @@ -30,4 +32,5 @@ func printUsage() {
fmt.Println("Available examples:")
fmt.Println(" send_transaction - Create an EVM account and send a transaction")
fmt.Println(" send_user_operation - Create a smart account and send a user operation")
}
fmt.Println(" custody_transfer - List custody accounts and create a quoted transfer")
}
8 changes: 8 additions & 0 deletions examples/java/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,13 @@ tasks.register<JavaExec>("runRetryConfiguration") {
classpath = sourceSets["main"].runtimeClasspath
}

tasks.register<JavaExec>("runCustodyTransfer") {
group = "examples"
description = "List custody accounts and create a quoted transfer"
mainClass.set("com.coinbase.cdp.examples.custody.ListAccountsAndTransfer")
classpath = sourceSets["main"].runtimeClasspath
}

// Task to list all available example tasks
tasks.register("listExamples") {
group = "examples"
Expand All @@ -148,6 +155,7 @@ tasks.register("listExamples") {
println(" ./gradlew runListSolanaAccounts - List Solana accounts")
println(" ./gradlew runSolanaTransfer - Transfer SOL between accounts")
println(" ./gradlew runRetryConfiguration - Configure HTTP retry behavior")
println(" ./gradlew runCustodyTransfer - List custody accounts and create a quoted transfer")
println("\nOr run any example directly:")
println(" ./gradlew run -PmainClass=com.coinbase.cdp.examples.evm.CreateAccount")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
package com.coinbase.cdp.examples.custody;

import com.coinbase.cdp.CdpClient;
import com.coinbase.cdp.examples.utils.EnvLoader;
import com.coinbase.cdp.openapi.api.AccountsApi;
import com.coinbase.cdp.openapi.api.TransfersApi;
import com.coinbase.cdp.openapi.model.CreateTransferSource;
import com.coinbase.cdp.openapi.model.Network;
import com.coinbase.cdp.openapi.model.OnchainAddress;
import com.coinbase.cdp.openapi.model.TransferRequest;
import com.coinbase.cdp.openapi.model.TransferStatus;
import com.coinbase.cdp.openapi.model.TransferTarget;
import com.coinbase.cdp.openapi.model.TransfersAccount;

/**
* Example: Flexible Custody API flow.
*
* <p>Demonstrates listing accounts, checking balances, creating a quoted transfer,
* and listing recent transfers using the auto-generated OpenAPI client.
*
* <p>Usage: ./gradlew runCustodyTransfer
*/
public class ListAccountsAndTransfer {

public static void main(String[] args) throws Exception {
EnvLoader.load();

try (CdpClient cdp = CdpClient.create()) {
var apiClient = cdp.getApiClient();
AccountsApi accountsApi = new AccountsApi(apiClient);
TransfersApi transfersApi = new TransfersApi(apiClient);

// 1. List accounts
var accountsResponse = accountsApi.listFoundationAccounts(null, null, null);
var accounts = accountsResponse.getAccounts();
System.out.printf("Found %d accounts:%n", accounts.size());
for (var account : accounts) {
System.out.printf(" %s (%s) - type: %s%n",
account.getAccountId(), account.getName(), account.getType());
}

if (accounts.isEmpty()) {
System.out.println("No accounts found. Create one in the CDP dashboard first.");
return;
}

// 2. Get balances for the first account
var account = accounts.get(0);
var balancesResponse = accountsApi.listBalances(account.getAccountId(), null, null);
System.out.printf("%nBalances for %s:%n", account.getName());
for (var balance : balancesResponse.getBalances()) {
System.out.printf(" %s: %s%n", balance.getAsset(), balance.getAmount());
}

// 3. Create a quoted transfer (execute=false — no funds move)
var source = new CreateTransferSource();
source.setActualInstance(new TransfersAccount().accountId(account.getAccountId()).asset("usd"));

var target = new TransferTarget();
target.setActualInstance(new OnchainAddress()
.address("0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913")
.network(Network.BASE)
.asset("usdc"));

var transferRequest = new TransferRequest()
.source(source)
.target(target)
.amount("10.00")
.asset("usd")
.execute(false);

var transfer = transfersApi.createTransfer(null, transferRequest);
System.out.printf("%nCreated transfer %s:%n", transfer.getTransferId());
System.out.printf(" Status: %s%n", transfer.getStatus());
System.out.printf(" Source: %s %s%n", transfer.getSourceAmount(), transfer.getSourceAsset());
System.out.printf(" Target: %s %s%n", transfer.getTargetAmount(), transfer.getTargetAsset());
System.out.printf(" Expires: %s%n", transfer.getExpiresAt());

// 4. List recent transfers
var transfersResponse = transfersApi.listTransfers(
TransferStatus.QUOTED, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);
System.out.printf("%n%d quoted transfers found.%n",
transfersResponse.getTransfers().size());
}
}
}
Loading
Loading