Provider Service¶
The Provider Service enables the creation and management of ecosystems and webhooks.
Named vs Anonymous ecosystems
There are two types of ecosystems: named and anonymous.
Named ecosystems are suitable for production, and will be prepared for you by Trinsic during onboarding.
Anonymous ecosystems have auto-generated names (such as eager-elephant-94jkn5h
), and may be created by anyone at any time.
Using an anonymous ecosystem for purposes other than prototyping and testing is considered an unauthorized use of Trinsic's platform.
Create Ecosystem¶
Creates a new ecosystem, along with a root controlling account.
If name
is left empty, an anonymous ecosystem will be created.
trinsic provider create-ecosystem --name <ECOSYSTEM_NAME> --email <OWNER_EMAIL>
let createResponse = await trinsic.provider().createEcosystem(
CreateEcosystemRequest.fromPartial({
description: "Test ecosystem from Node",
uri: "https://example.com",
})
);
var (ecosystem, authToken) = await trinsic.Provider.CreateEcosystemAsync(new() {
Description = "My ecosystem",
Uri = "https://example.com"
});
actual_create = await trinsic_service.provider.create_ecosystem(
request=CreateEcosystemRequest(
description="My ecosystem", uri="https://example.com"
)
)
actualCreate, err := trinsic.Provider().CreateEcosystem(context.Background(), &provider.CreateEcosystemRequest{
Description: "My ecosystem",
Uri: "https://example.com",
})
var response =
trinsic
.provider()
.createEcosystem(
CreateEcosystemRequest.newBuilder()
.setDescription("My ecosystem")
.setUri("https://example.com")
.build())
.get();
CreateEcosystemRequest
Update Ecosystem¶
Updates the active ecosystem's description
or uri
.
trinsic provider update-ecosystem \
--description "New description" \
--uri "https://new-example.com"
let updateResponse = await trinsic.provider().updateEcosystem(
UpdateEcosystemRequest.fromPartial({
description: "New ecosystem description",
uri: "https://new-example.com",
})
);
var updateResult = await trinsic.Provider.UpdateEcosystemAsync(new() {
Description = "New ecosystem description",
Uri = "New ecosystem URI"
});
request = UpdateEcosystemRequest(
description="My new description", uri="https://example.com"
)
response = await trinsic.provider.update_ecosystem(request=request)
updateRequest := &provider.UpdateEcosystemRequest{
Description: "My new description",
Uri: "https://new-example.com",
}
updateResponse, err := trinsic.Provider().UpdateEcosystem(context.Background(), updateRequest)
var updateResponse =
trinsic
.provider()
.updateEcosystem(
UpdateEcosystemRequest.newBuilder()
.setDescription("My updated ecosystem")
.setUri("https://new-example.com")
.build())
.get();
UpdateEcosystemRequest
Get Ecosystem Info¶
Fetches information about the active ecosystem.
trinsic provider ecosystem-info
const infoResponse = await trinsic
.provider()
.ecosystemInfo(EcosystemInfoRequest.fromPartial({}));
const ecosystem = infoResponse.ecosystem;
var infoResult = await trinsic.Provider.EcosystemInfoAsync(new());
response = await trinsic.provider.ecosystem_info(request=EcosystemInfoRequest())
ecosystem = response.ecosystem
infoResponse, err := trinsic.Provider().EcosystemInfo(context.Background(), &provider.EcosystemInfoRequest{})
var infoResponse =
trinsic.provider().ecosystemInfo(EcosystemInfoRequest.getDefaultInstance()).get();
InfoRequest
Add Webhook¶
Adds a webhook to an ecosystem.
trinsic provider add-webhook \
--url "https://example.com/webhooks/trinsic" \
--secret "my well-kept secret" \
--events "*"
let addResponse = await trinsic.provider().addWebhook(
AddWebhookRequest.fromPartial({
destinationUrl: "https://example.com/webhooks/trinsic",
secret: "my well-kept secret",
events: ["*"],
})
);
var addWebhookResponse = await trinsic.Provider.AddWebhookAsync(new() {
DestinationUrl = "https://example.com/webhooks/trinsic",
Secret = "my well-kept secret"
});
request = AddWebhookRequest(
destination_url="https://example.com/webhooks/trinsic",
secret="my well-kept secret",
)
request.events.append("*") # Enable all events
response = await trinsic.provider.add_webhook(request=request)
request := &provider.AddWebhookRequest{
DestinationUrl: "https://example.com/webhooks/trinsic",
Secret: "my well-kept secret",
Events: []string{"*"}, // All events
}
response, err := trinsic.Provider().AddWebhook(context.Background(), request)
var addWebhookResponse =
trinsic
.provider()
.addWebhook(
AddWebhookRequest.newBuilder()
.setDestinationUrl("https://example.com/webhooks/trinsic")
.setSecret("my well-kept secret")
.addEvents("*") // All events
.build())
.get();
Webhook Limits
At present, an ecosystem can have no more than 10 webhooks.
Wallet Webhook Events
In order to receive webhooks for events which occur on a wallet, an additional authorization step must be performed.
See AuthorizeWebhook for more info.
Delete Webhook¶
Deletes a webhook from an ecosystem.
trinsic provider delete-webhook --webhook-id <WEBHOOK_ID>
let deleteResponse = await trinsic.provider().deleteWebhook(
DeleteWebhookRequest.fromPartial({
webhookId: webhookId,
})
);
var deleteWebhookResponse = await trinsic.Provider.DeleteWebhookAsync(new() {
WebhookId = webhookId
});
response = await trinsic.provider.delete_webhook(
request=DeleteWebhookRequest(webhook_id)
)
request := &provider.DeleteWebhookRequest{
WebhookId: webhookId,
}
deleteResponse, err := trinsic.Provider().DeleteWebhook(context.Background(), request)
var deleteWebhookResponse =
trinsic
.provider()
.deleteWebhook(DeleteWebhookRequest.newBuilder().setWebhookId(webhookId).build())
.get();
DeleteWebhookRequest