2. Implement this OpenAPI Spec
MMI Staking - Connector (0.0.1)
Download OpenAPI specification:Download
MMI Staking is a web service that "talks" with staking providers through a specific and common REST API, defined by MMI. In order for it to talk with your existing API, you need to implement and host a Connector: a REST web service that sits between MMI Staking and your existing API, and that stands as an adaptation layer. The Connector must support this OpenAPI specification.
Initiate a Stake
Inititate a stake by idempotently reserving a validator
for the specific client. Requires an idempotent key.
It takes the supplied "type 1" withdrawal_pubkey
ETH1 address, the amount
which must be equal to 32,000,000,000 Gwei
(32 ETH
) and a fee_recipient
ETH1 address.
It returns the deposit payload for the user to send.
Authorizations:
header Parameters
Idempotency-Key required | string <uuid> Example: f1c971b4-7114-4c4b-8ad2-a6f9e33e2cd0 the unique idempotency key for this request |
Request Body schema: application/jsonrequired
Withdrawal Public Key, the pledged Amount of 32,000,000,000 Gwei (32 ETH).
amount required | string (Gwei) ^[0-9]+$ |
fee_recipient required | string (Eth1Address) ^0x[a-fA-F0-9]{40}$ An Ethereum 1 address, uniquely identifying them. 20-bytes, hex encoded with 0x prefix, case insensitive. |
withdrawal_pubkey required | string (WithdrawalPublickey) ^0x[a-fA-F0-9]{40}$ An Ethereum 1 address. MetaMask Institutional enforces "type 1" withdrawal credentials (based upon an Ethereum execution address), and prevents "type 0" withdrawal credentials (based upon a BLS private key). 20-bytes, hex encoded with 0x prefix, case insensitive. |
Responses
Request samples
- Payload
{- "withdrawal_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc",
- "amount": "32000000000",
- "fee_recipient": "0x93247f2209abcacf57b75a51dafae777f9dd38bc"
}
Response samples
- 200
- 400
- 401
- 403
- 500
{- "chain_deposit_configuration": {
- "eth1_contract_address": "0x93247f2209abcacf57b75a51dafae777f9dd38bc",
- "chain_id": "18446744073709551615",
- "network_id": "18446744073709551615"
}, - "stake": {
- "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a",
- "withdrawal_credentials": "string",
- "amount": "32000000000",
- "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505",
- "deposit_root": "string",
- "deposit_message_root": "string",
- "hex": "string"
}, - "fee_recipient": "0x93247f2209abcacf57b75a51dafae777f9dd38bc"
}
Exit a validator
Exit a validator immediately by signing the exit transaction and broadcasting it to the Beacon chain.
Note: You can optionally support exits via a transaction made from the withdrawal address into a given smart contract. In that case, make this endpoint return a 501 Not Implemented
error.
Authorizations:
Responses
Response samples
- 400
- 401
- 404
- 500
- 501
{- "code": 400,
- "message": "valPubKey must match /^0x[a-fA-F0-9]{96}$/ regular expression"
}
Request a signed voluntary exit message
Returns a signed voluntary exit message, but does not initiate the actual exit.
Authorizations:
Responses
Response samples
- 200
- 400
- 401
- 404
- 500
{- "exit_transaction": {
- "message": {
- "epoch": "18446744073709551615",
- "validator_index": "18446744073709551615"
}, - "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
}, - "fork_version": "0x00000000"
}