Defender Relayer creation via API

Is it possible to create a Relayer instance via API? (But not via defender website, personal cabinet)

Hi @Rostyslav_Bortman, not currently but it's coming soon. Curious to know about your concrete use case, if your open to share?

Hey, @MartinVerzilli thanks for the quick answer. I think I could share in private messages if needed :slight_smile:

Do you have a timeline for this feature? Maybe we can be a betta user if you already have smth?

Sorry, I misread your original message. We're not planning on allowing creation of Relayers via API, only Autotasks, Sentinels and Notifications. But please share with us your use case (privately is fine if you prefer) and we'll analyze what is possible.

@MartinVerzilli Hey I have the same question. My use case is for gnosis safe-- I want to create a relay for a group of users that collectively own a gnosis safe, where the relay is funded by the safe to pay for the safe's gas. We have many user groups and many safes. My service would create and maintain the relay on behalf of the group. Defender relay is perfect for my use case other than the fact that I cannot create new relay's programmatically.

Bump, I would like to hear from OpenZepplin about possible options. Thanks.
@MartinVerzilli

We discussed this internally and we'll implement it soon (can't still provide a timeline but within Q2 is a sure bet).

1 Like

I saw that that the code is added to the package for creating relayers - https://github.com/OpenZeppelin/defender-client/tree/master/packages/relay

But it's not on npm yet, also doesn't work with APIs. I'm able to get the token but keep getting "forbidden" for all calls after that. Is that right?
@MartinVerzilli

Hey @shashank @Rostyslav_Bortman @stewart-prysm! We have released support for this last Monday. More info on the relay-client README. Give it a spin and let us know how it works for you!

const requestParameters = {
  name: 'MyNewRelayer',
  network: 'rinkeby',
  minBalance: BigInt(1e17).toString(),
  policies: {
    whitelistReceivers: ['0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B'],
  },
};

const { relayerId } = await relayClient.create(requestParameters);

await relayClient.createKey(relayerId);