cic-docs/spec/012_multitoken_platform_api...

1.3 KiB

API EXTENSIONS FOR EXTERNALLY CREATED BLOCKCHAIN RESOURCES

At time of writing, apis are registered under /api/v2. This will change.

NOMENCLATURE

Values enclosed with <> are required.

Values enclosed with [] means optional.

No enclosure means literal.

CHANGED METHODS

Endpoints modified are found under /api/v1/

Changes will be submitted upstream.

/api/v1/organisation

POST

One item is added to data payload:

{
	account_address: [address],
}

If specified, the organisation will be bound to the specified blockchain account, and will not create a new account on instantiation.

ADDED METHODS

Endpoints added are found under /api/ext/

/api/ext/exchange/register

POST

Creates a new entry in exchange_contract table in database.

Requires token addresses to be registered in advance on /api/v1/token/

Request payload:

{
	reserve_address: <address>,
	token_address: <address>,
	converter_address: <address>,
	registry_address: <address>,
	connector_weight: <uint>,
}

Response payload on success:

{
	message: 'Exchange added',
	data: {
		exchange: (exchange schema dump, TODO specify)
	}
}

Returns:

201 - exchange record created
400 - token addresses not known to platform