Skip to content

Crossmint/crossmint-rain-integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rain x Crossmint Integration

Scripts for integrating Rain card collateral management with Crossmint Stellar smart wallets.

Setup

Install dependencies:

pnpm i

Copy .env.example to .env and fill in:

CROSSMINT_API_KEY=
RAIN_API_KEY=
STELLAR_WALLET_SECRET=

Scripts

create-consumer-application

pnpm create-consumer-application

Generates a new Stellar keypair, creates a Crossmint smart wallet using that keypair as the server signer, then registers a Rain consumer application linked to that wallet address. Prints the wallet address and Rain application data. Run this once to set up a new user.


get-contracts

pnpm get-contracts

Fetches the Rain contracts associated with a user (configured by USER_ID in the script). Prints the full contract list including proxy and controller addresses. Useful for inspecting what collateral contracts exist for a user.


get-withdrawal-signature

pnpm get-withdrawal-signature

Requests a withdrawal signature from the Rain API for a specific user, token, amount, and chain. Prints the signed parameters needed to execute a withdrawal on-chain. Useful for debugging the signature step in isolation.


transfer-usdc

pnpm transfer-usdc

Transfers USDC from a Crossmint Stellar smart wallet to a recipient address. Requires STELLAR_WALLET_SECRET in your .env. Configure WALLET_ADDRESS and RECIPIENT_ADDRESS in the script before running.


withdraw

pnpm withdraw

End-to-end withdrawal flow:

  1. Requests a withdrawal signature from Rain
  2. Fetches the user's contracts to resolve the coordinator address
  3. Executes the withdrawal on-chain via the Crossmint Stellar wallet

Configure USER_ID, TOKEN, AMOUNT, ADMIN_ADDRESS, RECIPIENT_ADDRESS, and CHAIN_ID at the top of the script before running.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors