walletOS Workflows: Simplifying Wallet Operations

walletOS Workflows: Simplifying Wallet Operations

At Pine Street Labs, we're about creating a seamless developer experience across all blockchains. With walletOS, we've created a uniform API across over 20 blockchains, abstracting away network specifics for developers. walletOS is designed to reduce the complexities associated with blockchain wallet engineering, allowing you to focus on what truly matters - delivering exceptional product experiences.

In this blog post, we'll delve into three core workflows of walletOS, demonstrating how effortlessly you can perform essential wallet functions using our API.

1) Sending a Transfer

With walletOS, sending assets across any blockchain network is standardized. Here's how:

Create the Transaction: Use the transfer endpoint. You don't need to know the specifics of the blockchain you're interacting with; just provide the business logic of:

  • Sending address
  • Token being sent
  • Token amount
  • Recipient address
transfer request

walletOS then provides you with the raw transaction, the data associated with that transaction, the digest, which elliptic curve is being used, and the address that you’re signing for.

transfer response

Verify the Transaction: Before signing and broadcasting, you can use walletOS to verify the transaction's integrity with the explain_transaction endpoint. You can make this request by providing the raw transaction provided by transfer.

explain_transaction request

The response provides a list of effects that the transaction will have, allowing you to verify that the transaction is correct.

explain_transaction response

Sign the Transaction: walletOS is non-custodial, meaning that signing happens outside of our system with whatever signing process you want to use. transfer makes signing easy by providing you with everything you need to create a signature for a transaction: the raw serialized transaction, the transaction digest, and instructions to sign.

Broadcast the Transaction: Once you’ve generated a signature for the transaction, use the broadcast endpoint to attach the signature to the transaction and broadcast to an RPC node.

broadcast request

What you get back is a transaction ID that you can use to track the state of the transaction.

broadcast response

Inspect the Result + Track Transaction Status: After broadcasting, you need to track that transaction’s status and communicate the status to your users. walletOS makes this very easy to do with the get_transaction endpoint.

In your request to get_transaction, you simply provide the response given by broadcast with the corresponding transaction ID for the transaction you’re tracking.

get_transaction request

walletOS then provides you with a detailed breakdown of the transaction effects, such as balance deltas, as well as the status of the transaction. This allows you to communicate to your users whether a transaction is pending, confirmed, failed, etc.

get_transaction response

2) Processing a Deposit

walletOS makes processing deposits across blockchains very simple for developers, requiring two API calls:

  • List Transactions: Start by using the list_transactions endpoint. This will detect any transaction associated with a given blockchain address.

In the request body, you simply provide a valid address.

list_transactions request

What you get back is a list of all transactions associated with that address

list_transactions response
  • Get Transaction Details: If list_transactions detects a non-finalized transaction, you can get more information on that transaction with the get_transaction endpoint. As explored above, this provides a comprehensive overview of the transaction, including its effects or balance deltas.
get_transaction request

This provides a comprehensive overview of the transaction, including its effects or balance deltas.

get_transaction response
  • Determine Deposit Value: The balance deltas from get_transaction allows you to easily ascertain a deposit's value and communicate that information to your end user in your product.

3) Displaying Balances

Displaying balances is very straightforward in walletOS, only requiring one endpoint:

  • Fetch Token Balances: Developers can call the get_token_balances endpoint to retrieve the current balance for multiple tokens associated with a blockchain address. Ensure that your users always have up-to-date information about their holdings.
get_transaction request
get_transaction response

The walletOS Advantage

  • Uniformity Across Blockchains: A consistent experience across the API, no matter which of the 20+ supported networks you’re using.
  • Built with Wallet Operations in Mind: Our endpoints have been purposefully designed to make wallet operations and workflows as easy as possible so that you can focus on creating the product experience you want.
  • Consistent Data Formats: Data across blockchains can vary, but with walletOS, all chain data is delivered in a uniform format, making integrating data into your application trivial.

Ready to Build with walletOS?

Book a demo with Pine Street Labs today and see for yourself how walletOS can help you build amazing crypto products.