candid-kt icon indicating copy to clipboard operation
candid-kt copied to clipboard

Add retrieveAssets function

Open seniorjoinu opened this issue 4 years ago • 0 comments

The retrieveAsset function is a special function that has the next signature

suspend fun __retrieveAsset(path: String): ByteArray

It is needed to enable a client code to fetch some static resources from a canister (e.g. images, fonts...) It is done via requesting a canister with a built-in method __dfx_asset_path(path) (every canister has this function by default). You can find example implementation inside js-user-library/http_agent.js.

seniorjoinu avatar Jun 29 '20 16:06 seniorjoinu