diff --git a/.gitignore b/.gitignore index 47e66c8b8..6af6d8f14 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ yarn-debug.log* yarn-error.log* lerna-debug.log* .pnpm-debug.log* +.npmrc # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json diff --git a/apps/account-api/src/controllers/v1/ics.controller.v1.ts b/apps/account-api/src/controllers/v1/ics.controller.v1.ts index 2970150dc..7caf23a5e 100644 --- a/apps/account-api/src/controllers/v1/ics.controller.v1.ts +++ b/apps/account-api/src/controllers/v1/ics.controller.v1.ts @@ -1,8 +1,8 @@ import { EnqueueService } from '#account-lib/services/enqueue-request.service'; import { AddNewPublicKeyAgreementRequestDto, IcsPublishAllRequestDto, UpsertPagePayloadDto } from '#types/dtos/account'; import { AccountIdDto } from '#types/dtos/common'; -import { Body, Controller, HttpCode, HttpException, HttpStatus, Param, Post } from '@nestjs/common'; -import { ApiTags } from '@nestjs/swagger'; +import { Body, Controller, Get, HttpCode, HttpException, HttpStatus, Param, Post } from '@nestjs/common'; +import { ApiOkResponse, ApiOperation, ApiTags } from '@nestjs/swagger'; import { ApiPromise } from '@polkadot/api'; import { SubmittableExtrinsic } from '@polkadot/api/types'; import { ISubmittableResult } from '@polkadot/types/types'; @@ -41,7 +41,7 @@ export class IcsControllerV1 { payload: AddNewPublicKeyAgreementRequestDto, api: ApiPromise, ): SubmittableExtrinsic<'promise', ISubmittableResult> { - const encodedPayload = this.blockchainService.createItemizedSignaturePayloadV2Type(payload.payload); + const encodedPayload = this.blockchainService.createItemizedSignaturePayloadV2Type(payload.payload).toU8a(); return api.tx.statefulStorage.applyItemActionsWithSignatureV2( accountId, chainSignature({ algo: 'Sr25519', encodedValue: payload.proof }), // TODO: determine signature algo diff --git a/apps/account-api/src/controllers/v1/keys-v1.controller.spec.ts b/apps/account-api/src/controllers/v1/keys-v1.controller.spec.ts new file mode 100644 index 000000000..3569af8da --- /dev/null +++ b/apps/account-api/src/controllers/v1/keys-v1.controller.spec.ts @@ -0,0 +1,8 @@ +describe('KeysV1Controller', () => { + + beforeEach(async () => { + }); + + afterAll(() => jest.restoreAllMocks()); + +}); diff --git a/apps/account-api/src/controllers/v1/keys-v1.controller.ts b/apps/account-api/src/controllers/v1/keys-v1.controller.ts index 6835ac95b..b75e8d97c 100644 --- a/apps/account-api/src/controllers/v1/keys-v1.controller.ts +++ b/apps/account-api/src/controllers/v1/keys-v1.controller.ts @@ -20,12 +20,14 @@ import { ReadOnlyGuard } from '#account-api/guards/read-only.guard'; import { AddNewPublicKeyAgreementPayloadRequest, AddNewPublicKeyAgreementRequestDto, + IcsProviderKeyPayload, PublicKeyAgreementRequestDto, PublicKeyAgreementsKeyPayload, } from '#types/dtos/account/graphs.request.dto'; import { TransactionType } from '#types/account-webhook'; import { MsaIdDto } from '#types/dtos/common'; import { InjectPinoLogger, PinoLogger } from 'nestjs-pino'; +import { HexString } from '@polkadot/util/types'; @Controller({ version: '1', path: 'keys' }) @ApiTags('v1/keys') @@ -83,8 +85,8 @@ export class KeysControllerV1 { /** * Using the provided query parameters, creates a new payload that can be signed to add new graph keys. * @param queryParams - The query parameters for adding a new key - * @returns Payload is included for convenience. Encoded payload to be used when signing the transaction. - * @throws An error if the key already exists or the payload creation fails. + * @returns Payload is included for convenience. Encoded payload is signed to generate the proof for adding the key. + * @throws An error if the key already exists or the payload creation fails, or signature verification fails. */ async getPublicKeyAgreementsKeyPayload( @Query() { msaId, newKey }: PublicKeyAgreementsKeyPayload, @@ -113,4 +115,23 @@ export class KeysControllerV1 { this.logger.info(`Add graph key in progress. referenceId: ${response.referenceId}`); return response; } + + @Get('publicKeyAgreements/getAddIcsKeyPayload') + @HttpCode(HttpStatus.OK) + @ApiOperation({ summary: 'Get a properly encoded StatefulStorageItemizedSignaturePayloadV2 that can be signed.' }) + @ApiOkResponse({ + description: 'Returned an encoded StatefulStorageItemizedSignaturePayloadV2 for signing', + type: AddNewPublicKeyAgreementPayloadRequest, + }) + /** + * Using the provided query parameters, creates a new payload that can be signed to add a new ICS key. + * @param queryParams - The query parameters for adding a new ICS key + * @returns Payload is included for convenience. Encoded payload is signed to generate the proof for adding the key. + * @throws An error if the key already exists, if the msaId does not exist, or if the newKey is not a valid ed25519 public key. + */ + async getAddIcsKeyPayload( + @Query() { msaId, newKey, keyType }: IcsProviderKeyPayload, + ): Promise { + return this.keysService.getAddIcsPublicKeyAgreementPayload(msaId, newKey); + } } diff --git a/apps/account-api/src/services/keys.service.spec.ts b/apps/account-api/src/services/keys.service.spec.ts index 2471b737d..d5b709cb4 100644 --- a/apps/account-api/src/services/keys.service.spec.ts +++ b/apps/account-api/src/services/keys.service.spec.ts @@ -8,13 +8,14 @@ import { } from '#types/dtos/account'; import { createAddKeyData, + createItemizedAddAction, + createItemizedDeleteAction, createItemizedSignaturePayloadV2, getUnifiedPublicKey, sign as signEthereum, - createItemizedAddAction, - createItemizedDeleteAction, } from '@frequency-chain/ethereum-utils'; import { u8aToHex } from '@polkadot/util'; + import { KeysService } from '#account-api/services/keys.service'; import { Test } from '@nestjs/testing'; import { BlockchainRpcQueryService } from '#blockchain/blockchain-rpc-query.service'; @@ -28,6 +29,11 @@ import { getPinoHttpOptions } from '#logger-lib'; import { mockRedisProvider } from '#testlib'; import { EventEmitterModule } from '@nestjs/event-emitter'; import { useContainer } from 'class-validator'; +import Keyring from '@polkadot/keyring'; +import { ItemizedStoragePageResponse } from '@frequency-chain/api-augment/interfaces'; +import { Vec } from '@polkadot/types'; +import IcsApi from '@projectlibertylabs-ics/ics-sdk'; +const icsSdk: IcsApi = new IcsApi(); jest.mock('#blockchain/blockchain-rpc-query.service'); jest.mock( @@ -36,6 +42,7 @@ jest.mock( describe('KeysService', () => { let keysService: KeysService; + let blockchainRpcQueryService: BlockchainRpcQueryService; beforeAll(async () => { await cryptoWaitReady(); @@ -75,6 +82,7 @@ describe('KeysService', () => { useContainer(moduleRef, { fallbackOnErrors: true }); keysService = moduleRef.get(KeysService); + blockchainRpcQueryService = moduleRef.get(BlockchainRpcQueryService); }); describe('Dtos', () => { @@ -150,4 +158,70 @@ describe('KeysService', () => { expect(keysService.verifyPublicKeyAgreementSignature(payload)).toBeTruthy(); }); }); + describe('getAddIcsPublicKeyAgreementPayload', () => { + let keyring = new Keyring({ type: 'ed25519' }); + + let createItemizedSignaturePayloadSpy; + const msaId = '1234'; + const seed = new Uint8Array(32).fill(1); + const newKeypair = keyring.addFromSeed(seed); + + const mockItemizedStorageResponse = (returnItems: Array): ItemizedStoragePageResponse => { + return { + items: { toArray: () => returnItems as any as Vec }, + content_hash: { toNumber: () => 5 }, + } as unknown as ItemizedStoragePageResponse; + }; + + beforeEach(async () => { + jest.spyOn(blockchainRpcQueryService, 'getLatestSchemaIdForIntent').mockResolvedValueOnce(16299); + jest.spyOn(blockchainRpcQueryService, 'getLatestBlockNumber').mockResolvedValueOnce(300_000); + createItemizedSignaturePayloadSpy = jest + .spyOn(blockchainRpcQueryService, 'createItemizedSignaturePayloadV2Type') + .mockReturnValueOnce({ + toU8a: () => Uint8Array.from([1, 2, 3]), + }); + }); + afterEach(() => jest.restoreAllMocks()); + + it('throws when the key is malformed', async () => { + jest.spyOn(blockchainRpcQueryService, 'isValidMsaId').mockResolvedValueOnce(true); + const badKey = '0xdeadabeef' as HexString; + await expect(() => keysService.getAddIcsPublicKeyAgreementPayload(msaId, badKey)).rejects.toThrow( + 'ed25519 public key should be 32 bytes', + ); + }); + + it('throws when the msaId does not exist', async () => { + jest.spyOn(blockchainRpcQueryService, 'isValidMsaId').mockResolvedValueOnce(false); + await expect(() => + keysService.getAddIcsPublicKeyAgreementPayload(msaId, `0x${newKeypair.address}`) + ).rejects.toThrow('MSA ID 1234 not found'); + }); + + it('throws when the ICS key is already registered', async () => { + const newKey = newKeypair.publicKey; + const icsSerializedKey = icsSdk.serializePublicKey(newKey); + const mockPayload = [{ payload: icsSerializedKey }]; + const mockResponse = mockItemizedStorageResponse(mockPayload); + + jest.spyOn(blockchainRpcQueryService, 'getItemizedStorage').mockResolvedValueOnce(mockResponse); + jest.spyOn(blockchainRpcQueryService, 'isValidMsaId').mockResolvedValueOnce(true); + + await expect(() => + keysService.getAddIcsPublicKeyAgreementPayload(msaId, u8aToHex(newKeypair.publicKey)), + ).rejects.toThrow('Requested key already exists!'); + }); + + it('returns a payload when provided valid parameters', async () => { + const mockResponse = mockItemizedStorageResponse([]); + jest.spyOn(blockchainRpcQueryService, 'getItemizedStorage').mockResolvedValueOnce(mockResponse); + jest.spyOn(blockchainRpcQueryService, 'isValidMsaId').mockResolvedValueOnce(true); + + const result = await keysService.getAddIcsPublicKeyAgreementPayload(msaId, u8aToHex(newKeypair.publicKey)); + expect(result.encodedPayload).toEqual('0x010203'); + expect(result.payload).toBeDefined(); + expect(createItemizedSignaturePayloadSpy).toHaveBeenCalled(); + }); + }); }); diff --git a/apps/account-api/src/services/keys.service.ts b/apps/account-api/src/services/keys.service.ts index b7d03eac6..dba4b5d33 100644 --- a/apps/account-api/src/services/keys.service.ts +++ b/apps/account-api/src/services/keys.service.ts @@ -1,6 +1,7 @@ import { KeysResponse } from '#types/dtos/account/keys.response.dto'; import { ConflictException, Inject, Injectable, NotFoundException, OnApplicationBootstrap } from '@nestjs/common'; import { HexString } from '@polkadot/util/types'; +import { hexToU8a } from '@polkadot/util'; import { AddNewPublicKeyAgreementPayloadRequest, AddNewPublicKeyAgreementRequestDto, @@ -31,13 +32,18 @@ import { EventEmitter2 } from '@nestjs/event-emitter'; import { InjectRedis } from '@songkeys/nestjs-redis'; import Redis from 'ioredis'; import { HOUR, MILLISECONDS_PER_SECOND } from 'time-constants'; +import IcsApi from '@projectlibertylabs-ics/ics-sdk'; +const icsSdk: IcsApi = new IcsApi(); + const SCHEMA_ID_TTL = HOUR / MILLISECONDS_PER_SECOND; // 1 hour in seconds const GRAPH_KEY_SCHEMA_ID_CACHE_KEY = 'graphKeySchemaId'; +const ICS_KEY_SCHEMA_ID_CACHE_KEY = 'icsKeySchemaId'; @Injectable() export class KeysService implements OnApplicationBootstrap { private graphKeyIntentId: number; + private icsKeyIntentId: number; async onApplicationBootstrap() { try { @@ -46,10 +52,17 @@ export class KeysService implements OnApplicationBootstrap { 'public-key-key-agreement', ); this.graphKeyIntentId = intentId; + + const { intentId: icsIntentId, schemaId: icsSchemaId } = await this.blockchainService.getIntentAndLatestSchemaIdsByName( + 'ics', + 'public-key-key-agreement', + ) + this.icsKeyIntentId = icsIntentId; // Set 1-hour TTL on this so that we don't need to restart if a new schema is published await this.cache.setex(GRAPH_KEY_SCHEMA_ID_CACHE_KEY, SCHEMA_ID_TTL, schemaId); + await this.cache.setex(ICS_KEY_SCHEMA_ID_CACHE_KEY, SCHEMA_ID_TTL, icsSchemaId); } catch (e: any) { - this.logger.fatal({ error: e }, 'Unable to resolve intent ID for "dsnp.public-key-key-agreement"'); + this.logger.fatal({ error: e }, 'Unable to resolve intent ID for one of the key agreements'); this.emitter.emit('shutdown'); } } @@ -122,6 +135,42 @@ export class KeysService implements OnApplicationBootstrap { }; } + async getAddIcsPublicKeyAgreementPayload( + msaId: string, + newKeyHex: HexString, + ): Promise { + const isMsaId = await this.blockchainService.isValidMsaId(msaId); + if (!isMsaId) { + throw new NotFoundException(`MSA ID ${msaId} not found`); + } + const expiration = await this.getExpiration(); + const schemaId = await this.blockchainService.getLatestSchemaIdForIntent(this.icsKeyIntentId); + + const newKeyU8a = hexToU8a(newKeyHex); + const itemizedStorage = await this.blockchainService.getItemizedStorage(msaId, this.icsKeyIntentId); + + const icsSerializedKeyForStorage = icsSdk.serializePublicKey(newKeyU8a); + const encodedSerializedKey: HexString = u8aToHex(icsSerializedKeyForStorage); + + const foundKey = itemizedStorage.items.toArray().find((i) => i.payload.length > 0 + && u8aToHex(i.payload).toLowerCase() === encodedSerializedKey.toLowerCase() + ) + + if (foundKey) { + throw new ConflictException('Requested key already exists!'); + } + const payload: ItemizedSignaturePayloadDto = { + expiration, schemaId, targetHash: itemizedStorage.content_hash.toNumber(), + actions: [{ type: ItemActionType.ADD_ITEM, encodedPayload: encodedSerializedKey }] + } + + const encodedPayload = u8aToHex(this.blockchainService.createItemizedSignaturePayloadV2Type(payload).toU8a()); + return { + payload, + encodedPayload, + }; + } + private async getExpiration(): Promise { const lastFinalizedBlockNumber = await this.blockchainService.getLatestBlockNumber(); // standard expiration in SIWF is 10 minutes diff --git a/docs/account-worker/index.html b/docs/account-worker/index.html index de33556ad..cded9e694 100644 --- a/docs/account-worker/index.html +++ b/docs/account-worker/index.html @@ -12,245 +12,245 @@ margin: 0; } - -

Account Worker Service (2.0)

Download OpenAPI specification:

Account Worker Service API

-

health

Check the health status of the service

Responses

Check the live status of the service

Responses

Check the ready status of the service

Responses

+ " fill="currentColor">

Account Worker Service (2.0)

Download OpenAPI specification:

Account Worker Service API

+

health

Check the health status of the service

Responses

Check the live status of the service

Responses

Check the ready status of the service

Responses

-

Account Service (2.0)

Download OpenAPI specification:

Account Service API

-

v1/accounts

Fetch an account given an MSA Id

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

-

Responses

Response samples

Content type
application/json
{
  • "msaId": "string",
  • "handle": {
    }
}

Fetch an account given an Account Id

path Parameters
accountId
required
string
Example: 1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N

AccountId in hex or SS58 format

-

Responses

Response samples

Content type
application/json
{
  • "msaId": "string",
  • "handle": {
    }
}

Get a retireMsa unsigned, encoded extrinsic payload.

path Parameters
accountId
required
string
Example: 1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N

AccountId in hex or SS58 format

-

Responses

Response samples

Content type
application/json
{
  • "encodedExtrinsic": "0x1234",
  • "payloadToSign": "0x1234",
  • "accountId": "1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N"
}

Request to retire an MSA ID.

Request Body schema: application/json
required
encodedExtrinsic
required
string

Hex-encoded representation of the "RetireMsa" extrinsic

-
payloadToSign
required
string

payload to be signed

-
accountId
required
string

AccountId in hex or SS58 format

-
signature
required
string

signature of the owner

-

Responses

Request samples

Content type
application/json
{
  • "encodedExtrinsic": "0x1234",
  • "payloadToSign": "0x1234",
  • "accountId": "1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N",
  • "signature": "0x01065d733ca151c9e65b78f2ba77348224d31647e6913c44ad2765c6e8ba06f834dc21d8182447d01c30f84a41d90a8f2e58001d825c6f0d61b0afe89f984eec85"
}

Response samples

Content type
application/json
{
  • "state": "waiting",
  • "referenceId": "string"
}

v2/accounts

Get the Sign In With Frequency Redirect URL

query Parameters
credentials
Array of strings
Example: credentials=VerifiedGraphKeyCredential&credentials=VerifiedEmailAddressCredential&credentials=VerifiedPhoneNumberCredential

List of credentials using the types: "VerifiedGraphKeyCredential", "VerifiedEmailAddressCredential", and "VerifiedPhoneNumberCredential". Note that Contact related verifiable credentials will be nested into an anyOf request form.

-
permissions
Array of strings
Example: permissions=dsnp.broadcast@v2&permissions=dsnp.private-follows@v1&permissions=dsnp.reply@v2&permissions=dsnp.reaction@v1&permissions=dsnp.tombstone@v2&permissions=dsnp.update@v2&permissions=frequency.default-token-address@v1

The list of permissions using the Frequency Schema names and versions. Pattern: <namespace>.<name>@v<version integer> e.g. dsnp.broadcast@v2

-
callbackUrl
required
string
Example: callbackUrl=http://localhost:3000/login/callback

The URL that will be called when the authentication process is completed

-

Responses

Response samples

Content type
application/json
{}

Process the result of a Sign In With Frequency v2 callback

Request Body schema: application/json
required
authorizationCode
string

The code returned from the SIWF v2 Authentication service that can be exchanged for the payload. Required unless an authorizationPayload is provided.

-
authorizationPayload
string

The SIWF v2 Authentication payload as a JSON stringified and base64url encoded value. Required unless an authorizationCode is provided.

-

Responses

Request samples

Content type
application/json
{
  • "authorizationCode": "680a0a68-6d3b-4d6d-89b7-0b01a6f7e86f",
  • "authorizationPayload": "ew0KICAidXNlclB1YmxpY0tleSI6IHsNCiAgICAiZW5jb2RlZFZhbHVlIjogIjVIWUha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gICAgImV4dHJpbnNpYyI6ICJjcmVhdGVTcG9uc29yZWRBY2NvdW50V2l0aERlbGVnYXRpb24iDQogICAgICB9LA0KICAgICAgInR5cGUiOiAiYWRkUHJvdmlkZXIiLA0KICAgICAgInBheWxvYWQiOiB7DQogICAgICAgICJhdXRob3JpemVkTXNhSWQiOiA3MjksDQogICAgICAgICJzY2hlbWFJZHMiOiBbDQogICAgICAgICAgNiwNCiAgICAgICAgICA3LA0KICAgICAgICAgIDgsDQogICAgICAgICAgOSwNCiAgICAgICAgICAxMA0KICAgICAgICBdLA0KICAgICAgICAiZXhwaXJhdGlvbiI6IDE2MDc1MzgNCiAgICAgIH0NCiAgICB9LA0KICAgIHsNCiAgICAgICJzaWduYXR1cmUiOiB7DQogICAgICAgICJhbGdvIjogIlNSMjU1MTkiLA0KICAgICAgICAiZW5jb2RpbmciOiAiYmFzZTE2IiwNCiAgICAgICAgImVuY29kZWRWYWx1ZSI6ICIweDFhMGI1ZDdkNWNhNzg4Y2VmZDE4NDk3ZDc5NzJkYTk5YzQ3NmI3NTA0YzY5MzNiYzUyYTZkZTA2NWI5NGE3NTFmMzI5Mjg5N2QzMjEzODllOTAwZmQ1MmJmMzEyYzJiZGM3ODAwZWMwMzM2YmJmMTcyY2I3ZTE5ZjU1MjJlODg0Ig0KICAgICAgfSwNCiAgICAgICJlbmRwb2ludCI6IHsNCiAgICAgICAgInBhbGxldCI6ICJoYW5kbGVzIiwNCiAgICAgICAgImV4dHJpbnNpYyI6ICJjbGFpbUhhbmRsZSINCiAgICAgIH0sDQogICAgICAidHlwZSI6ICJjbGFpbUhhbmRsZSIsDQogICAgICAicGF5bG9hZCI6IHsNCiAgICAgICAgImJhc2VIYW5kbGUiOiAid2lsd2FkZSIsDQogICAgICAgICJleHBpcmF0aW9uIjogMTYwNzUzOA0KICAgICAgfQ0KICAgIH0sDQogICAgew0KICAgICAgInNpZ25hdHVyZSI6IHsNCiAgICAgICAgImFsZ28iOiAiU1IyNTUxOSIsDQogICA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QogICAgfQ0KICBdDQp9"
}

Response samples

Content type
application/json
{
  • "controlKey": "f6cL4wq1HUNx11TcvdABNf9UNXXoyH47mVUwT59tzSFRW8yDH",
  • "signUpReferenceId": "MjY3MjI3NWZlMGM0NTZmYjY3MWU0ZjQxN2ZiMmY5ODkyYzc1NzNiYQo",
  • "signUpStatus": "waiting",
  • "msaId": "314159265358979323846264338",
  • "email": "user@example.com",
  • "phoneNumber": "555-867-5309",
  • "graphKey": "f6Y86vfvou3d4RGjYJM2k5L7g1HMjVTDMAtVMDh8g67i3VLZi",
  • "recoverySecret": "69EC-2382-E1E6-76F3-341F-3414-9DD5-CFA5-6932-E418-9385-0358-31DF-AFEA-9828-D3B7",
  • "rawCredentials": []
}

v1/delegation

Get the delegation information associated with an MSA Id

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

-

Responses

Response samples

Content type
application/json
{
  • "providerId": "string",
  • "schemaPermissions": { },
  • "revokedAt": { }
}

Get a properly encoded RevokeDelegationPayload that can be signed

path Parameters
accountId
required
string
Example: 1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N

AccountId in hex or SS58 format

-
providerId
required
string
Example: 1

Msa Id of provider

-

Responses

Response samples

Content type
application/json
{
  • "accountId": "1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N",
  • "providerId": "3",
  • "encodedExtrinsic": "0x1234",
  • "payloadToSign": "0x1234"
}

Request to revoke a delegation

Request Body schema: application/json
required
accountId
required
string

AccountId in hex or SS58 format

-
providerId
required
string

MSA Id of the provider to whom the requesting user wishes to delegate

-
encodedExtrinsic
required
string

Hex-encoded representation of the "revokeDelegation" extrinsic

-
payloadToSign
required
string

payload to be signed

-
signature
required
string

signature of the owner

-

Responses

Request samples

Content type
application/json
{
  • "accountId": "1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N",
  • "providerId": "3",
  • "encodedExtrinsic": "0x1234",
  • "payloadToSign": "0x1234",
  • "signature": "0x01065d733ca151c9e65b78f2ba77348224d31647e6913c44ad2765c6e8ba06f834dc21d8182447d01c30f84a41d90a8f2e58001d825c6f0d61b0afe89f984eec85"
}

Response samples

Content type
application/json
{
  • "state": "waiting",
  • "referenceId": "string"
}

v2/delegations

Get all delegation information associated with an MSA Id

path Parameters
msaId
required
string
Example: 3

MSA Id of the user requesting the delegation

-

Responses

Response samples

Content type
application/json
{
  • "msaId": "string",
  • "delegations": [
    ]
}

Get an MSA's delegation information for a specific provider

path Parameters
msaId
required
string
Example: 3

MSA Id of the user requesting the delegation

-
providerId
string
Example: 1

MSA Id of the provider to whom the requesting user wishes to delegate

-

Responses

Response samples

Content type
application/json
{
  • "msaId": "string",
  • "delegations": [
    ]
}

v1/handles

Request to create a new handle for an account

Request Body schema: application/json
required
accountId
required
string

AccountId in hex or SS58 format

-
required
object (HandlePayloadDto)
proof
required
string

proof is the signature for the payload

-

Responses

Request samples

Content type
application/json
{
  • "accountId": "1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N",
  • "payload": {
    },
  • "proof": "0x065d733ca151c9e65b78f2ba77348224d31647e6913c44ad2765c6e8ba06f834dc21d8182447d01c30f84a41d90a8f2e58001d825c6f0d61b0afe89f984eec85"
}

Response samples

Content type
application/json
{
  • "state": "waiting",
  • "referenceId": "string"
}

Request to change a handle

Request Body schema: application/json
required
accountId
required
string

AccountId in hex or SS58 format

-
required
object (HandlePayloadDto)
proof
required
string

proof is the signature for the payload

-

Responses

Request samples

Content type
application/json
{
  • "accountId": "1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N",
  • "payload": {
    },
  • "proof": "0x065d733ca151c9e65b78f2ba77348224d31647e6913c44ad2765c6e8ba06f834dc21d8182447d01c30f84a41d90a8f2e58001d825c6f0d61b0afe89f984eec85"
}

Response samples

Content type
application/json
{
  • "state": "waiting",
  • "referenceId": "string"
}

Get a properly encoded ClaimHandlePayload that can be signed.

path Parameters
newHandle
required
string >= 3 characters
Example: handle

newHandle in the request

-

Responses

Response samples

Content type
application/json
{
  • "payload": {
    },
  • "encodedPayload": "0x012345"
}

Fetch a handle given an MSA Id

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

-

Responses

Response samples

Content type
application/json
{
  • "base_handle": "string",
  • "canonical_base": "string",
  • "suffix": 0
}

v1/ics

IcsControllerV1_publishAll_v1

path Parameters
accountId
required
string
Example: 1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N

AccountId in hex or SS58 format

-
Request Body schema: application/json
required
required
object (AddNewPublicKeyAgreementRequestDto)
required
object (AddNewPublicKeyAgreementRequestDto)
required
object (UpsertPagePayloadDto)

Responses

Request samples

Content type
application/json
{
  • "addIcsPublicKeyPayload": {
    },
  • "addContextGroupPRIDEntryPayload": {
    },
  • "addContentGroupMetadataPayload": {
    }
}

health

Check the health status of the service

Responses

Check the live status of the service

Responses

Check the ready status of the service

Responses

v1/keys

Add new control keys for an MSA Id

Request Body schema: application/json
required
msaOwnerAddress
required
string

msaOwnerAddress representing the target of this request

-
msaOwnerSignature
required
string

msaOwnerSignature is the signature by msa owner

-
newKeyOwnerSignature
required
string

newKeyOwnerSignature is the signature with new key

-
required
object (KeysRequestPayloadDto)

Responses

Request samples

Content type
application/json
{
  • "msaOwnerAddress": "1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N",
  • "msaOwnerSignature": "0x065d733ca151c9e65b78f2ba77348224d31647e6913c44ad2765c6e8ba06f834dc21d8182447d01c30f84a41d90a8f2e58001d825c6f0d61b0afe89f984eec85",
  • "newKeyOwnerSignature": "0x065d733ca151c9e65b78f2ba77348224d31647e6913c44ad2765c6e8ba06f834dc21d8182447d01c30f84a41d90a8f2e58001d825c6f0d61b0afe89f984eec85",
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "state": "waiting",
  • "referenceId": "string"
}

Fetch public keys given an MSA Id

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

-

Responses

Response samples

Content type
application/json
{
  • "msaKeys": { }
}

Get a properly encoded StatefulStorageItemizedSignaturePayloadV2 that can be signed.

query Parameters
msaId
required
string
Example: msaId=3

MSA Id representing the target of this request

-
newKey
required
string
Example: newKey=0x0ed2f8c714efcac51ca2325cfe95637e5e0b898ae397aa365978b7348a717d0b

New public key to be added to the account (32-byte value in hex format)

-

Responses

Response samples

Content type
application/json
{
  • "payload": {
    },
  • "encodedPayload": "0x1234"
}

Request to add a new public Key

Request Body schema: application/json
required
accountId
required
string

AccountId in hex or SS58 format

-
required
object (ItemizedSignaturePayloadDto)
proof
required
string

proof is the signature for the payload

-

Responses

Request samples

Content type
application/json
{
  • "accountId": "1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N",
  • "payload": {
    },
  • "proof": "0x065d733ca151c9e65b78f2ba77348224d31647e6913c44ad2765c6e8ba06f834dc21d8182447d01c30f84a41d90a8f2e58001d825c6f0d61b0afe89f984eec85"
}

Response samples

Content type
application/json
{
  • "state": "waiting",
  • "referenceId": "string"
}
+ " fill="currentColor">

Account Service (2.0)

Download OpenAPI specification:

Account Service API

+

v1/accounts

Fetch an account given an MSA Id

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

+

Responses

Response samples

Content type
application/json
{
  • "msaId": "string",
  • "handle": {
    }
}

Fetch an account given an Account Id

path Parameters
accountId
required
string
Example: 1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N

AccountId in hex or SS58 format

+

Responses

Response samples

Content type
application/json
{
  • "msaId": "string",
  • "handle": {
    }
}

Get a retireMsa unsigned, encoded extrinsic payload.

path Parameters
accountId
required
string
Example: 1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N

AccountId in hex or SS58 format

+

Responses

Response samples

Content type
application/json
{
  • "encodedExtrinsic": "0x1234",
  • "payloadToSign": "0x1234",
  • "accountId": "1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N"
}

Request to retire an MSA ID.

Request Body schema: application/json
required
encodedExtrinsic
required
string

Hex-encoded representation of the "RetireMsa" extrinsic

+
payloadToSign
required
string

payload to be signed

+
accountId
required
string

AccountId in hex or SS58 format

+
signature
required
string

signature of the owner

+

Responses

Request samples

Content type
application/json
{
  • "encodedExtrinsic": "0x1234",
  • "payloadToSign": "0x1234",
  • "accountId": "1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N",
  • "signature": "0x01065d733ca151c9e65b78f2ba77348224d31647e6913c44ad2765c6e8ba06f834dc21d8182447d01c30f84a41d90a8f2e58001d825c6f0d61b0afe89f984eec85"
}

Response samples

Content type
application/json
{
  • "state": "waiting",
  • "referenceId": "string"
}

v2/accounts

Get the Sign In With Frequency Redirect URL

query Parameters
credentials
Array of strings
Example: credentials=VerifiedGraphKeyCredential&credentials=VerifiedEmailAddressCredential&credentials=VerifiedPhoneNumberCredential

List of credentials using the types: "VerifiedGraphKeyCredential", "VerifiedEmailAddressCredential", and "VerifiedPhoneNumberCredential". Note that Contact related verifiable credentials will be nested into an anyOf request form.

+
permissions
Array of strings
Example: permissions=dsnp.broadcast@v2&permissions=dsnp.private-follows@v1&permissions=dsnp.reply@v2&permissions=dsnp.reaction@v1&permissions=dsnp.tombstone@v2&permissions=dsnp.update@v2&permissions=frequency.default-token-address@v1

The list of permissions using the Frequency Schema names and versions. Pattern: <namespace>.<name>@v<version integer> e.g. dsnp.broadcast@v2

+
callbackUrl
required
string
Example: callbackUrl=http://localhost:3000/login/callback

The URL that will be called when the authentication process is completed

+

Responses

Response samples

Content type
application/json
{}

Process the result of a Sign In With Frequency v2 callback

Request Body schema: application/json
required
authorizationCode
string

The code returned from the SIWF v2 Authentication service that can be exchanged for the payload. Required unless an authorizationPayload is provided.

+
authorizationPayload
string

The SIWF v2 Authentication payload as a JSON stringified and base64url encoded value. Required unless an authorizationCode is provided.

+

Responses

Request samples

Content type
application/json
{
  • "authorizationCode": "680a0a68-6d3b-4d6d-89b7-0b01a6f7e86f",
  • "authorizationPayload": "ew0KICAidXNlclB1YmxpY0tleSI6IHsNCiAgICAiZW5jb2RlZFZhbHVlIjogIjVIWUhaOGU4a3lMRUJ1RWJzRmEyYndLWWJWU01nYVVoeW1mUlZnSDdDdU00VkNIdiIsDQogICAgImVuY29kaW5nIjogImJhc2U1OCIsDQogICAgImZvcm1hdCI6ICJzczU4IiwNCiAgICAidHlwZSI6ICJTcjI1NTE5Ig0KICB9LA0KICAidXNlcktleXMiOiBbDQogICAgew0KICAgICAgImVuY29kZWRQdWJsaWNLZXlWYWx1ZSI6ICIweGJkODk2ZmQ1NTAxZWVhMjU5ZjQ3OTg0MTVjOWZhNDQ3ZDU4ODIwZDk5YjkyNDA2NzFhNmYzNGYwYmMwM2IwMzAiLA0KICAgICAgImVuY29kZWRQcml2YXRlS2V5VmFsdWUiOiAiMHhmODExNWQzZTUwYzg2MTYzODZmMDY2ZjY1OTdlZmYwYzU3MGQ2N2M3ZTVjZDkzNjU1Njg4NGJjYzk5NDNmNDY0IiwNCiAgICAgICJlbmNvZGluZyI6ICJiYXNlMTYiLA0KICAgICAgImZvcm1hdCI6ICJiYXJlIiwNCiAgICAgICJ0eXBlIjogIlgyNTUxOSIsDQogICAgICAia2V5VHlwZSI6ICJkc25wLnB1YmxpYy1rZXkta2V5LWFncmVlbWVudCINCiAgICB9DQogIF0sDQogICJwYXlsb2FkcyI6IFsNCiAgICB7DQogICAgICAic2lnbmF0dXJlIjogew0KICAgICAgICAiYWxnbyI6ICJTUjI1NTE5IiwNCiAgICAgICAgImVuY29kaW5nIjogImJhc2UxNiIsDQogICAgICAgICJlbmNvZGVkVmFsdWUiOiAiMHgzMmFlYWViZWZmNWU4ZTEzODM3ZTg3YzQ5MWI0Mzc4MTE1MjYxZWU3NTFjYmYzYTc1ZTY5MmJiNzFhMWNmYzU3ZGRk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wNCiAgICAgICAgInByb29mVmFsdWUiOiAiejI5YWRmdG5lSG5LeHdSOWI3Z3RSanlrTFJlR0VwdU1pWTljS0hWQ0JTejZtWThjd0ZaaUZpQVdaSGV4R3R2Qjh0YmRwZmoyRzQzeFF6dFJ6dFdhd21IRjIiDQogICAgICB9DQogICAgfQ0KICBdDQp9"
}

Response samples

Content type
application/json
{
  • "controlKey": "f6cL4wq1HUNx11TcvdABNf9UNXXoyH47mVUwT59tzSFRW8yDH",
  • "signUpReferenceId": "MjY3MjI3NWZlMGM0NTZmYjY3MWU0ZjQxN2ZiMmY5ODkyYzc1NzNiYQo",
  • "signUpStatus": "waiting",
  • "msaId": "314159265358979323846264338",
  • "email": "user@example.com",
  • "phoneNumber": "555-867-5309",
  • "graphKey": "f6Y86vfvou3d4RGjYJM2k5L7g1HMjVTDMAtVMDh8g67i3VLZi",
  • "recoverySecret": "69EC-2382-E1E6-76F3-341F-3414-9DD5-CFA5-6932-E418-9385-0358-31DF-AFEA-9828-D3B7",
  • "rawCredentials": []
}

v3/delegations

Get all delegation information associated with an MSA Id

path Parameters
msaId
required
string
Example: 3

MSA Id of the user requesting the delegation

+

Responses

Response samples

Content type
application/json
{
  • "msaId": "string",
  • "delegations": [
    ]
}

Get an MSA's delegation information for a specific provider

path Parameters
msaId
required
string
Example: 3

MSA Id of the user requesting the delegation

+
providerId
string
Example: 1

MSA Id of the provider to whom the requesting user wishes to delegate

+

Responses

Response samples

Content type
application/json
{
  • "msaId": "string",
  • "delegations": [
    ]
}

Get a properly encoded RevokeDelegationPayload that can be signed

path Parameters
accountId
required
string
Example: 1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N

AccountId in hex or SS58 format

+
providerId
required
string
Example: 1

Msa Id of provider

+

Responses

Response samples

Content type
application/json
{
  • "accountId": "1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N",
  • "providerId": "3",
  • "encodedExtrinsic": "0x1234",
  • "payloadToSign": "0x1234"
}

Request to revoke a delegation

Request Body schema: application/json
required
accountId
required
string

AccountId in hex or SS58 format

+
providerId
required
string

MSA Id of the provider to whom the requesting user wishes to delegate

+
encodedExtrinsic
required
string

Hex-encoded representation of the "revokeDelegation" extrinsic

+
payloadToSign
required
string

payload to be signed

+
signature
required
string

signature of the owner

+

Responses

Request samples

Content type
application/json
{
  • "accountId": "1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N",
  • "providerId": "3",
  • "encodedExtrinsic": "0x1234",
  • "payloadToSign": "0x1234",
  • "signature": "0x01065d733ca151c9e65b78f2ba77348224d31647e6913c44ad2765c6e8ba06f834dc21d8182447d01c30f84a41d90a8f2e58001d825c6f0d61b0afe89f984eec85"
}

Response samples

Content type
application/json
{
  • "state": "waiting",
  • "referenceId": "string"
}

v1/handles

Request to create a new handle for an account

Request Body schema: application/json
required
accountId
required
string

AccountId in hex or SS58 format

+
required
object (HandlePayloadDto)
proof
required
string

proof is the signature for the payload

+

Responses

Request samples

Content type
application/json
{
  • "accountId": "1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N",
  • "payload": {
    },
  • "proof": "0x065d733ca151c9e65b78f2ba77348224d31647e6913c44ad2765c6e8ba06f834dc21d8182447d01c30f84a41d90a8f2e58001d825c6f0d61b0afe89f984eec85"
}

Response samples

Content type
application/json
{
  • "state": "waiting",
  • "referenceId": "string"
}

Request to change a handle

Request Body schema: application/json
required
accountId
required
string

AccountId in hex or SS58 format

+
required
object (HandlePayloadDto)
proof
required
string

proof is the signature for the payload

+

Responses

Request samples

Content type
application/json
{
  • "accountId": "1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N",
  • "payload": {
    },
  • "proof": "0x065d733ca151c9e65b78f2ba77348224d31647e6913c44ad2765c6e8ba06f834dc21d8182447d01c30f84a41d90a8f2e58001d825c6f0d61b0afe89f984eec85"
}

Response samples

Content type
application/json
{
  • "state": "waiting",
  • "referenceId": "string"
}

Get a properly encoded ClaimHandlePayload that can be signed.

path Parameters
newHandle
required
string >= 3 characters
Example: handle

newHandle in the request

+

Responses

Response samples

Content type
application/json
{
  • "payload": {
    },
  • "encodedPayload": "0x012345"
}

Fetch a handle given an MSA Id

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

+

Responses

Response samples

Content type
application/json
{
  • "base_handle": "string",
  • "canonical_base": "string",
  • "suffix": 0
}

v1/ics

IcsControllerV1_publishAll_v1

path Parameters
accountId
required
string
Example: 1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N

AccountId in hex or SS58 format

+
Request Body schema: application/json
required
required
object (AddNewPublicKeyAgreementRequestDto)
required
object (AddNewPublicKeyAgreementRequestDto)
required
object (UpsertPagePayloadDto)

Responses

Request samples

Content type
application/json
{
  • "addIcsPublicKeyPayload": {
    },
  • "addContextGroupPRIDEntryPayload": {
    },
  • "addContentGroupMetadataPayload": {
    }
}

health

Check the health status of the service

Responses

Check the live status of the service

Responses

Check the ready status of the service

Responses

v1/keys

Add new control keys for an MSA Id

Request Body schema: application/json
required
msaOwnerAddress
required
string

msaOwnerAddress representing the target of this request

+
msaOwnerSignature
required
string

msaOwnerSignature is the signature by msa owner

+
newKeyOwnerSignature
required
string

newKeyOwnerSignature is the signature with new key

+
required
object (KeysRequestPayloadDto)

Responses

Request samples

Content type
application/json
{
  • "msaOwnerAddress": "1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N",
  • "msaOwnerSignature": "0x065d733ca151c9e65b78f2ba77348224d31647e6913c44ad2765c6e8ba06f834dc21d8182447d01c30f84a41d90a8f2e58001d825c6f0d61b0afe89f984eec85",
  • "newKeyOwnerSignature": "0x065d733ca151c9e65b78f2ba77348224d31647e6913c44ad2765c6e8ba06f834dc21d8182447d01c30f84a41d90a8f2e58001d825c6f0d61b0afe89f984eec85",
  • "payload": {
    }
}

Response samples

Content type
application/json
{
  • "state": "waiting",
  • "referenceId": "string"
}

Fetch public keys given an MSA Id

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

+

Responses

Response samples

Content type
application/json
{
  • "msaKeys": { }
}

Get a properly encoded StatefulStorageItemizedSignaturePayloadV2 that can be signed.

query Parameters
msaId
required
string
Example: msaId=3

MSA Id representing the target of this request

+
newKey
required
string
Example: newKey=0x0ed2f8c714efcac51ca2325cfe95637e5e0b898ae397aa365978b7348a717d0b

New public key to be added to the account (32-byte value in hex format)

+
schemaId
required
number
Example: schemaId=16299

Schema Id - The number of the schema to generate the payload for

+

Responses

Response samples

Content type
application/json
{
  • "payload": {
    },
  • "encodedPayload": "0x1234"
}

Request to add a new public Key

Request Body schema: application/json
required
accountId
required
string

AccountId in hex or SS58 format

+
required
object (ItemizedSignaturePayloadDto)
proof
required
string

proof is the signature for the payload

+

Responses

Request samples

Content type
application/json
{
  • "accountId": "1LSLqpLWXo7A7xuiRdu6AQPnBPNJHoQSu8DBsUYJgsNEJ4N",
  • "payload": {
    },
  • "proof": "0x065d733ca151c9e65b78f2ba77348224d31647e6913c44ad2765c6e8ba06f834dc21d8182447d01c30f84a41d90a8f2e58001d825c6f0d61b0afe89f984eec85"
}

Response samples

Content type
application/json
{
  • "state": "waiting",
  • "referenceId": "string"
}

Get a properly encoded StatefulStorageItemizedSignaturePayloadV2 that can be signed.

query Parameters
msaId
required
string
newKey
required
string
keyType
required
string

Responses

Response samples

Content type
application/json
{
  • "payload": {
    },
  • "encodedPayload": "0x1234"
}
-

Transaction Notification API (1.0.0)

Download OpenAPI specification:

Notify transaction

Request Body schema: application/json
required
One of
providerId
required
string
referenceId
required
string
msaId
required
string
"CREATE_HANDLE" (string) or "CHANGE_HANDLE" (string)
handle
required
string

Responses

Request samples

Content type
application/json
Example
{
  • "providerId": "string",
  • "referenceId": "string",
  • "msaId": "string",
  • "transactionType": "CREATE_HANDLE",
  • "handle": "string"
}
+ " fill="currentColor">

Transaction Notification API (1.0.0)

Download OpenAPI specification:

Notify transaction

Request Body schema: application/json
required
One of
providerId
required
string
referenceId
required
string
msaId
required
string
"CREATE_HANDLE" (string) or "CHANGE_HANDLE" (string)
handle
required
string

Responses

Request samples

Content type
application/json
Example
{
  • "providerId": "string",
  • "referenceId": "string",
  • "msaId": "string",
  • "transactionType": "CREATE_HANDLE",
  • "handle": "string"
}
-

Content Publishing Worker Service (2.0)

Download OpenAPI specification:

Content Publishing Worker Service API

-

health

Check the health status of the service

Responses

Check the live status of the service

Responses

Check the ready status of the service

Responses

+ " fill="currentColor">

Content Publishing Worker Service (2.0)

Download OpenAPI specification:

Content Publishing Worker Service API

+

health

Check the health status of the service

Responses

Check the live status of the service

Responses

Check the ready status of the service

Responses

-

Content Publishing Service API (1.0)

Download OpenAPI specification:

Content Publishing Service API

-

v1/asset

Upload asset files [deprecated; use `POST /v2/asset/upload` instead] Deprecated

Request Body schema: multipart/form-data
required

Asset files

-
files
required
Array of strings <binary> [ items <binary > ]

Responses

Response samples

Content type
application/json
{
  • "assetIds": [
    ]
}

v2/asset

Upload asset files

Request Body schema: multipart/form-data
required

Asset files

-
files
required
Array of strings <binary> [ items <binary > ]

Responses

Response samples

Content type
application/json
{
  • "files": [
    ]
}

v1/content

Create DSNP Broadcast for user

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

-
Request Body schema: application/json
required
required
object (NoteActivityDto)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "referenceId": "string"
}

Create DSNP Reply for user

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

-
Request Body schema: application/json
required
inReplyTo
required
string

Target DSNP Content URI

-
required
object (NoteActivityDto)

Responses

Request samples

Content type
application/json
{
  • "inReplyTo": "dsnp://78187493520/bdyqdua4t4pxgy37mdmjyqv3dejp5betyqsznimpneyujsur23yubzna",
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "referenceId": "string"
}

Create DSNP Reaction for user

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

-
Request Body schema: application/json
required
emoji
required
string non-empty DSNP_EMOJI_REGEX

the encoded reaction emoji

-
apply
required
number

Indicates whether the emoji should be applied and if so, at what strength

-
inReplyTo
required
string

Target DSNP Content URI

-

Responses

Request samples

Content type
application/json
{
  • "emoji": "😀",
  • "apply": 1,
  • "inReplyTo": "dsnp://78187493520/bdyqdua4t4pxgy37mdmjyqv3dejp5betyqsznimpneyujsur23yubzna"
}

Response samples

Content type
application/json
{
  • "referenceId": "string"
}

Update DSNP Content for user

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

-
Request Body schema: application/json
required
targetAnnouncementType
required
string
Enum: "broadcast" "reply"

Target announcement type

-
targetContentHash
required
string

Target DSNP Content Hash

-
required
object (NoteActivityDto)

Responses

Request samples

Content type
application/json
{
  • "targetAnnouncementType": "broadcast",
  • "targetContentHash": "bdyqdua4t4pxgy37mdmjyqv3dejp5betyqsznimpneyujsur23yubzna",
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "referenceId": "string"
}

Delete DSNP Content for user [deprecated; use `POST /v2/content/{msaId}/tombstones` instead] Deprecated

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

-
Request Body schema: application/json
required
targetAnnouncementType
required
string
Enum: "broadcast" "reply"

Target announcement type

-
targetContentHash
required
string

Target DSNP Content Hash

-

Responses

Request samples

Content type
application/json
{
  • "targetAnnouncementType": "broadcast",
  • "targetContentHash": "bdyqdua4t4pxgy37mdmjyqv3dejp5betyqsznimpneyujsur23yubzna"
}

Response samples

Content type
application/json
{
  • "referenceId": "string"
}

v2/content

Create on-chain content for a given schema

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

-
Request Body schema: application/json
required
schemaId
required
number

Content Publishing Service API (1.0)

Download OpenAPI specification:

Content Publishing Service API

+

v1/asset

Upload asset files [deprecated; use `POST /v2/asset/upload` instead] Deprecated

Request Body schema: multipart/form-data
required

Asset files

+
files
required
Array of strings <binary> [ items <binary > ]

Responses

Response samples

Content type
application/json
{
  • "assetIds": [
    ]
}

v2/asset

Upload asset files

Request Body schema: multipart/form-data
required

Asset files

+
files
required
Array of strings <binary> [ items <binary > ]

Responses

Response samples

Content type
application/json
{
  • "files": [
    ]
}

v1/content

Create DSNP Broadcast for user

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

+
Request Body schema: application/json
required
required
object (NoteActivityDto)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "referenceId": "string"
}

Create DSNP Reply for user

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

+
Request Body schema: application/json
required
inReplyTo
required
string

Target DSNP Content URI

+
required
object (NoteActivityDto)

Responses

Request samples

Content type
application/json
{
  • "inReplyTo": "dsnp://78187493520/bdyqdua4t4pxgy37mdmjyqv3dejp5betyqsznimpneyujsur23yubzna",
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "referenceId": "string"
}

Create DSNP Reaction for user

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

+
Request Body schema: application/json
required
emoji
required
string non-empty DSNP_EMOJI_REGEX

the encoded reaction emoji

+
apply
required
number

Indicates whether the emoji should be applied and if so, at what strength

+
inReplyTo
required
string

Target DSNP Content URI

+

Responses

Request samples

Content type
application/json
{
  • "emoji": "😀",
  • "apply": 1,
  • "inReplyTo": "dsnp://78187493520/bdyqdua4t4pxgy37mdmjyqv3dejp5betyqsznimpneyujsur23yubzna"
}

Response samples

Content type
application/json
{
  • "referenceId": "string"
}

Update DSNP Content for user

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

+
Request Body schema: application/json
required
targetAnnouncementType
required
string
Enum: "broadcast" "reply"

Target announcement type

+
targetContentHash
required
string

Target DSNP Content Hash

+
required
object (NoteActivityDto)

Responses

Request samples

Content type
application/json
{
  • "targetAnnouncementType": "broadcast",
  • "targetContentHash": "bdyqdua4t4pxgy37mdmjyqv3dejp5betyqsznimpneyujsur23yubzna",
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "referenceId": "string"
}

Delete DSNP Content for user [deprecated; use `POST /v2/content/{msaId}/tombstones` instead] Deprecated

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

+
Request Body schema: application/json
required
targetAnnouncementType
required
string
Enum: "broadcast" "reply"

Target announcement type

+
targetContentHash
required
string

Target DSNP Content Hash

+

Responses

Request samples

Content type
application/json
{
  • "targetAnnouncementType": "broadcast",
  • "targetContentHash": "bdyqdua4t4pxgy37mdmjyqv3dejp5betyqsznimpneyujsur23yubzna"
}

Response samples

Content type
application/json
{
  • "referenceId": "string"
}

v2/content

Create on-chain content for a given schema

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

+
Request Body schema: application/json
required
schemaId
required
number

Schema ID of the OnChain schema this message is being posted to. +" class="sc-iKGpAq sc-cCYyou dXXcln cFvDiF">

Schema ID of the OnChain schema this message is being posted to. @example: 16

-
payload
required
string/^0x/

Payload bytes encoded as a hex string using the schema defined by schemaId

-
published
required
string

The time of publishing ISO8601

-

Responses

Request samples

Content type
application/json
{
  • "schemaId": 0,
  • "payload": "string",
  • "published": "1970-01-01T00:00:00+00:00"
}

Response samples

Content type
application/json
{
  • "referenceId": "string"
}

Create off-chain batch content announcements

Request Body schema: application/json
required
required
Array of objects (BatchFileDto)

Responses

Request samples

Content type
application/json
{
  • "batchFiles": [
    ]
}

Response samples

Content type
application/json
{
  • "referenceId": "string"
}

Post an announcement that previously-announced content is invalid/revoked

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

-
Request Body schema: application/json
required
targetAnnouncementType
required
string
Enum: "broadcast" "reply"

Target announcement type

-
targetContentHash
required
string

Target DSNP Content Hash

-

Responses

Request samples

Content type
application/json
{
  • "targetAnnouncementType": "broadcast",
  • "targetContentHash": "bdyqdua4t4pxgy37mdmjyqv3dejp5betyqsznimpneyujsur23yubzna"
}

Response samples

Content type
application/json
{
  • "referenceId": "string"
}

health

Check the health status of the service

Responses

Check the live status of the service

Responses

Check the ready status of the service

Responses

v1/profile

Update a user's Profile

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

-
Request Body schema: application/json
required
required
object (ProfileActivityDto)

Responses

Request samples

Content type
application/json
{
  • "profile": {
    }
}
+
payload
required
string/^0x/

Payload bytes encoded as a hex string using the schema defined by schemaId

+
published
required
string

The time of publishing ISO8601

+

Responses

Request samples

Content type
application/json
{
  • "schemaId": 0,
  • "payload": "string",
  • "published": "1970-01-01T00:00:00+00:00"
}

Response samples

Content type
application/json
{
  • "referenceId": "string"
}

Create off-chain batch content announcements

Request Body schema: application/json
required
required
Array of objects (BatchFileDto)

Responses

Request samples

Content type
application/json
{
  • "batchFiles": [
    ]
}

Response samples

Content type
application/json
{
  • "referenceId": "string"
}

Post an announcement that previously-announced content is invalid/revoked

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

+
Request Body schema: application/json
required
targetAnnouncementType
required
string
Enum: "broadcast" "reply"

Target announcement type

+
targetContentHash
required
string

Target DSNP Content Hash

+

Responses

Request samples

Content type
application/json
{
  • "targetAnnouncementType": "broadcast",
  • "targetContentHash": "bdyqdua4t4pxgy37mdmjyqv3dejp5betyqsznimpneyujsur23yubzna"
}

Response samples

Content type
application/json
{
  • "referenceId": "string"
}

health

Check the health status of the service

Responses

Check the live status of the service

Responses

Check the ready status of the service

Responses

v1/profile

Update a user's Profile

path Parameters
msaId
required
string
Example: 2

Msa Id of requested account

+
Request Body schema: application/json
required
required
object (ProfileActivityDto)

Responses

Request samples

Content type
application/json
{
  • "profile": {
    }
}
-

Content Watcher Service API (1.0)

Download OpenAPI specification:

Content Watcher Service API

-

health

Check the health status of the service

Responses

Check the live status of the service

Responses

Check the ready status of the service

Responses

v1/scanner

Reset blockchain scan to a specific block number or offset from the current position

Request Body schema: application/json
required
blockNumber
number [ 0 .. 4294967296 ]

The block number to reset the scanner to

-
rewindOffset
number [ 0 .. 4294967296 ]

Number of blocks to rewind the scanner to (from blockNumber if supplied; else from latest block)

-
immediate
boolean

Whether to schedule the new scan immediately or wait for the next scheduled interval

-

Responses

Request samples

Content type
application/json
{
  • "blockNumber": 0,
  • "rewindOffset": 100,
  • "immediate": true
}

Get the current watch options for the blockchain content event scanner

Responses

Response samples

Content type
application/json
{
  • "schemaIds": [
    ],
  • "dsnpIds": [
    ]
}

Set watch options to filter the blockchain content scanner by schemas or MSA Ids

Request Body schema: application/json
required
schemaIds
Array of numbers non-empty unique

Specific schema ids to watch for

-
dsnpIds
Array of strings non-empty unique

Specific dsnpIds (msa_id) to watch for

-

Responses

Request samples

Content type
application/json
{
  • "schemaIds": [
    ],
  • "dsnpIds": [
    ]
}

Pause the blockchain scanner

Responses

Resume the blockchain content event scanner

query Parameters
immediate
boolean

Immediate: whether to resume scan immediately (true), or wait until next scheduled scan (false)

-

Responses

v1/search

Search for DSNP content by id and filters, starting from `upperBound` block and going back for `blockCount` number of blocks

Request Body schema: application/json
required
clientReferenceId
string

An optional client-supplied reference ID by which it can identify the result of this search

-
upperBoundBlock
number [ 0 .. 4294967296 ]

The highest block number to start the backward search from

-
blockCount
required
number [ 0 .. 4294967296 ]

The number of blocks to scan (backwards)

-
object

The schemaIds/dsnpIds to filter by

-
webhookUrl
required
string <uri>

A webhook URL to be notified of the results of this search

-

Responses

Request samples

Content type
application/json
{
  • "clientReferenceId": "string",
  • "upperBoundBlock": 100,
  • "blockCount": 101,
  • "filters": {
    },
  • "webhookUrl": "https://example.com"
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "jobId": "7b02edd742a653a3cf63bb0c84e43d3678aa045f"
}

v1/webhooks

Register a webhook to be called when new content is encountered on the chain

Request Body schema: application/json
required
announcementTypes
required
Array of strings (AnnouncementTypeName) non-empty
Items Enum: "tombstone" "broadcast" "reply" "reaction" "profile" "update"

Announcement types to send to the webhook

-
url
required
string <uri>

Webhook URL

-

Responses

Request samples

Content type
application/json
{}

Clear all previously registered webhooks

Responses

Get the list of currently registered webhooks

Responses

Response samples

Content type
application/json
{
  • "status": 200,
  • "registeredWebhooks": []
}
+ " fill="currentColor">

Content Watcher Service API (1.0)

Download OpenAPI specification:

Content Watcher Service API

+

health

Check the health status of the service

Responses

Check the live status of the service

Responses

Check the ready status of the service

Responses

v1/scanner

Reset blockchain scan to a specific block number or offset from the current position

Request Body schema: application/json
required
blockNumber
number [ 0 .. 4294967296 ]

The block number to reset the scanner to

+
rewindOffset
number [ 0 .. 4294967296 ]

Number of blocks to rewind the scanner to (from blockNumber if supplied; else from latest block)

+
immediate
boolean

Whether to schedule the new scan immediately or wait for the next scheduled interval

+

Responses

Request samples

Content type
application/json
{
  • "blockNumber": 0,
  • "rewindOffset": 100,
  • "immediate": true
}

Get the current watch options for the blockchain content event scanner

Responses

Response samples

Content type
application/json
{
  • "intentIds": [
    ],
  • "dsnpIds": [
    ]
}

Set watch options to filter the blockchain content scanner by schemas or MSA Ids

Request Body schema: application/json
required
intentIds
Array of numbers non-empty unique

Specific Intent ids to watch for

+
dsnpIds
Array of strings non-empty unique

Specific dsnpIds (msa_id) to watch for

+

Responses

Request samples

Content type
application/json
{
  • "intentIds": [
    ],
  • "dsnpIds": [
    ]
}

Pause the blockchain scanner

Responses

Resume the blockchain content event scanner

query Parameters
immediate
boolean

Immediate: whether to resume scan immediately (true), or wait until next scheduled scan (false)

+

Responses

v1/search

Search for DSNP content by id and filters, starting from `upperBound` block and going back for `blockCount` number of blocks

Request Body schema: application/json
required
clientReferenceId
string

An optional client-supplied reference ID by which it can identify the result of this search

+
upperBoundBlock
number [ 0 .. 4294967296 ]

The highest block number to start the backward search from

+
blockCount
required
number [ 0 .. 4294967296 ]

The number of blocks to scan (backwards)

+
object

The schemaIds/dsnpIds to filter by

+
webhookUrl
required
string <uri>

A webhook URL to be notified of the results of this search

+

Responses

Request samples

Content type
application/json
{
  • "clientReferenceId": "string",
  • "upperBoundBlock": 100,
  • "blockCount": 101,
  • "filters": {
    },
  • "webhookUrl": "https://example.com"
}

Response samples

Content type
application/json
{
  • "status": 200,
  • "jobId": "7b02edd742a653a3cf63bb0c84e43d3678aa045f"
}

v1/webhooks

Register a webhook to be called when new content is encountered on the chain

Request Body schema: application/json
required
announcementTypes
required
Array of strings (AnnouncementTypeName) non-empty
Items Enum: "tombstone" "broadcast" "reply" "reaction" "profile" "update"

Announcement types to send to the webhook

+
url
required
string <uri>

Webhook URL

+

Responses

Request samples

Content type
application/json
{}

Clear all previously registered webhooks

Responses

Get the list of currently registered webhooks

Responses

Response samples

Content type
application/json
{
  • "status": 200,
  • "registeredWebhooks": []
}
-

Content Announcement API (1.0.0)

Download OpenAPI specification:

Notify a webhook client of a content announcement found on the blockchain

Request Body schema: application/json
required
requestId
string or null

An optional identifier for the request, may be used for tracking or correlation

-
webhookUrl
string or null

An optional webhook URL registered as part of a specific search request

-
schemaId
required
integer

Identifier for the schema being used or referenced

-
blockNumber
required
integer

The block number on the blockchain where this announcement was recorded

-
required
TombstoneAnnouncement (object) or BroadcastAnnouncement (object) or ReplyAnnouncement (object) or ReactionAnnouncement (object) or ProfileAnnouncement (object) or UpdateAnnouncement (object)

Responses

Request samples

Content type
application/json
{
  • "requestId": "string",
  • "webhookUrl": "string",
  • "schemaId": 0,
  • "blockNumber": 0,
  • "announcement": {
    }
}
+ " fill="currentColor">

Content Announcement API (1.0.0)

Download OpenAPI specification:

Notify a webhook client of a content announcement found on the blockchain

Request Body schema: application/json
required
requestId
string or null

An optional identifier for the request, may be used for tracking or correlation

+
webhookUrl
string or null

An optional webhook URL registered as part of a specific search request

+
schemaId
required
integer

Identifier for the schema being used or referenced

+
blockNumber
required
integer

The block number on the blockchain where this announcement was recorded

+
required
TombstoneAnnouncement (object) or BroadcastAnnouncement (object) or ReplyAnnouncement (object) or ReactionAnnouncement (object) or ProfileAnnouncement (object) or UpdateAnnouncement (object)

Responses

Request samples

Content type
application/json
{
  • "requestId": "string",
  • "webhookUrl": "string",
  • "schemaId": 0,
  • "blockNumber": 0,
  • "announcement": {
    }
}