Supported SwapsThis endpoint supports the following conversions: USD <> USDC and USD <> PYUSD.For more assistance on how to create and track conversions, visit the stablecoins concepts page.
- Java
- .NET
- Go
- Python
- CLI
- TS/JS
Copy
Ask AI
TransactionsService transactionsService = PrimeServiceFactory.createTransactionsService(client);
CreateConversionRequest request = new CreateConversionRequest.Builder()
.portfolioId("PORTFOLIO_ID_HERE")
.walletId("WALLET_ID_HERE")
.amount("1")
.destination("DESTINATION_WALLET_UUID")
.idempotencyKey(UUID.randomUUID().toString())
.sourceSymbol("USD")
.destinationSymbol("USDC")
.build();
CreateConversionResponse response = transactionsService.createConversion(request);
Copy
Ask AI
var transactionsService = new TransactionsService(client);
var request = new CreateConversionRequest("PORTFOLIO_ID_HERE", "WALLET_ID_HERE")
{
Amount = "1",
Destination = "DESTINATION_WALLET_UUID",
IdempotencyKey = Guid.NewGuid().ToString(),
SourceSymbol = "USD",
DestinationSymbol = "USDC",
};
var response = transactionsService.CreateConversion(request);
Copy
Ask AI
transactionsService := transactions.NewTransactionsService(client)
request := &transactions.CreateConversionRequest{
PortfolioId: "PORTFOLIO_ID_HERE",
WalletId: "WALLET_ID_HERE",
Amount: "1",
Destination: "DESTINATION_WALLET_UUID",
IdempotencyKey: uuid.New().String(),
SourceSymbol: "USD",
DestinationSymbol: "USDC",
}
response, err := transactionsService.CreateConversion(context.Background(), request)
Copy
Ask AI
prime_client = PrimeClient(credentials)
request = CreateConversionRequest(
portfolio_id="PORTFOLIO_ID_HERE",
wallet_id="WALLET_ID_HERE",
amount = '1',
destination = 'DESTINATION_WALLET_UUID',
idempotency_key = str(uuid.uuid4()),
source_symbol = 'USD',
destination_symbol = 'USDC',
)
response = prime_client.create_conversion(request)
Copy
Ask AI
primectl create-conversion --help
Copy
Ask AI
const transactionsService = new TransactionsService(client);
transactionsService.createConversion({
portfolioId: 'PORTFOLIO_ID_HERE',
walletId: 'WALLET_ID_HERE',
amount: "1",
destination: "DESTINATION_WALLET_UUID",
idempotencyKey: uuidv4(),
sourceSymbol: "USD",
destinationSymbol: "USDC",
}).then(async (response) => {
console.log('Conversion: ', response);
})