MCPcopy Create free account
hub / github.com/B3Pay/B3Wallet / createApp

Function createApp

scripts/load-wasm.system.ts:23–48  ·  view source on GitHub ↗
(appId: AvailableAppIds)

Source from the content-addressed store, hash-verified

21}
22
23async function createApp(appId: AvailableAppIds) {
24 const metadataJson: Metadata = require(`../canisters/${appId}/metadata.json`)
25
26 const metadata: CreateAppArgs["metadata"] = Object.entries(
27 metadataJson
28 ).reduce((acc, [key, value]) => {
29 if (key === "logo") {
30 acc.push([
31 "logo",
32 {
33 Blob: loadImageFile(value, false)
34 }
35 ])
36 return acc
37 }
38
39 acc.push([key, { Text: value }])
40 return acc
41 }, [] as CreateAppArgs["metadata"])
42
43 return await callSystemMethod("create_app", {
44 name: appId,
45 description: metadataJson.description,
46 metadata
47 })
48}
49
50async function addRelease(
51 app_id: string,

Callers 2

AppFunction · 0.85
loaderFunction · 0.85

Calls 1

loadImageFileFunction · 0.90

Tested by

no test coverage detected