forked from Project-DARC/DARC
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
1,913 additions
and
10 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
96 changes: 96 additions & 0 deletions
96
darc-js/src/SDK/conditionNodes/Condition_CreateTokenClass.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import {expression} from "../Node"; | ||
|
||
/** | ||
* CreateTokenClass-related condition nodes | ||
| 501 | CREATE_TOKEN_CLASSES_ANY_TOKEN_DIVIDEND_WEIGHT_GREATER_THAN | UINT256_2DARRAY[0][0] weight | For "BATCH_CREATE_TOKEN_CLASSES" operation. | ||
| 502 | CREATE_TOKEN_CLASSES_ANY_TOKEN_DIVIDEND_WEIGHT_LESS_THAN | UINT256_2DARRAY[0][0] weight | For "BATCH_CREATE_TOKEN_CLASSES" operation. | ||
| 503 | CREATE_TOKEN_CLASSES_ANY_TOKEN_DIVIDEND_WEIGHT_IN_RANGE | UINT256_2DARRAY[0][0]startWeight, UINT256_2DARRAY[0][1] endWeight | For "BATCH_CREATE_TOKEN_CLASSES" operation. | ||
| 504 | CREATE_TOKEN_CLASSES_ANY_TOKEN_DIVIDEND_WEIGHT_EQUALS | UINT256_2DARRAY[0][0] weight | For "BATCH_CREATE_TOKEN_CLASSES" operation. | ||
| 505 | CREATE_TOKEN_CLASSES_ANY_VOTING_WEIGHT_GREATER_THAN | UINT256_2DARRAY[0][0] weight | For "BATCH_CREATE_TOKEN_CLASSES" operation. | ||
| 506 | CREATE_TOKEN_CLASSES_ANY_VOTING_WEIGHT_LESS_THAN | UINT256_2DARRAY[0][0] weight | For "BATCH_CREATE_TOKEN_CLASSES" operation. | ||
| 507 | CREATE_TOKEN_CLASSES_ANY_VOTING_WEIGHT_IN_RANGE | UINT256_2DARRAY[0][0] startWeight, UINT256_2DARRAY[0][1] endWeight | For "BATCH_CREATE_TOKEN_CLASSES" operation. | ||
| 508 | CREATE_TOKEN_CLASSES_ANY_VOTING_WEIGHT_EQUALS | UINT256_2DARRAY[0][0] weight | For "BATCH_CREATE_TOKEN_CLASSES" operation. | ||
*/ | ||
|
||
function create_token_classes_any_token_dividend_weight_greater_than(weight: bigint) { | ||
return expression(501, { | ||
UINT256_2DARRAY: [[weight]], | ||
STRING_ARRAY: [], | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function create_token_classes_any_token_dividend_weight_less_than(weight: bigint) { | ||
return expression(502, { | ||
UINT256_2DARRAY: [[weight]], | ||
STRING_ARRAY: [], | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function create_token_classes_any_token_dividend_weight_in_range(startWeight: bigint, endWeight: bigint) { | ||
return expression(503, { | ||
UINT256_2DARRAY: [[startWeight, endWeight]], | ||
STRING_ARRAY: [], | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function create_token_classes_any_token_dividend_weight_equals(weight: bigint) { | ||
return expression(504, { | ||
UINT256_2DARRAY: [[weight]], | ||
STRING_ARRAY: [], | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function create_token_classes_any_voting_weight_greater_than(weight: bigint) { | ||
return expression(505, { | ||
UINT256_2DARRAY: [[weight]], | ||
STRING_ARRAY: [], | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function create_token_classes_any_voting_weight_less_than(weight: bigint) { | ||
return expression(506, { | ||
UINT256_2DARRAY: [[weight]], | ||
STRING_ARRAY: [], | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function create_token_classes_any_voting_weight_in_range(startWeight: bigint, endWeight: bigint) { | ||
return expression(507, { | ||
UINT256_2DARRAY: [[startWeight, endWeight]], | ||
STRING_ARRAY: [], | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function create_token_classes_any_voting_weight_equals(weight: bigint) { | ||
return expression(508, { | ||
UINT256_2DARRAY: [[weight]], | ||
STRING_ARRAY: [], | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
export { | ||
create_token_classes_any_token_dividend_weight_greater_than, | ||
create_token_classes_any_token_dividend_weight_less_than, | ||
create_token_classes_any_token_dividend_weight_in_range, | ||
create_token_classes_any_token_dividend_weight_equals, | ||
create_token_classes_any_voting_weight_greater_than, | ||
create_token_classes_any_voting_weight_less_than, | ||
create_token_classes_any_voting_weight_in_range, | ||
create_token_classes_any_voting_weight_equals | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import {expression } from '../Node'; | ||
|
||
/** | ||
* Membership-related condition nodes | ||
| 401 | CHANGE_MEMBER_ROLE_TO_ANY_ROLE_EQUALS | ADDRESS_2DARRAY[0][0] targetAddress || | ||
| 402 | CHANGE_MEMBER_ROLE_TO_ANY_ROLE_IN_LIST | ADDRESS_2DARRAY[0] targetAddressArray || | ||
| 403 | CHANGE_MEMBER_ROLE_TO_ANY_ROLE_IN_RANGE | ADDRESS_2DARRAY[0][0] startTargetAddress, ADDRESS_2DARRAY[0][1] endTargetAddress || | ||
| 404 | Placeholder404 | | | | ||
| 405 | Placeholder405 | | | | ||
| 406 | CHANGE_MEMBER_NAME_TO_ANY_STRING_IN_LIST | STRING_ARRAY nameList || | ||
| 407 | CHANGE_MEMBER_NAME_TO_ANY_STRING_CONTAINS | STRING_ARRAY[0] subString || | ||
*/ | ||
|
||
function change_member_role_to_any_role_equals(targetAddress: string) { | ||
return expression(401, { | ||
UINT256_2DARRAY: [], | ||
STRING_ARRAY: [], | ||
ADDRESS_2DARRAY: [[targetAddress]], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function change_member_role_to_any_role_in_list(targetAddressArray: string[]) { | ||
return expression(402, { | ||
UINT256_2DARRAY: [], | ||
STRING_ARRAY: [], | ||
ADDRESS_2DARRAY: [targetAddressArray], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function change_member_role_to_any_role_in_range(startTargetAddress: string, endTargetAddress: string) { | ||
return expression(403, { | ||
UINT256_2DARRAY: [], | ||
STRING_ARRAY: [], | ||
ADDRESS_2DARRAY: [[startTargetAddress, endTargetAddress]], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function change_member_name_to_any_string_in_list(nameList: string[]) { | ||
return expression(406, { | ||
UINT256_2DARRAY: [], | ||
STRING_ARRAY: nameList, | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function change_member_name_to_any_string_contains(subString: string) { | ||
return expression(407, { | ||
UINT256_2DARRAY: [], | ||
STRING_ARRAY: [subString], | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
export { change_member_role_to_any_role_equals, change_member_role_to_any_role_in_list, change_member_role_to_any_role_in_range, change_member_name_to_any_string_in_list, change_member_name_to_any_string_contains }; |
140 changes: 140 additions & 0 deletions
140
darc-js/src/SDK/conditionNodes/Condition_OperationLog.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
import {expression} from "../Node"; | ||
|
||
/** | ||
* Operation log related condition nodes | ||
| 701 | OPERATION_BY_OPERATOR_SINCE_LAST_TIME_GREATER_THAN | uint256 timestamp || | ||
| 702 | OPERATION_BY_OPERATOR_SINCE_LAST_TIME_LESS_THAN | uint256 timestamp || | ||
| 703 | OPERATION_BY_OPERATOR_SINCE_LAST_TIME_IN_RANGE | uint256 startTimestamp, uint256 endTimestamp || | ||
| 704 | OPERATION_GLOBAL_SINCE_LAST_TIME_GREATER_THAN | uint256 timestamp || | ||
| 705 | OPERATION_GLOBAL_SINCE_LAST_TIME_LESS_THAN | uint256 timestamp || | ||
| 706 | OPERATION_GLOBAL_SINCE_LAST_TIME_IN_RANGE | uint256 startTimestamp, uint256 endTimestamp || | ||
| 707 | OPERATION_BY_ANY_ADDRESS_IN_LIST_SINCE_LAST_TIME_GREATER_THAN | address[] addressList, uint256 timestamp || | ||
| 708 | OPERATION_BY_ANY_ADDRESS_IN_LIST_SINCE_LAST_TIME_LESS_THAN | address[] addressList, uint256 timestamp || | ||
| 709 | OPERATION_BY_ANY_ADDRESS_IN_LIST_SINCE_LAST_TIME_IN_RANGE | address[] addressList, uint256 startTimestamp, uint256 endTimestamp || | ||
| 710 | OPERATION_BY_EACH_ADDRESS_IN_LIST_SINCE_LAST_TIME_GREATER_THAN | address[] addressList, uint256 timestamp || | ||
| 711 | OPERATION_BY_EACH_ADDRESS_IN_LIST_SINCE_LAST_TIME_LESS_THAN | address[] addressList, uint256 timestamp || | ||
| 712 | OPERATION_BY_EACH_ADDRESS_IN_LIST_SINCE_LAST_TIME_IN_RANGE | address[] addressList, uint256 startTimestamp, uint256 endTimestamp || | ||
*/ | ||
|
||
function operation_by_operator_since_last_time_greater_than(timestamp: bigint) { | ||
return expression(701, { | ||
UINT256_2DARRAY: [[timestamp]], | ||
STRING_ARRAY: [], | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function operation_by_operator_since_last_time_less_than(timestamp: bigint) { | ||
return expression(702, { | ||
UINT256_2DARRAY: [[timestamp]], | ||
STRING_ARRAY: [], | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function operation_by_operator_since_last_time_in_range(startTimestamp: bigint, endTimestamp: bigint) { | ||
return expression(703, { | ||
UINT256_2DARRAY: [[startTimestamp, endTimestamp]], | ||
STRING_ARRAY: [], | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function operation_global_since_last_time_greater_than(timestamp: bigint) { | ||
return expression(704, { | ||
UINT256_2DARRAY: [[timestamp]], | ||
STRING_ARRAY: [], | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function operation_global_since_last_time_less_than(timestamp: bigint) { | ||
return expression(705, { | ||
UINT256_2DARRAY: [[timestamp]], | ||
STRING_ARRAY: [], | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function operation_global_since_last_time_in_range(startTimestamp: bigint, endTimestamp: bigint) { | ||
return expression(706, { | ||
UINT256_2DARRAY: [[startTimestamp, endTimestamp]], | ||
STRING_ARRAY: [], | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function operation_by_any_address_in_list_since_last_time_greater_than(addressList: string[], timestamp: bigint) { | ||
return expression(707, { | ||
UINT256_2DARRAY: [[timestamp]], | ||
STRING_ARRAY: addressList, | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function operation_by_any_address_in_list_since_last_time_less_than(addressList: string[], timestamp: bigint) { | ||
return expression(708, { | ||
UINT256_2DARRAY: [[timestamp]], | ||
STRING_ARRAY: addressList, | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function operation_by_any_address_in_list_since_last_time_in_range(addressList: string[], startTimestamp: bigint, endTimestamp: bigint) { | ||
return expression(709, { | ||
UINT256_2DARRAY: [[startTimestamp, endTimestamp]], | ||
STRING_ARRAY: addressList, | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function operation_by_each_address_in_list_since_last_time_greater_than(addressList: string[], timestamp: bigint) { | ||
return expression(710, { | ||
UINT256_2DARRAY: [[timestamp]], | ||
STRING_ARRAY: addressList, | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function operation_by_each_address_in_list_since_last_time_less_than(addressList: string[], timestamp: bigint) { | ||
return expression(711, { | ||
UINT256_2DARRAY: [[timestamp]], | ||
STRING_ARRAY: addressList, | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
function operation_by_each_address_in_list_since_last_time_in_range(addressList: string[], startTimestamp: bigint, endTimestamp: bigint) { | ||
return expression(712, { | ||
UINT256_2DARRAY: [[startTimestamp, endTimestamp]], | ||
STRING_ARRAY: addressList, | ||
ADDRESS_2DARRAY: [], | ||
BYTES: [] | ||
}); | ||
} | ||
|
||
export { | ||
operation_by_operator_since_last_time_greater_than, | ||
operation_by_operator_since_last_time_less_than, | ||
operation_by_operator_since_last_time_in_range, | ||
operation_global_since_last_time_greater_than, | ||
operation_global_since_last_time_less_than, | ||
operation_global_since_last_time_in_range, | ||
operation_by_any_address_in_list_since_last_time_greater_than, | ||
operation_by_any_address_in_list_since_last_time_less_than, | ||
operation_by_any_address_in_list_since_last_time_in_range, | ||
operation_by_each_address_in_list_since_last_time_greater_than, | ||
operation_by_each_address_in_list_since_last_time_less_than, | ||
operation_by_each_address_in_list_since_last_time_in_range | ||
}; |
Oops, something went wrong.