@graphprotocol/grc-20 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -278,16 +278,17 @@ const txResult = await walletClient.sendTransaction({
|
|
|
278
278
|
|
|
279
279
|
You can deploy spaces programmatically using the API. Currently there are two types of governance modes for spaces: one with voting and one without. They're called PUBLIC or PERSONAL spaces respectively. The API only supports deploying the PERSONAL governance mode currently.
|
|
280
280
|
|
|
281
|
-
The API
|
|
281
|
+
The API supports deploying to both testnet and mainnet. By default it will deploy to mainnet.
|
|
282
282
|
|
|
283
283
|
```ts
|
|
284
|
+
import { Graph } from '@graphprotocol/grc-20';
|
|
284
285
|
const editorAddress = '0x000000000000000000000000000000000000';
|
|
285
286
|
const spaceName = 'Example-Name';
|
|
286
287
|
|
|
287
|
-
const
|
|
288
|
-
|
|
289
|
-
|
|
288
|
+
const spaceId = await Graph.createSpace({
|
|
289
|
+
initialEditorAddress,
|
|
290
|
+
spaceName,
|
|
291
|
+
// Optionally specify TESTNET or MAINNET. Defaults to MAINNET
|
|
292
|
+
network: 'TESTNET',
|
|
290
293
|
});
|
|
291
|
-
|
|
292
|
-
const { spaceId } = await result.json();
|
|
293
294
|
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-space.d.ts","sourceRoot":"","sources":["../../../src/graph/create-space.ts"],"names":[],"mappings":"AAEA,KAAK,MAAM,GAAG;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"create-space.d.ts","sourceRoot":"","sources":["../../../src/graph/create-space.ts"],"names":[],"mappings":"AAEA,KAAK,MAAM,GAAG;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,WAAkB,MAAM;;EAgB/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-space.js","sourceRoot":"","sources":["../../../src/graph/create-space.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"create-space.js","sourceRoot":"","sources":["../../../src/graph/create-space.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAQlD;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,EAAE,MAAc,EAAE,EAAE;IAClD,MAAM,OAAO,GAAG,gBAAgB,CAAC;IACjC,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,GAAG,OAAO,SAAS,EAAE;QAC9C,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,SAAS,EAAE,MAAM,CAAC,IAAI;YACtB,oBAAoB,EAAE,MAAM,CAAC,aAAa;YAC1C,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,SAAS;SACrC,CAAC;QACF,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;SACnC;KACF,CAAC,CAAC;IAEH,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;IACxC,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC;AACzB,CAAC,CAAC"}
|