Endpoints
Base URL:
https://api.mama.io/v1/reforge`Prepare a Transaction
POST
/prepareReforgePrepares transaction data for a cross-chain transfer.
Body Parameters:
sourceAmount: The amount of the source token to be transferred.sourceToken: The contract address of the source token.destinationToken: The contract address of the destination token.destinationChainId: The chain ID of the destination blockchain.sourceRpcUrl: (Optional) The RPC URL of the source blockchain.
Success Response:
200 OKContent:
{ "status": true, "tx": "prepared_transaction_data" }
Error Response:
400 Bad RequestContent:
{ "error": "error_message" }
Execute a Transaction Asynchronously
POST
/executeReforgeAsyncExecutes a prepared transaction asynchronously.
Body Parameters:
A
TXRequestobject containing the transaction data and wallet information.
Success Response:
200 OKContent:
{ "status": true, "receipt": transaction_receipt }
Error Response:
400 Bad RequestContent:
{ "error": "error_message" }
Execute a Transaction
POST
/executeReforgeExecutes a prepared transaction.
Body Parameters:
A
TXRequestobject as described above.
Success Response:
200 OKContent:
{ "status": true, "tx": transaction_response }
Error Response:
400 Bad RequestContent:
{ "error": "error_message" }
Get Supported Chains and Tokens
GET
/getChainsAndTokensRetrieves information about supported chains and their tokens.
Success Response:
200 OKContent:
[{"name": "chain_name", "chainId": "chain_id", "tokens": {token_details}}]
Error Response:
400 Bad RequestContent:
{ "error": "error_message" }
Get Supported Test Chains and Tokens
GET
/getTestChainsAndTokensRetrieves information about supported test chains and their tokens.
Success Response:
200 OKContent: Same structure as
/getChainsAndTokens.
Error Response:
400 Bad RequestContent: Same structure as
/getChainsAndTokens.
Types and Interfaces
TXRequest
An interface for transaction request data.
Properties:
tx:string- The encoded transaction data.walletData:IWalletData- Information about the wallet executing the transaction.
IWalletData
An interface for wallet data required to execute a transaction.
Properties:
rpcUrl:string- The RPC URL of the blockchain network.privateKey:string- The private key of the wallet.signer:JsonRpcSigner- The object of signer (eg. ether jsJsonRpcSigner)
Also you can try to fork our Postman collection and play with it.
Was this helpful?