From 620c5b396604d44aa7320d2578d83c7579f75d1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AB=8B=E5=85=9A=20Lidang?= Date: Sat, 10 Feb 2024 12:21:03 -0600 Subject: [PATCH] update --- darc-js/src/DARC/DARC.ts | 16 ++++++++++++++++ darc-js/src/sdk.ts | 4 +++- darc-js/tests/runtime-test/transpileAndRun.ts | 4 ++-- .../tests/sdk-test/sdk-node-generation-test.ts | 4 ++-- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/darc-js/src/DARC/DARC.ts b/darc-js/src/DARC/DARC.ts index 3debc0d..74d1c57 100644 --- a/darc-js/src/DARC/DARC.ts +++ b/darc-js/src/DARC/DARC.ts @@ -10,6 +10,22 @@ export type InitParam = { provider?: ethers.providers.Provider; } + +export type TokenInfo = { + votingWeight: BigInt, + dividendWeight: BigInt, + tokenInfo: string, + totalSupply: BigInt, +} + +export type MemberInfo = { + bIsInitialized: boolean, + bIsSuspened: boolean, + name: string, + role: bigint +} + + /** * The DARC class is used to interact with the DARC contract. */ diff --git a/darc-js/src/sdk.ts b/darc-js/src/sdk.ts index aca890d..7260a09 100644 --- a/darc-js/src/sdk.ts +++ b/darc-js/src/sdk.ts @@ -1,4 +1,6 @@ -// import everything from includes.ts +/** + * Below are all necessary functions for the SDK. + */ import * as instructions from "./SDK/includes"; import { OperationStruct, OperationStructOutput, ProgramStruct, VotingRuleStruct, PluginStruct, PluginStructWithNode } from "./types/basicTypes"; import {ethers} from "ethers"; diff --git a/darc-js/tests/runtime-test/transpileAndRun.ts b/darc-js/tests/runtime-test/transpileAndRun.ts index ef7a611..ae77a38 100644 --- a/darc-js/tests/runtime-test/transpileAndRun.ts +++ b/darc-js/tests/runtime-test/transpileAndRun.ts @@ -1,10 +1,10 @@ -import {executeOperationList} from "../../src/SDK/sdk"; +import {executeOperationList} from "../../src/sdk"; import {run, deployDARC, DARC_VERSION} from '../../src/darcjs'; import { ethers, BigNumber } from 'ethers'; import * as DARC from '../../src/DARC/DARC'; import 'mocha'; import { expect } from 'chai'; -import { batch_add_and_enable_plugins, batch_mint_tokens, batch_create_token_classes } from "../../src/SDK/sdk"; +import { batch_add_and_enable_plugins, batch_mint_tokens, batch_create_token_classes } from "../../src/sdk"; import {or, node, and, expression} from "../../src/SDK/Node"; import { transpileAndRun } from "../../src/SDK/runtime"; import { transpiler } from "../../src/darcjs"; diff --git a/darc-js/tests/sdk-test/sdk-node-generation-test.ts b/darc-js/tests/sdk-test/sdk-node-generation-test.ts index 3f37fb9..837673e 100644 --- a/darc-js/tests/sdk-test/sdk-node-generation-test.ts +++ b/darc-js/tests/sdk-test/sdk-node-generation-test.ts @@ -1,10 +1,10 @@ -import {executeOperationList} from "../../src/SDK/sdk"; +import {executeOperationList} from "../../src/sdk"; import {run, deployDARC, DARC_VERSION} from '../../src/darcjs'; import { ethers, BigNumber } from 'ethers'; import * as DARC from '../../src/DARC/DARC'; import 'mocha'; import { expect } from 'chai'; -import { batch_add_and_enable_plugins, batch_mint_tokens, batch_create_token_classes } from "../../src/SDK/sdk"; +import { batch_add_and_enable_plugins, batch_mint_tokens, batch_create_token_classes } from "../../src/sdk"; import {or, node, and, expression} from "../../src/SDK/Node";