Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lidangzzz committed Dec 17, 2023
1 parent c44073e commit e4d66f9
Show file tree
Hide file tree
Showing 34 changed files with 404 additions and 140 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ darc-docs/.docusaurus

# Darc docs Compiled output
darc-docs/build
darc-docs/static/api
darc-docs/static/api
darc-js/dist
6 changes: 2 additions & 4 deletions darc-js/dist/SDK/instructions.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { TokenOperations } from "./struct/token-operation-map";
import { Plugin } from "./struct/Plugin";
declare function transfer_tokens(targetAddress: string, amount: number, tokenID: number): void;
declare function mint_tokens(tokenID: number, amount: number, targetAddress: string): void;
declare function create_token_class(tokenName: string, tokenVotingWeight: number, tokenDividendWeight: number): void;
export declare let operationList: never[];
declare function withdraw_dividends(): void;
declare function withdraw_money(amount: number): void;
declare function withdraw_money_and_send_to_address(amount: number, targetAddress: string): void;
Expand All @@ -21,5 +19,5 @@ declare function add_to_member_list(alias: string, role: string, address: string
declare function modify_member_list(alias: string, role: string, address: string): void;
declare function suspend_member_list(address: string): void;
declare function reactivate_member_list(address: string): void;
export { transfer_tokens, mint_tokens, create_token_class, withdraw_dividends, withdraw_money, withdraw_money_and_send_to_address, pay_money, enable_plugin_index, disable_plugin_index, add_plugin, add_and_enable_plugin, burn_tokens, batch_transfer_tokens, batch_mint_tokens, batch_burn_tokens, call_emergency, set_parameter, add_to_member_list, modify_member_list, suspend_member_list, reactivate_member_list };
export { withdraw_dividends, withdraw_money, withdraw_money_and_send_to_address, pay_money, enable_plugin_index, disable_plugin_index, add_plugin, add_and_enable_plugin, burn_tokens, batch_transfer_tokens, batch_mint_tokens, batch_burn_tokens, call_emergency, set_parameter, add_to_member_list, modify_member_list, suspend_member_list, reactivate_member_list };
//# sourceMappingURL=instructions.d.ts.map
2 changes: 1 addition & 1 deletion darc-js/dist/SDK/instructions.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions darc-js/dist/SDK/instructions.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion darc-js/dist/SDK/instructions.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion darc-js/dist/SDK/runtime.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export declare function run(code: string): void;
import { ethers } from 'ethers';
export declare function run(code: string, wallet: ethers.Wallet, provider: ethers.providers.Provider, address: string): void;
//# sourceMappingURL=runtime.d.ts.map
2 changes: 1 addition & 1 deletion darc-js/dist/SDK/runtime.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions darc-js/dist/SDK/runtime.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion darc-js/dist/SDK/runtime.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion darc-js/dist/SDK/struct/Plugin.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConditionNode } from "../plugin/ConditionNode";
import { ConditionNode } from "../plugins/ConditionNode";
import { VotingParameters } from "./voting-param";
declare class Plugin {
note: string;
Expand Down
2 changes: 1 addition & 1 deletion darc-js/dist/SDK/struct/Plugin.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions darc-js/dist/darcjs.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { deployDARC } from './runtime/runtime';
import { deployDARC } from './deployDARC/deployDARC';
import { transpiler } from './SDK/transpiler';
import { DARC, InitParam, TokenInfo, MemberInfo } from './DARC/DARC';
import { darcBinary, DARCBinaryStruct, DARC_VERSION } from './darcBinary/darcBinary';
import { ethers } from 'ethers';
export { deployDARC, transpiler, DARC, InitParam, TokenInfo, MemberInfo, darcBinary, DARCBinaryStruct, DARC_VERSION, ethers };
import { run } from './SDK/runtime';
export { deployDARC, transpiler, DARC, InitParam, TokenInfo, MemberInfo, darcBinary, DARCBinaryStruct, DARC_VERSION, ethers, run };
//# sourceMappingURL=darcjs.d.ts.map
2 changes: 1 addition & 1 deletion darc-js/dist/darcjs.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions darc-js/dist/darcjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion darc-js/dist/darcjs.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion darc-js/src/DARC/DARC.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as runtime from '../runtime/runtime';
import * as runtime from '../deployDARC/deployDARC';
import { ethers, Contract } from 'ethers';
import * as darcBinary from '../darcBinary/darcBinary';

Expand Down
Empty file removed darc-js/src/SDK/SDK.ts
Empty file.
22 changes: 22 additions & 0 deletions darc-js/src/SDK/includes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// all the included instructions are here, mostly instructions for operations
// todo: add backend support for current operations

import { TokenOperations } from "./struct/token-operation-map";
import { Plugin } from "./struct/Plugin";
import { OperationStruct } from "./struct/basicTypes";

import { op_batch_mint_tokens } from "./opcodes/op_batch_mint_tokens";
import { op_batch_create_token_class } from "./opcodes/op_batch_create_token_class";
import { objectMethod } from "@babel/types";

export let operationList: OperationStruct[] = [];

export function batch_mint_tokens(addressArray: string[], amountArray: bigint[], tokenClass: bigint[], operatorAddress:string) {
let operation = op_batch_mint_tokens(addressArray, amountArray, tokenClass, operatorAddress);
operationList.push(operation);
}

export function batch_create_token_class(nameArray: string[], tokenIndexArray: bigint[], votingWeightArray: bigint[], dividendWeightArray: bigint[], operatorAddress:string) {
let operation = op_batch_create_token_class(nameArray, tokenIndexArray, votingWeightArray, dividendWeightArray, operatorAddress);
operationList.push(operation);
}
93 changes: 0 additions & 93 deletions darc-js/src/SDK/instructions.ts

This file was deleted.

Loading

0 comments on commit e4d66f9

Please sign in to comment.