Fireblocks MPC Custody & B2B Trading

How to configure addons in Marionette:

  1. Register a new api-user in fireblocks (see https://support.fireblocks.io/hc/en-us/articles/4407823826194-Adding-new-API-users)

  2. Save the private key file on the deployment server (<marionette>/config/secrets/fireblocks_secret.key)

  3. Register webhook url.

  4. Add a new section to the global config file (<marionette>/global/config.yaml)

fireblocks: enabled: true id: "fireblocks" secretFileName: "fireblocks_secret.key" apiKey: "xxxx" fireblocksServices: - baseAsset: ETH_TEST3 servicePrefix: FIREBLOCKS-GOERLI-PI title: Fireblocks Eth Goerli subtitle: ERC20 description: "" explorer_address: "https://goerli.etherscan.io/address/#{address}" explorer_transaction: "https://goerli.etherscan.io/address/#{txid}" invoiceBased: 0 chainId: 5 multiCurrency: 1 isCollectable: 0
  • enabled - false - quickly turn off the service without clearing template files

  • id - container name in Docker, name of common service in Moleculer (this service serves webhooks)

  • secretFileName - Under this name will we mount the file with the private key

  • apiKey - Fireblocks api key

  • fireblocksServices - array of fireblocks service (for splitting currencies across blockchains)

  • baseAsset - token’s name for current blockchain

Following parameters will be used for configure payment interface

  • servicePrefix

  • title

  • subtitle

  • description

  • invoiceBased

  • chainId

  • multiCurrency

  • isCollectable

5. Add configuration file <marionette>/templates/config/fireblocks.json.t

{{#if fireblocks.enabled}} { "fireblocks": { "secret_file": "{{fireblocks.secretFileName}}", "api_key": "{{fireblocks.apiKey}}" }, "fireblocks_path": "/fireblocks/webhook", "fireblocks_services": [ {{#each fireblocks.fireblocksServices}} {{#if @index}},{{/if}} { "baseAsset": "{{baseAsset}}", "service_prefix": "{{servicePrefix}}", "title": "{{title}}", "subtitle": "{{subtitle}}", "description": "{{description}}", "invoiceBased": {{#if invoiceBased}}true{{else}}false{{/if}}, "chainId": {{chainId}}, "explorerAddress": "{{explorer_address}}", "explorerTransaction": "{{explorer_transaction}}", "multiCurrency": {{#if multiCurrency}}true{{else}}false{{/if}}, "isCollectable": {{#if isCollectable}}true{{else}}false{{/if}} } {{/each}} ] } {{/if}}

6. Add to compose templates <marionette>/templates/compose/paymentInterfaces.yaml.t

{{#if fireblocks.enabled}} {{fireblocks.id}}: image: gitlab.tunex.io:5050/externals/fireblocks:latest hostname: {{fireblocks.id}} restart: always command: node index.js volumes: - ../config/fireblocks.json:/app/config.json - ../config/secrets/fireblocks_secret.key:/app/{{fireblocks.secretFileName}} depends_on: - db-bridge labels: - "traefik.http.routers.fireblocks.rule=Host(`{{base_url}}`) && PathPrefix(`/fireblocks/webhook`)" - "traefik.enable=true" - "traefik.http.services.fireblocks.loadbalancer.server.port=3000" {{#if components.traefik.ssl}} - "traefik.http.routers.fireblocks.entrypoints=websecure" - "traefik.http.routers.fireblocks.tls=true" - "traefik.http.routers.fireblocks.tls.certresolver=myresolver" {{else}} - "traefik.http.routers.fireblocks.entrypoints=web" {{/if}} {{/if}}

How to configure Fireblocks in setter

  1. After deployment check if the configured data appeared in the configuration blockchains and payment interface lists

  2. For added blockchains on details page push “Create wallet” button.

  3. Configure currencies for fireblocks:

Field “Smart contract/Fireblocks ID” must be contain:

  • assetId from fireblocks for coin and token

You can only receive a deposit in the configured currencies.

For withdrawals transaction police must be configured (see https://support.fireblocks.io/hc/en-us/articles/7354983580316-About-the-TAP)

N.B. Destination must be a one-time-address.

Be careful, transaction fees for all EVM networks and all supported tokens on each network are paid in the base asset of the network. Fees are withdrawn from the asset wallet that contains the base asset for that EVM network in the same vault account. Therefore, the associated wallet must have sufficient funds to pay the fee.

We recommend using the gas station mode to pay for withdrawals (see details on https://support.fireblocks.io/hc/en-us/articles/360016557960-Fireblocks-Gas-Station)