Endpoints

Base URL:

https://api.mama.io/v1/reforge

`Prepare a Transaction

  • POST /prepareReforge

    Prepares 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 OK

      • Content: { "status": true, "tx": "prepared_transaction_data" }

    • Error Response: 400 Bad Request

      • Content: { "error": "error_message" }

Execute a Transaction Asynchronously

  • POST /executeReforgeAsync

    Executes a prepared transaction asynchronously.

    • Body Parameters:

      • A TXRequest object containing the transaction data and wallet information.

    • Success Response: 200 OK

      • Content: { "status": true, "receipt": transaction_receipt }

    • Error Response: 400 Bad Request

      • Content: { "error": "error_message" }

Execute a Transaction

  • POST /executeReforge

    Executes a prepared transaction.

    • Body Parameters:

      • A TXRequest object as described above.

    • Success Response: 200 OK

      • Content: { "status": true, "tx": transaction_response }

    • Error Response: 400 Bad Request

      • Content: { "error": "error_message" }

Get Supported Chains and Tokens

  • GET /getChainsAndTokens

    Retrieves information about supported chains and their tokens.

    • Success Response: 200 OK

      • Content: [{"name": "chain_name", "chainId": "chain_id", "tokens": {token_details}}]

    • Error Response: 400 Bad Request

      • Content: { "error": "error_message" }

Get Supported Test Chains and Tokens

  • GET /getTestChainsAndTokens

    Retrieves information about supported test chains and their tokens.

    • Success Response: 200 OK

      • Content: Same structure as /getChainsAndTokens.

    • Error Response: 400 Bad Request

      • Content: 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 js JsonRpcSigner)

Also you can try to fork our Postman collection and play with it.

Last updated