Prerequisites
- Ensure you have a wallet created.
- API Key: Ensure you have an API key with the scopes:
wallets:transactions.create.
Sending a contract call transaction
- React
- Node.js
- React Native
- REST
Report incorrect code
Copy
Ask AI
import { useWallet, StellarWallet } from '@crossmint/client-sdk-react-ui';
const { wallet } = useWallet();
const stellarWallet = StellarWallet.from(wallet);
const { hash, explorerLink } = await stellarWallet.sendTransaction({
contractId: "GB3KQJ6N2YIE62YVO67X7W5TQK6Q5ZZ4P2LUVK2U6AU26CJQ626J",
method: "transfer",
args: {
to: "GB3KQJ6N2YIE62YVO67X7W5TQK6Q5ZZ4P2LUVK2U6AU26CJQ626J",
from: "GB3KQJ6N2YIE62YVO67X7W5TQK6Q5ZZ4P2LUVK2U6AU26CJQ626J",
amount: "1000000000000000000"
}
});
Parameters
The contract ID to send the transaction to.
The method to call on the contract.
The arguments to pass to the method.
Returns
The hash of the transaction.
The explorer link of the transaction.
Report incorrect code
Copy
Ask AI
import { CrossmintWallets, createCrossmint, StellarWallet } from "@crossmint/wallets-sdk";
const crossmint = createCrossmint({
apiKey: "<your-server-api-key>",
});
const crossmintWallets = CrossmintWallets.from(crossmint);
const wallet = await crossmintWallets.getWallet(
"email:[email protected]:stellar",
{ chain: "stellar", signer: { type: "email" } }
);
const stellarWallet = StellarWallet.from(wallet);
const { hash, explorerLink } = await stellarWallet.sendTransaction({
contractId: "GB3KQJ6N2YIE62YVO67X7W5TQK6Q5ZZ4P2LUVK2U6AU26CJQ626J",
method: "transfer",
args: {
to: "GB3KQJ6N2YIE62YVO67X7W5TQK6Q5ZZ4P2LUVK2U6AU26CJQ626J",
from: "GB3KQJ6N2YIE62YVO67X7W5TQK6Q5ZZ4P2LUVK2U6AU26CJQ626J",
amount: "1000000000000000000"
}
});
Parameters
The contract ID to send the transaction to.
The method to call on the contract.
The arguments to pass to the method.
Returns
The hash of the transaction.
The explorer link of the transaction.
Report incorrect code
Copy
Ask AI
import { useWallet, StellarWallet } from '@crossmint/client-sdk-react-native-ui';
const { wallet } = useWallet();
const stellarWallet = StellarWallet.from(wallet);
const { hash, explorerLink } = await stellarWallet.sendTransaction({
contractId: "GB3KQJ6N2YIE62YVO67X7W5TQK6Q5ZZ4P2LUVK2U6AU26CJQ626J",
method: "transfer",
args: {
to: "GB3KQJ6N2YIE62YVO67X7W5TQK6Q5ZZ4P2LUVK2U6AU26CJQ626J",
from: "GB3KQJ6N2YIE62YVO67X7W5TQK6Q5ZZ4P2LUVK2U6AU26CJQ626J",
amount: "1000000000000000000"
}
});
Parameters
The contract ID to send the transaction to.
The method to call on the contract.
The arguments to pass to the method.
Returns
The hash of the transaction.
The explorer link of the transaction.
Transactions must be approved by one of the wallet’s signers.
The SDK handles this automatically, but with the REST API you must approve the transaction to complete it.Sign the approval message field returned in the response inside
1
Create the transaction
Call the create transaction endpoint.See the API reference for more details.
Report incorrect code
Copy
Ask AI
curl --request POST \
--url https://staging.crossmint.com/api/2025-06-09/wallets/email:[email protected]:stellar/transactions \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '{
"params": {
"transaction": {
"type": "contract-call",
"contractId": "GB3KQJ6N2YIE62YVO67X7W5TQK6Q5ZZ4P2LUVK2U6AU26CJQ626J",
"method": "transfer",
"args": {
"to": "GB3KQJ6N2YIE62YVO67X7W5TQK6Q5ZZ4P2LUVK2U6AU26CJQ626J",
"from": "GB3KQJ6N2YIE62YVO67X7W5TQK6Q5ZZ4P2LUVK2U6AU26CJQ626J",
"amount": "1000000000000000000"
}
}
}
}'
2
Sign the approval returned in the response
If you are using an
api-key as the admin signer you can skip the following steps.transaction.approvals using the signer.3
Approve the transaction
Call the approve transaction endpoint using the signature from the previous step and the transaction id returned in the call from Step 1.See the API reference for more details.
Report incorrect code
Copy
Ask AI
curl --request POST \
--url https://staging.crossmint.com/api/2025-06-09/wallets/email:[email protected]:stellar/transactions/91e90094-9fe0-43a7-bab6-e5725767a3ad/approvals \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '{
"approvals": [{
"signer": "email:[email protected]",
"signature": "5qY6wXw6zTn7..."
}]
}'

