Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion docs/build/sdk/v2/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ a more optimized way and also need to interact with the chain itself.

:::

:::info

If you are trying to import dependencies using CommonJS `require("")` syntax with `const { create, mainnet } = require("@zeitgeistpm/sdk")`, then it will not work. Instead you need to import with Modules (ESM) `await import("")` syntax. For example:
```js
(async () => {
const { create, mainnet } = await import("@zeitgeistpm/sdk")`
})().catch(console.error).finally(() => process.exit());
```

:::

### Rpc Mode

The rpc mode connects only to the rpc chain node and has a bit more limitations
Expand Down Expand Up @@ -141,11 +152,17 @@ import { create, createStorage } from "@zeitgeistpm/sdk";
import { IPFS } from "@zeitgeistpm/web3.storage";

const sdk: Sdk<RpcContext> = await create({
provider: "wss://localhost:9944",
provider: "ws://localhost:9944",
storage: createStorage(
IPFS.storage({
node: { url: "localhost:5001" },
})
),
});
```

:::note

In production you are recommended to use `wss` (WebSocket Secure) instead of `ws`

:::
2 changes: 1 addition & 1 deletion docs/build/sdk/v2/market-creation-two-step.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
} from "@zeitgeistpm/sdk";

/**
* Initialize the SDK in full or rpc mode to be able to submit transactions to the chein.
* Initialize the SDK in full or rpc mode to be able to submit transactions to the chain.
*/
const sdk: Sdk<RpcContext> = await create(batterystationRpc());

Expand Down