Adding Contracts

Learn how to add contracts.

Sealer supports two ways of adding contracts:

  • Add a contract and let the signers sign the contract on their side.
  • Add a contract and sign it with the signatures at the same time.

If you created a template previously, you can link it to your contract when you add the contract.

🚧

Requirements

You need your API key to perform the actions on this page.
You also need the Sealer Admin Role.


Adding Contracts

Add a contract by performing a standard create contract call with your API key in the header. Your API key must be valid for this to work. If you don't have an API key, follow this short tutorial to get one.

Add contract that needs to be signed

Performing a create contract call without the signatures parameter will add the contract. It will also send emails to the signer emails provided. The signers will use the link in the email to sign the contract.

Let's try it out!

curl -X POST \
  https://api.mantleblockchain.com/sealer/{{PRODUCT_ID}}/contracts \
  -H 'Accept: text/plain, application/json, text/json' \
  -H 'Content-Type: multipart/form-data' \
  -H 'x-api-key: {{YOUR_API_KEY}}' \
  -F 'file={{CONTRACT_FILE}}' \
  -F 'displayName={{CONTRACT_DISPLAY_NAME}}' \
  -F 'signerEmails={{SIGNER_EMAIL_1}}'
  -F 'signerEmails={{SIGNER_EMAIL_2}}'

Replace the following parameters:

{{PRODUCT_ID}}: Your Product id
{{YOUR_API_KEY}}: Your own API key
{{CONTRACT_FILE}}: The contract file you want to upload
{{CONTRACT_DISPLAY_NAME}}: The display name of the new contract
{{SIGNER_EMAIL_1}}: The email of one of the signer
{{SIGNER_EMAIL_2}}: The email of the other signer

If you want to add more signer emails, just add more signerEmails parameters.

πŸ‘

Congratulations!

You've created a contract in Sealer!

Add a contract and sign it with the signatures at the same time.

Performing a create contract call with the signatures parameter will add the contract and sign it with the signatures provided.

The signatures and the signerEmails parameters orders are crucial in this call.

The first signatures parameter will be linked to the first signerEmails parameter, and so on.

🚧

Warning

The signerEmails and signatures parameters must be of the same size.

Let's try it out!

curl -X POST \
  https://api.mantleblockchain.com/sealer/{{PRODUCT_ID}}/contracts \
  -H 'Accept: text/plain, application/json, text/json' \
  -H 'Content-Type: multipart/form-data' \
  -H 'x-api-key: {{YOUR_API_KEY}}' \
  -F 'file={{CONTRACT_FILE}}' \
  -F 'displayName={{CONTRACT_DISPLAY_NAME}}' \
  -F 'signerEmails={{SIGNER_EMAIL_1}}' \
  -F 'signerEmails={{SIGNER_EMAIL_2}}' \
  -F 'signatures={{SIGNATURE_1}}' \
  -F 'signatures={{SIGNATURE_2}}'

Replace the following parameters:

{{PRODUCT_ID}}: Your Product id
{{YOUR_API_KEY}}: Your own API key
{{CONTRACT_FILE}}: The contract file you want to upload
{{CONTRACT_DISPLAY_NAME}}: The display name of the new contract
{{SIGNER_EMAIL_1}}: The email of the first signer
{{SIGNER_EMAIL_2}}: The email of the second signer
{{SIGNATURE_1}}: The signature of the first signer
{{SIGNATURE_2}}: The signature of the second signer

If you want to add more signer emails, just add more signerEmails parameters.
If you want to add more signatures, just add more signatures parameters.

πŸ‘

Congratulations!

You've created a signed contract!

Link a template to your contract

To link a template to the new contract you are about to add, just perform the create contract call above with one more parameter: templateId.

On the previous curl requests, add the following line:

-F 'templateId={{TEMPLATE_ID}}'

Replace: {{TEMPLATE_ID}} by the template ID