@ottochain/sdk 0.2.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 +305 -0
- package/dist/apps/contracts/index.d.ts +21 -0
- package/dist/apps/contracts/index.js +39 -0
- package/dist/apps/contracts/types.d.ts +24 -0
- package/dist/apps/contracts/types.js +48 -0
- package/dist/apps/identity/index.d.ts +22 -0
- package/dist/apps/identity/index.js +40 -0
- package/dist/apps/identity/types.d.ts +30 -0
- package/dist/apps/identity/types.js +53 -0
- package/dist/apps/index.d.ts +29 -0
- package/dist/apps/index.js +60 -0
- package/dist/apps/markets/index.d.ts +26 -0
- package/dist/apps/markets/index.js +46 -0
- package/dist/apps/markets/types.d.ts +185 -0
- package/dist/apps/markets/types.js +252 -0
- package/dist/apps/oracles/index.d.ts +26 -0
- package/dist/apps/oracles/index.js +46 -0
- package/dist/apps/oracles/types.d.ts +211 -0
- package/dist/apps/oracles/types.js +306 -0
- package/dist/cjs/apps/contracts/index.js +60 -0
- package/dist/cjs/apps/contracts/state-machines/contract.json +420 -0
- package/dist/cjs/apps/contracts/state-machines/escrow.json +426 -0
- package/dist/cjs/apps/contracts/types.js +48 -0
- package/dist/cjs/apps/corporate/index.js +112 -0
- package/dist/cjs/apps/corporate/state-machines/corporate-board.json +1064 -0
- package/dist/cjs/apps/corporate/state-machines/corporate-bylaws.json +751 -0
- package/dist/cjs/apps/corporate/state-machines/corporate-committee.json +957 -0
- package/dist/cjs/apps/corporate/state-machines/corporate-compliance.json +1293 -0
- package/dist/cjs/apps/corporate/state-machines/corporate-entity.json +861 -0
- package/dist/cjs/apps/corporate/state-machines/corporate-officers.json +843 -0
- package/dist/cjs/apps/corporate/state-machines/corporate-proxy.json +783 -0
- package/dist/cjs/apps/corporate/state-machines/corporate-resolution.json +1174 -0
- package/dist/cjs/apps/corporate/state-machines/corporate-securities.json +1215 -0
- package/dist/cjs/apps/corporate/state-machines/corporate-shareholders.json +1298 -0
- package/dist/cjs/apps/corporate/types.js +44 -0
- package/dist/cjs/apps/governance/index.js +203 -0
- package/dist/cjs/apps/governance/state-machines/dao-multisig.json +711 -0
- package/dist/cjs/apps/governance/state-machines/dao-single.json +258 -0
- package/dist/cjs/apps/governance/state-machines/dao-threshold.json +660 -0
- package/dist/cjs/apps/governance/state-machines/dao-token.json +680 -0
- package/dist/cjs/apps/governance/state-machines/governance-constitution.json +401 -0
- package/dist/cjs/apps/governance/state-machines/governance-executive.json +441 -0
- package/dist/cjs/apps/governance/state-machines/governance-judiciary.json +626 -0
- package/dist/cjs/apps/governance/state-machines/governance-legislature.json +726 -0
- package/dist/cjs/apps/governance/state-machines/governance-simple.json +679 -0
- package/dist/cjs/apps/governance/types.js +42 -0
- package/dist/cjs/apps/identity/constants.js +58 -0
- package/dist/cjs/apps/identity/index.js +78 -0
- package/dist/cjs/apps/identity/state-machines/agent-identity.json +320 -0
- package/dist/cjs/apps/identity/types.js +53 -0
- package/dist/cjs/apps/index.js +58 -0
- package/dist/cjs/apps/markets/index.js +55 -0
- package/dist/cjs/apps/markets/state-machines/market-universal.json +354 -0
- package/dist/cjs/apps/markets/types.js +219 -0
- package/dist/cjs/apps/oracles/index.js +62 -0
- package/dist/cjs/apps/oracles/state-machines/oracle.json +452 -0
- package/dist/cjs/apps/oracles/types.js +282 -0
- package/dist/cjs/errors.js +293 -0
- package/dist/cjs/generated/google/protobuf/struct.js +514 -0
- package/dist/cjs/generated/google/protobuf/timestamp.js +92 -0
- package/dist/cjs/generated/index.js +150 -0
- package/dist/cjs/generated/ottochain/apps/contracts/v1/contract.js +873 -0
- package/dist/cjs/generated/ottochain/apps/contracts/v1/contract_pb.js +100 -0
- package/dist/cjs/generated/ottochain/apps/corporate/v1/corporate.js +4515 -0
- package/dist/cjs/generated/ottochain/apps/corporate/v1/corporate_pb.js +392 -0
- package/dist/cjs/generated/ottochain/apps/governance/v1/governance.js +3255 -0
- package/dist/cjs/generated/ottochain/apps/governance/v1/governance_pb.js +235 -0
- package/dist/cjs/generated/ottochain/apps/identity/v1/agent.js +619 -0
- package/dist/cjs/generated/ottochain/apps/identity/v1/agent_pb.js +116 -0
- package/dist/cjs/generated/ottochain/apps/identity/v1/attestation.js +780 -0
- package/dist/cjs/generated/ottochain/apps/identity/v1/attestation_pb.js +79 -0
- package/dist/cjs/generated/ottochain/apps/markets/v1/market.js +1261 -0
- package/dist/cjs/generated/ottochain/apps/markets/v1/market_pb.js +151 -0
- package/dist/cjs/generated/ottochain/apps/oracles/v1/oracle.js +1223 -0
- package/dist/cjs/generated/ottochain/apps/oracles/v1/oracle_pb.js +109 -0
- package/dist/cjs/generated/ottochain/v1/common.js +10 -0
- package/dist/cjs/generated/ottochain/v1/common_pb.js +37 -0
- package/dist/cjs/generated/ottochain/v1/fiber.js +1057 -0
- package/dist/cjs/generated/ottochain/v1/fiber_pb.js +86 -0
- package/dist/cjs/generated/ottochain/v1/messages.js +740 -0
- package/dist/cjs/generated/ottochain/v1/messages_pb.js +44 -0
- package/dist/cjs/generated/ottochain/v1/records.js +1253 -0
- package/dist/cjs/generated/ottochain/v1/records_pb.js +44 -0
- package/dist/cjs/index.js +79 -0
- package/dist/cjs/metakit/binary.js +58 -0
- package/dist/cjs/metakit/canonicalize.js +40 -0
- package/dist/cjs/metakit/codec.js +45 -0
- package/dist/cjs/metakit/currency-transaction.js +319 -0
- package/dist/cjs/metakit/currency-types.js +13 -0
- package/dist/cjs/metakit/hash.js +84 -0
- package/dist/cjs/metakit/index.js +74 -0
- package/dist/cjs/metakit/network/client.js +78 -0
- package/dist/cjs/metakit/network/currency-l1-client.js +101 -0
- package/dist/cjs/metakit/network/data-l1-client.js +76 -0
- package/dist/cjs/metakit/network/index.js +16 -0
- package/dist/cjs/metakit/network/types.js +20 -0
- package/dist/cjs/metakit/sign.js +120 -0
- package/dist/cjs/metakit/signed-object.js +100 -0
- package/dist/cjs/metakit/types.js +14 -0
- package/dist/cjs/metakit/verify.js +217 -0
- package/dist/cjs/metakit/wallet.js +127 -0
- package/dist/cjs/ottochain/index.js +47 -0
- package/dist/cjs/ottochain/metagraph-client.js +157 -0
- package/dist/cjs/ottochain/snapshot.js +110 -0
- package/dist/cjs/ottochain/types.js +11 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/types.js +25 -0
- package/dist/cjs/validation.js +312 -0
- package/dist/errors.d.ts +221 -0
- package/dist/errors.js +293 -0
- package/dist/esm/apps/contracts/index.js +42 -0
- package/dist/esm/apps/contracts/state-machines/contract.json +420 -0
- package/dist/esm/apps/contracts/state-machines/escrow.json +426 -0
- package/dist/esm/apps/contracts/types.js +44 -0
- package/dist/esm/apps/corporate/index.js +57 -0
- package/dist/esm/apps/corporate/state-machines/corporate-board.json +1064 -0
- package/dist/esm/apps/corporate/state-machines/corporate-bylaws.json +751 -0
- package/dist/esm/apps/corporate/state-machines/corporate-committee.json +957 -0
- package/dist/esm/apps/corporate/state-machines/corporate-compliance.json +1293 -0
- package/dist/esm/apps/corporate/state-machines/corporate-entity.json +861 -0
- package/dist/esm/apps/corporate/state-machines/corporate-officers.json +843 -0
- package/dist/esm/apps/corporate/state-machines/corporate-proxy.json +783 -0
- package/dist/esm/apps/corporate/state-machines/corporate-resolution.json +1174 -0
- package/dist/esm/apps/corporate/state-machines/corporate-securities.json +1215 -0
- package/dist/esm/apps/corporate/state-machines/corporate-shareholders.json +1298 -0
- package/dist/esm/apps/corporate/types.js +38 -0
- package/dist/esm/apps/governance/index.js +154 -0
- package/dist/esm/apps/governance/state-machines/dao-multisig.json +711 -0
- package/dist/esm/apps/governance/state-machines/dao-single.json +258 -0
- package/dist/esm/apps/governance/state-machines/dao-threshold.json +660 -0
- package/dist/esm/apps/governance/state-machines/dao-token.json +680 -0
- package/dist/esm/apps/governance/state-machines/governance-constitution.json +401 -0
- package/dist/esm/apps/governance/state-machines/governance-executive.json +441 -0
- package/dist/esm/apps/governance/state-machines/governance-judiciary.json +626 -0
- package/dist/esm/apps/governance/state-machines/governance-legislature.json +726 -0
- package/dist/esm/apps/governance/state-machines/governance-simple.json +679 -0
- package/dist/esm/apps/governance/types.js +35 -0
- package/dist/esm/apps/identity/constants.js +53 -0
- package/dist/esm/apps/identity/index.js +50 -0
- package/dist/esm/apps/identity/state-machines/agent-identity.json +320 -0
- package/dist/esm/apps/identity/types.js +50 -0
- package/dist/esm/apps/index.js +32 -0
- package/dist/esm/apps/markets/index.js +34 -0
- package/dist/esm/apps/markets/state-machines/market-universal.json +354 -0
- package/dist/esm/apps/markets/types.js +206 -0
- package/dist/esm/apps/oracles/index.js +42 -0
- package/dist/esm/apps/oracles/state-machines/oracle.json +452 -0
- package/dist/esm/apps/oracles/types.js +267 -0
- package/dist/esm/errors.js +283 -0
- package/dist/esm/generated/google/protobuf/struct.js +508 -0
- package/dist/esm/generated/google/protobuf/timestamp.js +89 -0
- package/dist/esm/generated/index.js +26 -0
- package/dist/esm/generated/ottochain/apps/contracts/v1/contract.js +867 -0
- package/dist/esm/generated/ottochain/apps/contracts/v1/contract_pb.js +97 -0
- package/dist/esm/generated/ottochain/apps/corporate/v1/corporate.js +4493 -0
- package/dist/esm/generated/ottochain/apps/corporate/v1/corporate_pb.js +389 -0
- package/dist/esm/generated/ottochain/apps/governance/v1/governance.js +3240 -0
- package/dist/esm/generated/ottochain/apps/governance/v1/governance_pb.js +232 -0
- package/dist/esm/generated/ottochain/apps/identity/v1/agent.js +610 -0
- package/dist/esm/generated/ottochain/apps/identity/v1/agent_pb.js +113 -0
- package/dist/esm/generated/ottochain/apps/identity/v1/attestation.js +774 -0
- package/dist/esm/generated/ottochain/apps/identity/v1/attestation_pb.js +76 -0
- package/dist/esm/generated/ottochain/apps/markets/v1/market.js +1252 -0
- package/dist/esm/generated/ottochain/apps/markets/v1/market_pb.js +148 -0
- package/dist/esm/generated/ottochain/apps/oracles/v1/oracle.js +1217 -0
- package/dist/esm/generated/ottochain/apps/oracles/v1/oracle_pb.js +106 -0
- package/dist/esm/generated/ottochain/v1/common.js +7 -0
- package/dist/esm/generated/ottochain/v1/common_pb.js +34 -0
- package/dist/esm/generated/ottochain/v1/fiber.js +1051 -0
- package/dist/esm/generated/ottochain/v1/fiber_pb.js +83 -0
- package/dist/esm/generated/ottochain/v1/messages.js +737 -0
- package/dist/esm/generated/ottochain/v1/messages_pb.js +41 -0
- package/dist/esm/generated/ottochain/v1/records.js +1250 -0
- package/dist/esm/generated/ottochain/v1/records_pb.js +41 -0
- package/dist/esm/index.js +33 -0
- package/dist/esm/metakit/binary.js +53 -0
- package/dist/esm/metakit/canonicalize.js +33 -0
- package/dist/esm/metakit/codec.js +38 -0
- package/dist/esm/metakit/currency-transaction.js +306 -0
- package/dist/esm/metakit/currency-types.js +10 -0
- package/dist/esm/metakit/hash.js +77 -0
- package/dist/esm/metakit/index.js +30 -0
- package/dist/esm/metakit/network/client.js +74 -0
- package/dist/esm/metakit/network/currency-l1-client.js +97 -0
- package/dist/esm/metakit/network/data-l1-client.js +72 -0
- package/dist/esm/metakit/network/index.js +9 -0
- package/dist/esm/metakit/network/types.js +16 -0
- package/dist/esm/metakit/sign.js +114 -0
- package/dist/esm/metakit/signed-object.js +94 -0
- package/dist/esm/metakit/types.js +11 -0
- package/dist/esm/metakit/verify.js +210 -0
- package/dist/esm/metakit/wallet.js +117 -0
- package/dist/esm/ottochain/index.js +13 -0
- package/dist/esm/ottochain/metagraph-client.js +153 -0
- package/dist/esm/ottochain/snapshot.js +100 -0
- package/dist/esm/ottochain/types.js +10 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/types.js +20 -0
- package/dist/esm/validation.js +301 -0
- package/dist/generated/index.d.ts +15 -0
- package/dist/generated/index.js +34 -0
- package/dist/generated/ottochain/apps/contracts/v1/contract_pb.d.ts +274 -0
- package/dist/generated/ottochain/apps/contracts/v1/contract_pb.js +100 -0
- package/dist/generated/ottochain/apps/identity/v1/agent_pb.d.ts +211 -0
- package/dist/generated/ottochain/apps/identity/v1/agent_pb.js +116 -0
- package/dist/generated/ottochain/apps/identity/v1/attestation_pb.d.ts +238 -0
- package/dist/generated/ottochain/apps/identity/v1/attestation_pb.js +79 -0
- package/dist/generated/ottochain/apps/markets/v1/market_pb.d.ts +436 -0
- package/dist/generated/ottochain/apps/markets/v1/market_pb.js +151 -0
- package/dist/generated/ottochain/apps/oracles/v1/oracle_pb.d.ts +393 -0
- package/dist/generated/ottochain/apps/oracles/v1/oracle_pb.js +109 -0
- package/dist/generated/ottochain/v1/common_pb.d.ts +86 -0
- package/dist/generated/ottochain/v1/common_pb.js +37 -0
- package/dist/generated/ottochain/v1/fiber_pb.d.ts +292 -0
- package/dist/generated/ottochain/v1/fiber_pb.js +86 -0
- package/dist/generated/ottochain/v1/messages_pb.d.ts +190 -0
- package/dist/generated/ottochain/v1/messages_pb.js +44 -0
- package/dist/generated/ottochain/v1/records_pb.d.ts +221 -0
- package/dist/generated/ottochain/v1/records_pb.js +44 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +77 -0
- package/dist/metakit/binary.d.ts +38 -0
- package/dist/metakit/binary.js +58 -0
- package/dist/metakit/canonicalize.d.ts +26 -0
- package/dist/metakit/canonicalize.js +40 -0
- package/dist/metakit/codec.d.ts +16 -0
- package/dist/metakit/codec.js +45 -0
- package/dist/metakit/currency-transaction.d.ts +157 -0
- package/dist/metakit/currency-transaction.js +319 -0
- package/dist/metakit/currency-types.d.ts +55 -0
- package/dist/metakit/currency-types.js +13 -0
- package/dist/metakit/hash.d.ts +50 -0
- package/dist/metakit/hash.js +84 -0
- package/dist/metakit/index.d.ts +23 -0
- package/dist/metakit/index.js +74 -0
- package/dist/metakit/network/client.d.ts +23 -0
- package/dist/metakit/network/client.js +78 -0
- package/dist/metakit/network/currency-l1-client.d.ts +71 -0
- package/dist/metakit/network/currency-l1-client.js +101 -0
- package/dist/metakit/network/data-l1-client.d.ts +57 -0
- package/dist/metakit/network/data-l1-client.js +76 -0
- package/dist/metakit/network/index.d.ts +10 -0
- package/dist/metakit/network/index.js +16 -0
- package/dist/metakit/network/types.d.ts +74 -0
- package/dist/metakit/network/types.js +20 -0
- package/dist/metakit/sign.d.ts +65 -0
- package/dist/metakit/sign.js +120 -0
- package/dist/metakit/signed-object.d.ts +66 -0
- package/dist/metakit/signed-object.js +100 -0
- package/dist/metakit/types.d.ts +67 -0
- package/dist/metakit/types.js +14 -0
- package/dist/metakit/verify.d.ts +55 -0
- package/dist/metakit/verify.js +217 -0
- package/dist/metakit/wallet.d.ts +70 -0
- package/dist/metakit/wallet.js +127 -0
- package/dist/ottochain/index.d.ts +13 -0
- package/dist/ottochain/index.js +45 -0
- package/dist/ottochain/metagraph-client.d.ts +111 -0
- package/dist/ottochain/metagraph-client.js +157 -0
- package/dist/ottochain/snapshot.d.ts +86 -0
- package/dist/ottochain/snapshot.js +110 -0
- package/dist/ottochain/types.d.ts +278 -0
- package/dist/ottochain/types.js +11 -0
- package/dist/types/apps/contracts/index.d.ts +30 -0
- package/dist/types/apps/contracts/types.d.ts +24 -0
- package/dist/types/apps/corporate/index.d.ts +27 -0
- package/dist/types/apps/corporate/types.d.ts +9861 -0
- package/dist/types/apps/governance/index.d.ts +77 -0
- package/dist/types/apps/governance/types.d.ts +344 -0
- package/dist/types/apps/identity/constants.d.ts +27 -0
- package/dist/types/apps/identity/index.d.ts +39 -0
- package/dist/types/apps/identity/types.d.ts +30 -0
- package/dist/types/apps/index.d.ts +31 -0
- package/dist/types/apps/markets/index.d.ts +26 -0
- package/dist/types/apps/markets/types.d.ts +155 -0
- package/dist/types/apps/oracles/index.d.ts +34 -0
- package/dist/types/apps/oracles/types.d.ts +193 -0
- package/dist/types/errors.d.ts +221 -0
- package/dist/types/generated/google/protobuf/struct.d.ts +134 -0
- package/dist/types/generated/google/protobuf/timestamp.d.ts +134 -0
- package/dist/types/generated/index.d.ts +18 -0
- package/dist/types/generated/ottochain/apps/contracts/v1/contract.d.ts +112 -0
- package/dist/types/generated/ottochain/apps/contracts/v1/contract_pb.d.ts +274 -0
- package/dist/types/generated/ottochain/apps/corporate/v1/corporate.d.ts +376 -0
- package/dist/types/generated/ottochain/apps/corporate/v1/corporate_pb.d.ts +1172 -0
- package/dist/types/generated/ottochain/apps/governance/v1/governance.d.ts +296 -0
- package/dist/types/generated/ottochain/apps/governance/v1/governance_pb.d.ts +772 -0
- package/dist/types/generated/ottochain/apps/identity/v1/agent.d.ts +94 -0
- package/dist/types/generated/ottochain/apps/identity/v1/agent_pb.d.ts +211 -0
- package/dist/types/generated/ottochain/apps/identity/v1/attestation.d.ts +102 -0
- package/dist/types/generated/ottochain/apps/identity/v1/attestation_pb.d.ts +238 -0
- package/dist/types/generated/ottochain/apps/markets/v1/market.d.ts +174 -0
- package/dist/types/generated/ottochain/apps/markets/v1/market_pb.d.ts +436 -0
- package/dist/types/generated/ottochain/apps/oracles/v1/oracle.d.ts +150 -0
- package/dist/types/generated/ottochain/apps/oracles/v1/oracle_pb.d.ts +393 -0
- package/dist/types/generated/ottochain/v1/common.d.ts +1 -0
- package/dist/types/generated/ottochain/v1/common_pb.d.ts +86 -0
- package/dist/types/generated/ottochain/v1/fiber.d.ts +130 -0
- package/dist/types/generated/ottochain/v1/fiber_pb.d.ts +292 -0
- package/dist/types/generated/ottochain/v1/messages.d.ts +89 -0
- package/dist/types/generated/ottochain/v1/messages_pb.d.ts +190 -0
- package/dist/types/generated/ottochain/v1/records.d.ts +128 -0
- package/dist/types/generated/ottochain/v1/records_pb.d.ts +221 -0
- package/dist/types/index.d.ts +22 -0
- package/dist/types/metakit/binary.d.ts +38 -0
- package/dist/types/metakit/canonicalize.d.ts +26 -0
- package/dist/types/metakit/codec.d.ts +16 -0
- package/dist/types/metakit/currency-transaction.d.ts +157 -0
- package/dist/types/metakit/currency-types.d.ts +55 -0
- package/dist/types/metakit/hash.d.ts +50 -0
- package/dist/types/metakit/index.d.ts +23 -0
- package/dist/types/metakit/network/client.d.ts +23 -0
- package/dist/types/metakit/network/currency-l1-client.d.ts +71 -0
- package/dist/types/metakit/network/data-l1-client.d.ts +57 -0
- package/dist/types/metakit/network/index.d.ts +10 -0
- package/dist/types/metakit/network/types.d.ts +74 -0
- package/dist/types/metakit/sign.d.ts +65 -0
- package/dist/types/metakit/signed-object.d.ts +66 -0
- package/dist/types/metakit/types.d.ts +67 -0
- package/dist/types/metakit/verify.d.ts +55 -0
- package/dist/types/metakit/wallet.d.ts +70 -0
- package/dist/types/ottochain/index.d.ts +13 -0
- package/dist/types/ottochain/metagraph-client.d.ts +111 -0
- package/dist/types/ottochain/snapshot.d.ts +86 -0
- package/dist/types/ottochain/types.d.ts +210 -0
- package/dist/types/types.d.ts +51 -0
- package/dist/types/validation.d.ts +449 -0
- package/dist/validation.d.ts +449 -0
- package/dist/validation.js +312 -0
- package/package.json +136 -0
|
@@ -0,0 +1,3240 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.2
|
|
4
|
+
// protoc unknown
|
|
5
|
+
// source: ottochain/apps/governance/v1/governance.proto
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
8
|
+
import { Struct } from "../../../../google/protobuf/struct.js";
|
|
9
|
+
import { Timestamp } from "../../../../google/protobuf/timestamp.js";
|
|
10
|
+
export const protobufPackage = "ottochain.apps.governance.v1";
|
|
11
|
+
/** Type of DAO governance model */
|
|
12
|
+
export var DAOType;
|
|
13
|
+
(function (DAOType) {
|
|
14
|
+
DAOType["DAO_TYPE_UNSPECIFIED"] = "DAO_TYPE_UNSPECIFIED";
|
|
15
|
+
/** DAO_TYPE_SINGLE - Single owner controls all actions */
|
|
16
|
+
DAOType["DAO_TYPE_SINGLE"] = "DAO_TYPE_SINGLE";
|
|
17
|
+
/** DAO_TYPE_MULTISIG - N-of-M signatures required */
|
|
18
|
+
DAOType["DAO_TYPE_MULTISIG"] = "DAO_TYPE_MULTISIG";
|
|
19
|
+
/** DAO_TYPE_TOKEN - Token-weighted voting */
|
|
20
|
+
DAOType["DAO_TYPE_TOKEN"] = "DAO_TYPE_TOKEN";
|
|
21
|
+
/** DAO_TYPE_THRESHOLD - Reputation threshold for participation */
|
|
22
|
+
DAOType["DAO_TYPE_THRESHOLD"] = "DAO_TYPE_THRESHOLD";
|
|
23
|
+
DAOType["UNRECOGNIZED"] = "UNRECOGNIZED";
|
|
24
|
+
})(DAOType || (DAOType = {}));
|
|
25
|
+
export function dAOTypeFromJSON(object) {
|
|
26
|
+
switch (object) {
|
|
27
|
+
case 0:
|
|
28
|
+
case "DAO_TYPE_UNSPECIFIED":
|
|
29
|
+
return DAOType.DAO_TYPE_UNSPECIFIED;
|
|
30
|
+
case 1:
|
|
31
|
+
case "DAO_TYPE_SINGLE":
|
|
32
|
+
return DAOType.DAO_TYPE_SINGLE;
|
|
33
|
+
case 2:
|
|
34
|
+
case "DAO_TYPE_MULTISIG":
|
|
35
|
+
return DAOType.DAO_TYPE_MULTISIG;
|
|
36
|
+
case 3:
|
|
37
|
+
case "DAO_TYPE_TOKEN":
|
|
38
|
+
return DAOType.DAO_TYPE_TOKEN;
|
|
39
|
+
case 4:
|
|
40
|
+
case "DAO_TYPE_THRESHOLD":
|
|
41
|
+
return DAOType.DAO_TYPE_THRESHOLD;
|
|
42
|
+
case -1:
|
|
43
|
+
case "UNRECOGNIZED":
|
|
44
|
+
default:
|
|
45
|
+
return DAOType.UNRECOGNIZED;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export function dAOTypeToJSON(object) {
|
|
49
|
+
switch (object) {
|
|
50
|
+
case DAOType.DAO_TYPE_UNSPECIFIED:
|
|
51
|
+
return "DAO_TYPE_UNSPECIFIED";
|
|
52
|
+
case DAOType.DAO_TYPE_SINGLE:
|
|
53
|
+
return "DAO_TYPE_SINGLE";
|
|
54
|
+
case DAOType.DAO_TYPE_MULTISIG:
|
|
55
|
+
return "DAO_TYPE_MULTISIG";
|
|
56
|
+
case DAOType.DAO_TYPE_TOKEN:
|
|
57
|
+
return "DAO_TYPE_TOKEN";
|
|
58
|
+
case DAOType.DAO_TYPE_THRESHOLD:
|
|
59
|
+
return "DAO_TYPE_THRESHOLD";
|
|
60
|
+
case DAOType.UNRECOGNIZED:
|
|
61
|
+
default:
|
|
62
|
+
return "UNRECOGNIZED";
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export function dAOTypeToNumber(object) {
|
|
66
|
+
switch (object) {
|
|
67
|
+
case DAOType.DAO_TYPE_UNSPECIFIED:
|
|
68
|
+
return 0;
|
|
69
|
+
case DAOType.DAO_TYPE_SINGLE:
|
|
70
|
+
return 1;
|
|
71
|
+
case DAOType.DAO_TYPE_MULTISIG:
|
|
72
|
+
return 2;
|
|
73
|
+
case DAOType.DAO_TYPE_TOKEN:
|
|
74
|
+
return 3;
|
|
75
|
+
case DAOType.DAO_TYPE_THRESHOLD:
|
|
76
|
+
return 4;
|
|
77
|
+
case DAOType.UNRECOGNIZED:
|
|
78
|
+
default:
|
|
79
|
+
return -1;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/** DAO lifecycle status */
|
|
83
|
+
export var DAOStatus;
|
|
84
|
+
(function (DAOStatus) {
|
|
85
|
+
DAOStatus["DAO_STATUS_UNSPECIFIED"] = "DAO_STATUS_UNSPECIFIED";
|
|
86
|
+
DAOStatus["DAO_STATUS_ACTIVE"] = "DAO_STATUS_ACTIVE";
|
|
87
|
+
DAOStatus["DAO_STATUS_DISSOLVED"] = "DAO_STATUS_DISSOLVED";
|
|
88
|
+
DAOStatus["UNRECOGNIZED"] = "UNRECOGNIZED";
|
|
89
|
+
})(DAOStatus || (DAOStatus = {}));
|
|
90
|
+
export function dAOStatusFromJSON(object) {
|
|
91
|
+
switch (object) {
|
|
92
|
+
case 0:
|
|
93
|
+
case "DAO_STATUS_UNSPECIFIED":
|
|
94
|
+
return DAOStatus.DAO_STATUS_UNSPECIFIED;
|
|
95
|
+
case 1:
|
|
96
|
+
case "DAO_STATUS_ACTIVE":
|
|
97
|
+
return DAOStatus.DAO_STATUS_ACTIVE;
|
|
98
|
+
case 2:
|
|
99
|
+
case "DAO_STATUS_DISSOLVED":
|
|
100
|
+
return DAOStatus.DAO_STATUS_DISSOLVED;
|
|
101
|
+
case -1:
|
|
102
|
+
case "UNRECOGNIZED":
|
|
103
|
+
default:
|
|
104
|
+
return DAOStatus.UNRECOGNIZED;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
export function dAOStatusToJSON(object) {
|
|
108
|
+
switch (object) {
|
|
109
|
+
case DAOStatus.DAO_STATUS_UNSPECIFIED:
|
|
110
|
+
return "DAO_STATUS_UNSPECIFIED";
|
|
111
|
+
case DAOStatus.DAO_STATUS_ACTIVE:
|
|
112
|
+
return "DAO_STATUS_ACTIVE";
|
|
113
|
+
case DAOStatus.DAO_STATUS_DISSOLVED:
|
|
114
|
+
return "DAO_STATUS_DISSOLVED";
|
|
115
|
+
case DAOStatus.UNRECOGNIZED:
|
|
116
|
+
default:
|
|
117
|
+
return "UNRECOGNIZED";
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
export function dAOStatusToNumber(object) {
|
|
121
|
+
switch (object) {
|
|
122
|
+
case DAOStatus.DAO_STATUS_UNSPECIFIED:
|
|
123
|
+
return 0;
|
|
124
|
+
case DAOStatus.DAO_STATUS_ACTIVE:
|
|
125
|
+
return 1;
|
|
126
|
+
case DAOStatus.DAO_STATUS_DISSOLVED:
|
|
127
|
+
return 2;
|
|
128
|
+
case DAOStatus.UNRECOGNIZED:
|
|
129
|
+
default:
|
|
130
|
+
return -1;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/** Proposal status for voting DAOs */
|
|
134
|
+
export var ProposalStatus;
|
|
135
|
+
(function (ProposalStatus) {
|
|
136
|
+
ProposalStatus["PROPOSAL_STATUS_UNSPECIFIED"] = "PROPOSAL_STATUS_UNSPECIFIED";
|
|
137
|
+
ProposalStatus["PROPOSAL_STATUS_PENDING"] = "PROPOSAL_STATUS_PENDING";
|
|
138
|
+
ProposalStatus["PROPOSAL_STATUS_VOTING"] = "PROPOSAL_STATUS_VOTING";
|
|
139
|
+
ProposalStatus["PROPOSAL_STATUS_QUEUED"] = "PROPOSAL_STATUS_QUEUED";
|
|
140
|
+
ProposalStatus["PROPOSAL_STATUS_EXECUTED"] = "PROPOSAL_STATUS_EXECUTED";
|
|
141
|
+
ProposalStatus["PROPOSAL_STATUS_REJECTED"] = "PROPOSAL_STATUS_REJECTED";
|
|
142
|
+
ProposalStatus["PROPOSAL_STATUS_CANCELLED"] = "PROPOSAL_STATUS_CANCELLED";
|
|
143
|
+
ProposalStatus["UNRECOGNIZED"] = "UNRECOGNIZED";
|
|
144
|
+
})(ProposalStatus || (ProposalStatus = {}));
|
|
145
|
+
export function proposalStatusFromJSON(object) {
|
|
146
|
+
switch (object) {
|
|
147
|
+
case 0:
|
|
148
|
+
case "PROPOSAL_STATUS_UNSPECIFIED":
|
|
149
|
+
return ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED;
|
|
150
|
+
case 1:
|
|
151
|
+
case "PROPOSAL_STATUS_PENDING":
|
|
152
|
+
return ProposalStatus.PROPOSAL_STATUS_PENDING;
|
|
153
|
+
case 2:
|
|
154
|
+
case "PROPOSAL_STATUS_VOTING":
|
|
155
|
+
return ProposalStatus.PROPOSAL_STATUS_VOTING;
|
|
156
|
+
case 3:
|
|
157
|
+
case "PROPOSAL_STATUS_QUEUED":
|
|
158
|
+
return ProposalStatus.PROPOSAL_STATUS_QUEUED;
|
|
159
|
+
case 4:
|
|
160
|
+
case "PROPOSAL_STATUS_EXECUTED":
|
|
161
|
+
return ProposalStatus.PROPOSAL_STATUS_EXECUTED;
|
|
162
|
+
case 5:
|
|
163
|
+
case "PROPOSAL_STATUS_REJECTED":
|
|
164
|
+
return ProposalStatus.PROPOSAL_STATUS_REJECTED;
|
|
165
|
+
case 6:
|
|
166
|
+
case "PROPOSAL_STATUS_CANCELLED":
|
|
167
|
+
return ProposalStatus.PROPOSAL_STATUS_CANCELLED;
|
|
168
|
+
case -1:
|
|
169
|
+
case "UNRECOGNIZED":
|
|
170
|
+
default:
|
|
171
|
+
return ProposalStatus.UNRECOGNIZED;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
export function proposalStatusToJSON(object) {
|
|
175
|
+
switch (object) {
|
|
176
|
+
case ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED:
|
|
177
|
+
return "PROPOSAL_STATUS_UNSPECIFIED";
|
|
178
|
+
case ProposalStatus.PROPOSAL_STATUS_PENDING:
|
|
179
|
+
return "PROPOSAL_STATUS_PENDING";
|
|
180
|
+
case ProposalStatus.PROPOSAL_STATUS_VOTING:
|
|
181
|
+
return "PROPOSAL_STATUS_VOTING";
|
|
182
|
+
case ProposalStatus.PROPOSAL_STATUS_QUEUED:
|
|
183
|
+
return "PROPOSAL_STATUS_QUEUED";
|
|
184
|
+
case ProposalStatus.PROPOSAL_STATUS_EXECUTED:
|
|
185
|
+
return "PROPOSAL_STATUS_EXECUTED";
|
|
186
|
+
case ProposalStatus.PROPOSAL_STATUS_REJECTED:
|
|
187
|
+
return "PROPOSAL_STATUS_REJECTED";
|
|
188
|
+
case ProposalStatus.PROPOSAL_STATUS_CANCELLED:
|
|
189
|
+
return "PROPOSAL_STATUS_CANCELLED";
|
|
190
|
+
case ProposalStatus.UNRECOGNIZED:
|
|
191
|
+
default:
|
|
192
|
+
return "UNRECOGNIZED";
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
export function proposalStatusToNumber(object) {
|
|
196
|
+
switch (object) {
|
|
197
|
+
case ProposalStatus.PROPOSAL_STATUS_UNSPECIFIED:
|
|
198
|
+
return 0;
|
|
199
|
+
case ProposalStatus.PROPOSAL_STATUS_PENDING:
|
|
200
|
+
return 1;
|
|
201
|
+
case ProposalStatus.PROPOSAL_STATUS_VOTING:
|
|
202
|
+
return 2;
|
|
203
|
+
case ProposalStatus.PROPOSAL_STATUS_QUEUED:
|
|
204
|
+
return 3;
|
|
205
|
+
case ProposalStatus.PROPOSAL_STATUS_EXECUTED:
|
|
206
|
+
return 4;
|
|
207
|
+
case ProposalStatus.PROPOSAL_STATUS_REJECTED:
|
|
208
|
+
return 5;
|
|
209
|
+
case ProposalStatus.PROPOSAL_STATUS_CANCELLED:
|
|
210
|
+
return 6;
|
|
211
|
+
case ProposalStatus.UNRECOGNIZED:
|
|
212
|
+
default:
|
|
213
|
+
return -1;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/** Vote choice */
|
|
217
|
+
export var VoteChoice;
|
|
218
|
+
(function (VoteChoice) {
|
|
219
|
+
VoteChoice["VOTE_CHOICE_UNSPECIFIED"] = "VOTE_CHOICE_UNSPECIFIED";
|
|
220
|
+
VoteChoice["VOTE_CHOICE_FOR"] = "VOTE_CHOICE_FOR";
|
|
221
|
+
VoteChoice["VOTE_CHOICE_AGAINST"] = "VOTE_CHOICE_AGAINST";
|
|
222
|
+
VoteChoice["VOTE_CHOICE_ABSTAIN"] = "VOTE_CHOICE_ABSTAIN";
|
|
223
|
+
VoteChoice["UNRECOGNIZED"] = "UNRECOGNIZED";
|
|
224
|
+
})(VoteChoice || (VoteChoice = {}));
|
|
225
|
+
export function voteChoiceFromJSON(object) {
|
|
226
|
+
switch (object) {
|
|
227
|
+
case 0:
|
|
228
|
+
case "VOTE_CHOICE_UNSPECIFIED":
|
|
229
|
+
return VoteChoice.VOTE_CHOICE_UNSPECIFIED;
|
|
230
|
+
case 1:
|
|
231
|
+
case "VOTE_CHOICE_FOR":
|
|
232
|
+
return VoteChoice.VOTE_CHOICE_FOR;
|
|
233
|
+
case 2:
|
|
234
|
+
case "VOTE_CHOICE_AGAINST":
|
|
235
|
+
return VoteChoice.VOTE_CHOICE_AGAINST;
|
|
236
|
+
case 3:
|
|
237
|
+
case "VOTE_CHOICE_ABSTAIN":
|
|
238
|
+
return VoteChoice.VOTE_CHOICE_ABSTAIN;
|
|
239
|
+
case -1:
|
|
240
|
+
case "UNRECOGNIZED":
|
|
241
|
+
default:
|
|
242
|
+
return VoteChoice.UNRECOGNIZED;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
export function voteChoiceToJSON(object) {
|
|
246
|
+
switch (object) {
|
|
247
|
+
case VoteChoice.VOTE_CHOICE_UNSPECIFIED:
|
|
248
|
+
return "VOTE_CHOICE_UNSPECIFIED";
|
|
249
|
+
case VoteChoice.VOTE_CHOICE_FOR:
|
|
250
|
+
return "VOTE_CHOICE_FOR";
|
|
251
|
+
case VoteChoice.VOTE_CHOICE_AGAINST:
|
|
252
|
+
return "VOTE_CHOICE_AGAINST";
|
|
253
|
+
case VoteChoice.VOTE_CHOICE_ABSTAIN:
|
|
254
|
+
return "VOTE_CHOICE_ABSTAIN";
|
|
255
|
+
case VoteChoice.UNRECOGNIZED:
|
|
256
|
+
default:
|
|
257
|
+
return "UNRECOGNIZED";
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
export function voteChoiceToNumber(object) {
|
|
261
|
+
switch (object) {
|
|
262
|
+
case VoteChoice.VOTE_CHOICE_UNSPECIFIED:
|
|
263
|
+
return 0;
|
|
264
|
+
case VoteChoice.VOTE_CHOICE_FOR:
|
|
265
|
+
return 1;
|
|
266
|
+
case VoteChoice.VOTE_CHOICE_AGAINST:
|
|
267
|
+
return 2;
|
|
268
|
+
case VoteChoice.VOTE_CHOICE_ABSTAIN:
|
|
269
|
+
return 3;
|
|
270
|
+
case VoteChoice.UNRECOGNIZED:
|
|
271
|
+
default:
|
|
272
|
+
return -1;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
function createBaseDAOMetadata() {
|
|
276
|
+
return { description: "", website: "", logo: "", extra: undefined };
|
|
277
|
+
}
|
|
278
|
+
export const DAOMetadata = {
|
|
279
|
+
encode(message, writer = new BinaryWriter()) {
|
|
280
|
+
if (message.description !== "") {
|
|
281
|
+
writer.uint32(10).string(message.description);
|
|
282
|
+
}
|
|
283
|
+
if (message.website !== "") {
|
|
284
|
+
writer.uint32(18).string(message.website);
|
|
285
|
+
}
|
|
286
|
+
if (message.logo !== "") {
|
|
287
|
+
writer.uint32(26).string(message.logo);
|
|
288
|
+
}
|
|
289
|
+
if (message.extra !== undefined) {
|
|
290
|
+
Struct.encode(Struct.wrap(message.extra), writer.uint32(34).fork()).join();
|
|
291
|
+
}
|
|
292
|
+
return writer;
|
|
293
|
+
},
|
|
294
|
+
decode(input, length) {
|
|
295
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
296
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
297
|
+
const message = createBaseDAOMetadata();
|
|
298
|
+
while (reader.pos < end) {
|
|
299
|
+
const tag = reader.uint32();
|
|
300
|
+
switch (tag >>> 3) {
|
|
301
|
+
case 1: {
|
|
302
|
+
if (tag !== 10) {
|
|
303
|
+
break;
|
|
304
|
+
}
|
|
305
|
+
message.description = reader.string();
|
|
306
|
+
continue;
|
|
307
|
+
}
|
|
308
|
+
case 2: {
|
|
309
|
+
if (tag !== 18) {
|
|
310
|
+
break;
|
|
311
|
+
}
|
|
312
|
+
message.website = reader.string();
|
|
313
|
+
continue;
|
|
314
|
+
}
|
|
315
|
+
case 3: {
|
|
316
|
+
if (tag !== 26) {
|
|
317
|
+
break;
|
|
318
|
+
}
|
|
319
|
+
message.logo = reader.string();
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
case 4: {
|
|
323
|
+
if (tag !== 34) {
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
326
|
+
message.extra = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
331
|
+
break;
|
|
332
|
+
}
|
|
333
|
+
reader.skip(tag & 7);
|
|
334
|
+
}
|
|
335
|
+
return message;
|
|
336
|
+
},
|
|
337
|
+
fromJSON(object) {
|
|
338
|
+
return {
|
|
339
|
+
description: isSet(object.description) ? globalThis.String(object.description) : "",
|
|
340
|
+
website: isSet(object.website) ? globalThis.String(object.website) : "",
|
|
341
|
+
logo: isSet(object.logo) ? globalThis.String(object.logo) : "",
|
|
342
|
+
extra: isObject(object.extra) ? object.extra : undefined,
|
|
343
|
+
};
|
|
344
|
+
},
|
|
345
|
+
toJSON(message) {
|
|
346
|
+
const obj = {};
|
|
347
|
+
if (message.description !== "") {
|
|
348
|
+
obj.description = message.description;
|
|
349
|
+
}
|
|
350
|
+
if (message.website !== "") {
|
|
351
|
+
obj.website = message.website;
|
|
352
|
+
}
|
|
353
|
+
if (message.logo !== "") {
|
|
354
|
+
obj.logo = message.logo;
|
|
355
|
+
}
|
|
356
|
+
if (message.extra !== undefined) {
|
|
357
|
+
obj.extra = message.extra;
|
|
358
|
+
}
|
|
359
|
+
return obj;
|
|
360
|
+
},
|
|
361
|
+
create(base) {
|
|
362
|
+
return DAOMetadata.fromPartial(base ?? {});
|
|
363
|
+
},
|
|
364
|
+
fromPartial(object) {
|
|
365
|
+
const message = createBaseDAOMetadata();
|
|
366
|
+
message.description = object.description ?? "";
|
|
367
|
+
message.website = object.website ?? "";
|
|
368
|
+
message.logo = object.logo ?? "";
|
|
369
|
+
message.extra = object.extra ?? undefined;
|
|
370
|
+
return message;
|
|
371
|
+
},
|
|
372
|
+
};
|
|
373
|
+
function createBaseProposal() {
|
|
374
|
+
return {
|
|
375
|
+
id: "",
|
|
376
|
+
title: "",
|
|
377
|
+
description: "",
|
|
378
|
+
actionType: "",
|
|
379
|
+
payload: undefined,
|
|
380
|
+
proposer: "",
|
|
381
|
+
proposedAt: undefined,
|
|
382
|
+
deadline: undefined,
|
|
383
|
+
queuedAt: undefined,
|
|
384
|
+
executableAt: undefined,
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
export const Proposal = {
|
|
388
|
+
encode(message, writer = new BinaryWriter()) {
|
|
389
|
+
if (message.id !== "") {
|
|
390
|
+
writer.uint32(10).string(message.id);
|
|
391
|
+
}
|
|
392
|
+
if (message.title !== "") {
|
|
393
|
+
writer.uint32(18).string(message.title);
|
|
394
|
+
}
|
|
395
|
+
if (message.description !== "") {
|
|
396
|
+
writer.uint32(26).string(message.description);
|
|
397
|
+
}
|
|
398
|
+
if (message.actionType !== "") {
|
|
399
|
+
writer.uint32(34).string(message.actionType);
|
|
400
|
+
}
|
|
401
|
+
if (message.payload !== undefined) {
|
|
402
|
+
Struct.encode(Struct.wrap(message.payload), writer.uint32(42).fork()).join();
|
|
403
|
+
}
|
|
404
|
+
if (message.proposer !== "") {
|
|
405
|
+
writer.uint32(50).string(message.proposer);
|
|
406
|
+
}
|
|
407
|
+
if (message.proposedAt !== undefined) {
|
|
408
|
+
Timestamp.encode(toTimestamp(message.proposedAt), writer.uint32(58).fork()).join();
|
|
409
|
+
}
|
|
410
|
+
if (message.deadline !== undefined) {
|
|
411
|
+
Timestamp.encode(toTimestamp(message.deadline), writer.uint32(66).fork()).join();
|
|
412
|
+
}
|
|
413
|
+
if (message.queuedAt !== undefined) {
|
|
414
|
+
Timestamp.encode(toTimestamp(message.queuedAt), writer.uint32(74).fork()).join();
|
|
415
|
+
}
|
|
416
|
+
if (message.executableAt !== undefined) {
|
|
417
|
+
Timestamp.encode(toTimestamp(message.executableAt), writer.uint32(82).fork()).join();
|
|
418
|
+
}
|
|
419
|
+
return writer;
|
|
420
|
+
},
|
|
421
|
+
decode(input, length) {
|
|
422
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
423
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
424
|
+
const message = createBaseProposal();
|
|
425
|
+
while (reader.pos < end) {
|
|
426
|
+
const tag = reader.uint32();
|
|
427
|
+
switch (tag >>> 3) {
|
|
428
|
+
case 1: {
|
|
429
|
+
if (tag !== 10) {
|
|
430
|
+
break;
|
|
431
|
+
}
|
|
432
|
+
message.id = reader.string();
|
|
433
|
+
continue;
|
|
434
|
+
}
|
|
435
|
+
case 2: {
|
|
436
|
+
if (tag !== 18) {
|
|
437
|
+
break;
|
|
438
|
+
}
|
|
439
|
+
message.title = reader.string();
|
|
440
|
+
continue;
|
|
441
|
+
}
|
|
442
|
+
case 3: {
|
|
443
|
+
if (tag !== 26) {
|
|
444
|
+
break;
|
|
445
|
+
}
|
|
446
|
+
message.description = reader.string();
|
|
447
|
+
continue;
|
|
448
|
+
}
|
|
449
|
+
case 4: {
|
|
450
|
+
if (tag !== 34) {
|
|
451
|
+
break;
|
|
452
|
+
}
|
|
453
|
+
message.actionType = reader.string();
|
|
454
|
+
continue;
|
|
455
|
+
}
|
|
456
|
+
case 5: {
|
|
457
|
+
if (tag !== 42) {
|
|
458
|
+
break;
|
|
459
|
+
}
|
|
460
|
+
message.payload = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
461
|
+
continue;
|
|
462
|
+
}
|
|
463
|
+
case 6: {
|
|
464
|
+
if (tag !== 50) {
|
|
465
|
+
break;
|
|
466
|
+
}
|
|
467
|
+
message.proposer = reader.string();
|
|
468
|
+
continue;
|
|
469
|
+
}
|
|
470
|
+
case 7: {
|
|
471
|
+
if (tag !== 58) {
|
|
472
|
+
break;
|
|
473
|
+
}
|
|
474
|
+
message.proposedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
475
|
+
continue;
|
|
476
|
+
}
|
|
477
|
+
case 8: {
|
|
478
|
+
if (tag !== 66) {
|
|
479
|
+
break;
|
|
480
|
+
}
|
|
481
|
+
message.deadline = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
482
|
+
continue;
|
|
483
|
+
}
|
|
484
|
+
case 9: {
|
|
485
|
+
if (tag !== 74) {
|
|
486
|
+
break;
|
|
487
|
+
}
|
|
488
|
+
message.queuedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
489
|
+
continue;
|
|
490
|
+
}
|
|
491
|
+
case 10: {
|
|
492
|
+
if (tag !== 82) {
|
|
493
|
+
break;
|
|
494
|
+
}
|
|
495
|
+
message.executableAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
496
|
+
continue;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
500
|
+
break;
|
|
501
|
+
}
|
|
502
|
+
reader.skip(tag & 7);
|
|
503
|
+
}
|
|
504
|
+
return message;
|
|
505
|
+
},
|
|
506
|
+
fromJSON(object) {
|
|
507
|
+
return {
|
|
508
|
+
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
509
|
+
title: isSet(object.title) ? globalThis.String(object.title) : "",
|
|
510
|
+
description: isSet(object.description) ? globalThis.String(object.description) : "",
|
|
511
|
+
actionType: isSet(object.actionType)
|
|
512
|
+
? globalThis.String(object.actionType)
|
|
513
|
+
: isSet(object.action_type)
|
|
514
|
+
? globalThis.String(object.action_type)
|
|
515
|
+
: "",
|
|
516
|
+
payload: isObject(object.payload) ? object.payload : undefined,
|
|
517
|
+
proposer: isSet(object.proposer) ? globalThis.String(object.proposer) : "",
|
|
518
|
+
proposedAt: isSet(object.proposedAt)
|
|
519
|
+
? fromJsonTimestamp(object.proposedAt)
|
|
520
|
+
: isSet(object.proposed_at)
|
|
521
|
+
? fromJsonTimestamp(object.proposed_at)
|
|
522
|
+
: undefined,
|
|
523
|
+
deadline: isSet(object.deadline) ? fromJsonTimestamp(object.deadline) : undefined,
|
|
524
|
+
queuedAt: isSet(object.queuedAt)
|
|
525
|
+
? fromJsonTimestamp(object.queuedAt)
|
|
526
|
+
: isSet(object.queued_at)
|
|
527
|
+
? fromJsonTimestamp(object.queued_at)
|
|
528
|
+
: undefined,
|
|
529
|
+
executableAt: isSet(object.executableAt)
|
|
530
|
+
? fromJsonTimestamp(object.executableAt)
|
|
531
|
+
: isSet(object.executable_at)
|
|
532
|
+
? fromJsonTimestamp(object.executable_at)
|
|
533
|
+
: undefined,
|
|
534
|
+
};
|
|
535
|
+
},
|
|
536
|
+
toJSON(message) {
|
|
537
|
+
const obj = {};
|
|
538
|
+
if (message.id !== "") {
|
|
539
|
+
obj.id = message.id;
|
|
540
|
+
}
|
|
541
|
+
if (message.title !== "") {
|
|
542
|
+
obj.title = message.title;
|
|
543
|
+
}
|
|
544
|
+
if (message.description !== "") {
|
|
545
|
+
obj.description = message.description;
|
|
546
|
+
}
|
|
547
|
+
if (message.actionType !== "") {
|
|
548
|
+
obj.actionType = message.actionType;
|
|
549
|
+
}
|
|
550
|
+
if (message.payload !== undefined) {
|
|
551
|
+
obj.payload = message.payload;
|
|
552
|
+
}
|
|
553
|
+
if (message.proposer !== "") {
|
|
554
|
+
obj.proposer = message.proposer;
|
|
555
|
+
}
|
|
556
|
+
if (message.proposedAt !== undefined) {
|
|
557
|
+
obj.proposedAt = message.proposedAt.toISOString();
|
|
558
|
+
}
|
|
559
|
+
if (message.deadline !== undefined) {
|
|
560
|
+
obj.deadline = message.deadline.toISOString();
|
|
561
|
+
}
|
|
562
|
+
if (message.queuedAt !== undefined) {
|
|
563
|
+
obj.queuedAt = message.queuedAt.toISOString();
|
|
564
|
+
}
|
|
565
|
+
if (message.executableAt !== undefined) {
|
|
566
|
+
obj.executableAt = message.executableAt.toISOString();
|
|
567
|
+
}
|
|
568
|
+
return obj;
|
|
569
|
+
},
|
|
570
|
+
create(base) {
|
|
571
|
+
return Proposal.fromPartial(base ?? {});
|
|
572
|
+
},
|
|
573
|
+
fromPartial(object) {
|
|
574
|
+
const message = createBaseProposal();
|
|
575
|
+
message.id = object.id ?? "";
|
|
576
|
+
message.title = object.title ?? "";
|
|
577
|
+
message.description = object.description ?? "";
|
|
578
|
+
message.actionType = object.actionType ?? "";
|
|
579
|
+
message.payload = object.payload ?? undefined;
|
|
580
|
+
message.proposer = object.proposer ?? "";
|
|
581
|
+
message.proposedAt = object.proposedAt ?? undefined;
|
|
582
|
+
message.deadline = object.deadline ?? undefined;
|
|
583
|
+
message.queuedAt = object.queuedAt ?? undefined;
|
|
584
|
+
message.executableAt = object.executableAt ?? undefined;
|
|
585
|
+
return message;
|
|
586
|
+
},
|
|
587
|
+
};
|
|
588
|
+
function createBaseVote() {
|
|
589
|
+
return { voter: "", choice: VoteChoice.VOTE_CHOICE_UNSPECIFIED, weight: 0, votedAt: undefined };
|
|
590
|
+
}
|
|
591
|
+
export const Vote = {
|
|
592
|
+
encode(message, writer = new BinaryWriter()) {
|
|
593
|
+
if (message.voter !== "") {
|
|
594
|
+
writer.uint32(10).string(message.voter);
|
|
595
|
+
}
|
|
596
|
+
if (message.choice !== VoteChoice.VOTE_CHOICE_UNSPECIFIED) {
|
|
597
|
+
writer.uint32(16).int32(voteChoiceToNumber(message.choice));
|
|
598
|
+
}
|
|
599
|
+
if (message.weight !== 0) {
|
|
600
|
+
writer.uint32(24).int64(message.weight);
|
|
601
|
+
}
|
|
602
|
+
if (message.votedAt !== undefined) {
|
|
603
|
+
Timestamp.encode(toTimestamp(message.votedAt), writer.uint32(34).fork()).join();
|
|
604
|
+
}
|
|
605
|
+
return writer;
|
|
606
|
+
},
|
|
607
|
+
decode(input, length) {
|
|
608
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
609
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
610
|
+
const message = createBaseVote();
|
|
611
|
+
while (reader.pos < end) {
|
|
612
|
+
const tag = reader.uint32();
|
|
613
|
+
switch (tag >>> 3) {
|
|
614
|
+
case 1: {
|
|
615
|
+
if (tag !== 10) {
|
|
616
|
+
break;
|
|
617
|
+
}
|
|
618
|
+
message.voter = reader.string();
|
|
619
|
+
continue;
|
|
620
|
+
}
|
|
621
|
+
case 2: {
|
|
622
|
+
if (tag !== 16) {
|
|
623
|
+
break;
|
|
624
|
+
}
|
|
625
|
+
message.choice = voteChoiceFromJSON(reader.int32());
|
|
626
|
+
continue;
|
|
627
|
+
}
|
|
628
|
+
case 3: {
|
|
629
|
+
if (tag !== 24) {
|
|
630
|
+
break;
|
|
631
|
+
}
|
|
632
|
+
message.weight = longToNumber(reader.int64());
|
|
633
|
+
continue;
|
|
634
|
+
}
|
|
635
|
+
case 4: {
|
|
636
|
+
if (tag !== 34) {
|
|
637
|
+
break;
|
|
638
|
+
}
|
|
639
|
+
message.votedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
640
|
+
continue;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
644
|
+
break;
|
|
645
|
+
}
|
|
646
|
+
reader.skip(tag & 7);
|
|
647
|
+
}
|
|
648
|
+
return message;
|
|
649
|
+
},
|
|
650
|
+
fromJSON(object) {
|
|
651
|
+
return {
|
|
652
|
+
voter: isSet(object.voter) ? globalThis.String(object.voter) : "",
|
|
653
|
+
choice: isSet(object.choice) ? voteChoiceFromJSON(object.choice) : VoteChoice.VOTE_CHOICE_UNSPECIFIED,
|
|
654
|
+
weight: isSet(object.weight) ? globalThis.Number(object.weight) : 0,
|
|
655
|
+
votedAt: isSet(object.votedAt)
|
|
656
|
+
? fromJsonTimestamp(object.votedAt)
|
|
657
|
+
: isSet(object.voted_at)
|
|
658
|
+
? fromJsonTimestamp(object.voted_at)
|
|
659
|
+
: undefined,
|
|
660
|
+
};
|
|
661
|
+
},
|
|
662
|
+
toJSON(message) {
|
|
663
|
+
const obj = {};
|
|
664
|
+
if (message.voter !== "") {
|
|
665
|
+
obj.voter = message.voter;
|
|
666
|
+
}
|
|
667
|
+
if (message.choice !== VoteChoice.VOTE_CHOICE_UNSPECIFIED) {
|
|
668
|
+
obj.choice = voteChoiceToJSON(message.choice);
|
|
669
|
+
}
|
|
670
|
+
if (message.weight !== 0) {
|
|
671
|
+
obj.weight = Math.round(message.weight);
|
|
672
|
+
}
|
|
673
|
+
if (message.votedAt !== undefined) {
|
|
674
|
+
obj.votedAt = message.votedAt.toISOString();
|
|
675
|
+
}
|
|
676
|
+
return obj;
|
|
677
|
+
},
|
|
678
|
+
create(base) {
|
|
679
|
+
return Vote.fromPartial(base ?? {});
|
|
680
|
+
},
|
|
681
|
+
fromPartial(object) {
|
|
682
|
+
const message = createBaseVote();
|
|
683
|
+
message.voter = object.voter ?? "";
|
|
684
|
+
message.choice = object.choice ?? VoteChoice.VOTE_CHOICE_UNSPECIFIED;
|
|
685
|
+
message.weight = object.weight ?? 0;
|
|
686
|
+
message.votedAt = object.votedAt ?? undefined;
|
|
687
|
+
return message;
|
|
688
|
+
},
|
|
689
|
+
};
|
|
690
|
+
function createBaseVoteTally() {
|
|
691
|
+
return { votesFor: 0, votesAgainst: 0, votesAbstain: 0, votes: [] };
|
|
692
|
+
}
|
|
693
|
+
export const VoteTally = {
|
|
694
|
+
encode(message, writer = new BinaryWriter()) {
|
|
695
|
+
if (message.votesFor !== 0) {
|
|
696
|
+
writer.uint32(8).int64(message.votesFor);
|
|
697
|
+
}
|
|
698
|
+
if (message.votesAgainst !== 0) {
|
|
699
|
+
writer.uint32(16).int64(message.votesAgainst);
|
|
700
|
+
}
|
|
701
|
+
if (message.votesAbstain !== 0) {
|
|
702
|
+
writer.uint32(24).int64(message.votesAbstain);
|
|
703
|
+
}
|
|
704
|
+
for (const v of message.votes) {
|
|
705
|
+
Vote.encode(v, writer.uint32(34).fork()).join();
|
|
706
|
+
}
|
|
707
|
+
return writer;
|
|
708
|
+
},
|
|
709
|
+
decode(input, length) {
|
|
710
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
711
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
712
|
+
const message = createBaseVoteTally();
|
|
713
|
+
while (reader.pos < end) {
|
|
714
|
+
const tag = reader.uint32();
|
|
715
|
+
switch (tag >>> 3) {
|
|
716
|
+
case 1: {
|
|
717
|
+
if (tag !== 8) {
|
|
718
|
+
break;
|
|
719
|
+
}
|
|
720
|
+
message.votesFor = longToNumber(reader.int64());
|
|
721
|
+
continue;
|
|
722
|
+
}
|
|
723
|
+
case 2: {
|
|
724
|
+
if (tag !== 16) {
|
|
725
|
+
break;
|
|
726
|
+
}
|
|
727
|
+
message.votesAgainst = longToNumber(reader.int64());
|
|
728
|
+
continue;
|
|
729
|
+
}
|
|
730
|
+
case 3: {
|
|
731
|
+
if (tag !== 24) {
|
|
732
|
+
break;
|
|
733
|
+
}
|
|
734
|
+
message.votesAbstain = longToNumber(reader.int64());
|
|
735
|
+
continue;
|
|
736
|
+
}
|
|
737
|
+
case 4: {
|
|
738
|
+
if (tag !== 34) {
|
|
739
|
+
break;
|
|
740
|
+
}
|
|
741
|
+
message.votes.push(Vote.decode(reader, reader.uint32()));
|
|
742
|
+
continue;
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
746
|
+
break;
|
|
747
|
+
}
|
|
748
|
+
reader.skip(tag & 7);
|
|
749
|
+
}
|
|
750
|
+
return message;
|
|
751
|
+
},
|
|
752
|
+
fromJSON(object) {
|
|
753
|
+
return {
|
|
754
|
+
votesFor: isSet(object.votesFor)
|
|
755
|
+
? globalThis.Number(object.votesFor)
|
|
756
|
+
: isSet(object.votes_for)
|
|
757
|
+
? globalThis.Number(object.votes_for)
|
|
758
|
+
: 0,
|
|
759
|
+
votesAgainst: isSet(object.votesAgainst)
|
|
760
|
+
? globalThis.Number(object.votesAgainst)
|
|
761
|
+
: isSet(object.votes_against)
|
|
762
|
+
? globalThis.Number(object.votes_against)
|
|
763
|
+
: 0,
|
|
764
|
+
votesAbstain: isSet(object.votesAbstain)
|
|
765
|
+
? globalThis.Number(object.votesAbstain)
|
|
766
|
+
: isSet(object.votes_abstain)
|
|
767
|
+
? globalThis.Number(object.votes_abstain)
|
|
768
|
+
: 0,
|
|
769
|
+
votes: globalThis.Array.isArray(object?.votes) ? object.votes.map((e) => Vote.fromJSON(e)) : [],
|
|
770
|
+
};
|
|
771
|
+
},
|
|
772
|
+
toJSON(message) {
|
|
773
|
+
const obj = {};
|
|
774
|
+
if (message.votesFor !== 0) {
|
|
775
|
+
obj.votesFor = Math.round(message.votesFor);
|
|
776
|
+
}
|
|
777
|
+
if (message.votesAgainst !== 0) {
|
|
778
|
+
obj.votesAgainst = Math.round(message.votesAgainst);
|
|
779
|
+
}
|
|
780
|
+
if (message.votesAbstain !== 0) {
|
|
781
|
+
obj.votesAbstain = Math.round(message.votesAbstain);
|
|
782
|
+
}
|
|
783
|
+
if (message.votes?.length) {
|
|
784
|
+
obj.votes = message.votes.map((e) => Vote.toJSON(e));
|
|
785
|
+
}
|
|
786
|
+
return obj;
|
|
787
|
+
},
|
|
788
|
+
create(base) {
|
|
789
|
+
return VoteTally.fromPartial(base ?? {});
|
|
790
|
+
},
|
|
791
|
+
fromPartial(object) {
|
|
792
|
+
const message = createBaseVoteTally();
|
|
793
|
+
message.votesFor = object.votesFor ?? 0;
|
|
794
|
+
message.votesAgainst = object.votesAgainst ?? 0;
|
|
795
|
+
message.votesAbstain = object.votesAbstain ?? 0;
|
|
796
|
+
message.votes = object.votes?.map((e) => Vote.fromPartial(e)) || [];
|
|
797
|
+
return message;
|
|
798
|
+
},
|
|
799
|
+
};
|
|
800
|
+
function createBaseSingleOwnerDAO() {
|
|
801
|
+
return {
|
|
802
|
+
name: "",
|
|
803
|
+
owner: "",
|
|
804
|
+
pendingOwner: "",
|
|
805
|
+
transferInitiatedAt: undefined,
|
|
806
|
+
actions: [],
|
|
807
|
+
ownershipHistory: [],
|
|
808
|
+
metadata: undefined,
|
|
809
|
+
status: DAOStatus.DAO_STATUS_UNSPECIFIED,
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
export const SingleOwnerDAO = {
|
|
813
|
+
encode(message, writer = new BinaryWriter()) {
|
|
814
|
+
if (message.name !== "") {
|
|
815
|
+
writer.uint32(10).string(message.name);
|
|
816
|
+
}
|
|
817
|
+
if (message.owner !== "") {
|
|
818
|
+
writer.uint32(18).string(message.owner);
|
|
819
|
+
}
|
|
820
|
+
if (message.pendingOwner !== "") {
|
|
821
|
+
writer.uint32(26).string(message.pendingOwner);
|
|
822
|
+
}
|
|
823
|
+
if (message.transferInitiatedAt !== undefined) {
|
|
824
|
+
Timestamp.encode(toTimestamp(message.transferInitiatedAt), writer.uint32(34).fork()).join();
|
|
825
|
+
}
|
|
826
|
+
for (const v of message.actions) {
|
|
827
|
+
SingleOwnerAction.encode(v, writer.uint32(42).fork()).join();
|
|
828
|
+
}
|
|
829
|
+
for (const v of message.ownershipHistory) {
|
|
830
|
+
OwnershipTransfer.encode(v, writer.uint32(50).fork()).join();
|
|
831
|
+
}
|
|
832
|
+
if (message.metadata !== undefined) {
|
|
833
|
+
DAOMetadata.encode(message.metadata, writer.uint32(58).fork()).join();
|
|
834
|
+
}
|
|
835
|
+
if (message.status !== DAOStatus.DAO_STATUS_UNSPECIFIED) {
|
|
836
|
+
writer.uint32(64).int32(dAOStatusToNumber(message.status));
|
|
837
|
+
}
|
|
838
|
+
return writer;
|
|
839
|
+
},
|
|
840
|
+
decode(input, length) {
|
|
841
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
842
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
843
|
+
const message = createBaseSingleOwnerDAO();
|
|
844
|
+
while (reader.pos < end) {
|
|
845
|
+
const tag = reader.uint32();
|
|
846
|
+
switch (tag >>> 3) {
|
|
847
|
+
case 1: {
|
|
848
|
+
if (tag !== 10) {
|
|
849
|
+
break;
|
|
850
|
+
}
|
|
851
|
+
message.name = reader.string();
|
|
852
|
+
continue;
|
|
853
|
+
}
|
|
854
|
+
case 2: {
|
|
855
|
+
if (tag !== 18) {
|
|
856
|
+
break;
|
|
857
|
+
}
|
|
858
|
+
message.owner = reader.string();
|
|
859
|
+
continue;
|
|
860
|
+
}
|
|
861
|
+
case 3: {
|
|
862
|
+
if (tag !== 26) {
|
|
863
|
+
break;
|
|
864
|
+
}
|
|
865
|
+
message.pendingOwner = reader.string();
|
|
866
|
+
continue;
|
|
867
|
+
}
|
|
868
|
+
case 4: {
|
|
869
|
+
if (tag !== 34) {
|
|
870
|
+
break;
|
|
871
|
+
}
|
|
872
|
+
message.transferInitiatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
873
|
+
continue;
|
|
874
|
+
}
|
|
875
|
+
case 5: {
|
|
876
|
+
if (tag !== 42) {
|
|
877
|
+
break;
|
|
878
|
+
}
|
|
879
|
+
message.actions.push(SingleOwnerAction.decode(reader, reader.uint32()));
|
|
880
|
+
continue;
|
|
881
|
+
}
|
|
882
|
+
case 6: {
|
|
883
|
+
if (tag !== 50) {
|
|
884
|
+
break;
|
|
885
|
+
}
|
|
886
|
+
message.ownershipHistory.push(OwnershipTransfer.decode(reader, reader.uint32()));
|
|
887
|
+
continue;
|
|
888
|
+
}
|
|
889
|
+
case 7: {
|
|
890
|
+
if (tag !== 58) {
|
|
891
|
+
break;
|
|
892
|
+
}
|
|
893
|
+
message.metadata = DAOMetadata.decode(reader, reader.uint32());
|
|
894
|
+
continue;
|
|
895
|
+
}
|
|
896
|
+
case 8: {
|
|
897
|
+
if (tag !== 64) {
|
|
898
|
+
break;
|
|
899
|
+
}
|
|
900
|
+
message.status = dAOStatusFromJSON(reader.int32());
|
|
901
|
+
continue;
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
905
|
+
break;
|
|
906
|
+
}
|
|
907
|
+
reader.skip(tag & 7);
|
|
908
|
+
}
|
|
909
|
+
return message;
|
|
910
|
+
},
|
|
911
|
+
fromJSON(object) {
|
|
912
|
+
return {
|
|
913
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
914
|
+
owner: isSet(object.owner) ? globalThis.String(object.owner) : "",
|
|
915
|
+
pendingOwner: isSet(object.pendingOwner)
|
|
916
|
+
? globalThis.String(object.pendingOwner)
|
|
917
|
+
: isSet(object.pending_owner)
|
|
918
|
+
? globalThis.String(object.pending_owner)
|
|
919
|
+
: "",
|
|
920
|
+
transferInitiatedAt: isSet(object.transferInitiatedAt)
|
|
921
|
+
? fromJsonTimestamp(object.transferInitiatedAt)
|
|
922
|
+
: isSet(object.transfer_initiated_at)
|
|
923
|
+
? fromJsonTimestamp(object.transfer_initiated_at)
|
|
924
|
+
: undefined,
|
|
925
|
+
actions: globalThis.Array.isArray(object?.actions)
|
|
926
|
+
? object.actions.map((e) => SingleOwnerAction.fromJSON(e))
|
|
927
|
+
: [],
|
|
928
|
+
ownershipHistory: globalThis.Array.isArray(object?.ownershipHistory)
|
|
929
|
+
? object.ownershipHistory.map((e) => OwnershipTransfer.fromJSON(e))
|
|
930
|
+
: globalThis.Array.isArray(object?.ownership_history)
|
|
931
|
+
? object.ownership_history.map((e) => OwnershipTransfer.fromJSON(e))
|
|
932
|
+
: [],
|
|
933
|
+
metadata: isSet(object.metadata) ? DAOMetadata.fromJSON(object.metadata) : undefined,
|
|
934
|
+
status: isSet(object.status) ? dAOStatusFromJSON(object.status) : DAOStatus.DAO_STATUS_UNSPECIFIED,
|
|
935
|
+
};
|
|
936
|
+
},
|
|
937
|
+
toJSON(message) {
|
|
938
|
+
const obj = {};
|
|
939
|
+
if (message.name !== "") {
|
|
940
|
+
obj.name = message.name;
|
|
941
|
+
}
|
|
942
|
+
if (message.owner !== "") {
|
|
943
|
+
obj.owner = message.owner;
|
|
944
|
+
}
|
|
945
|
+
if (message.pendingOwner !== "") {
|
|
946
|
+
obj.pendingOwner = message.pendingOwner;
|
|
947
|
+
}
|
|
948
|
+
if (message.transferInitiatedAt !== undefined) {
|
|
949
|
+
obj.transferInitiatedAt = message.transferInitiatedAt.toISOString();
|
|
950
|
+
}
|
|
951
|
+
if (message.actions?.length) {
|
|
952
|
+
obj.actions = message.actions.map((e) => SingleOwnerAction.toJSON(e));
|
|
953
|
+
}
|
|
954
|
+
if (message.ownershipHistory?.length) {
|
|
955
|
+
obj.ownershipHistory = message.ownershipHistory.map((e) => OwnershipTransfer.toJSON(e));
|
|
956
|
+
}
|
|
957
|
+
if (message.metadata !== undefined) {
|
|
958
|
+
obj.metadata = DAOMetadata.toJSON(message.metadata);
|
|
959
|
+
}
|
|
960
|
+
if (message.status !== DAOStatus.DAO_STATUS_UNSPECIFIED) {
|
|
961
|
+
obj.status = dAOStatusToJSON(message.status);
|
|
962
|
+
}
|
|
963
|
+
return obj;
|
|
964
|
+
},
|
|
965
|
+
create(base) {
|
|
966
|
+
return SingleOwnerDAO.fromPartial(base ?? {});
|
|
967
|
+
},
|
|
968
|
+
fromPartial(object) {
|
|
969
|
+
const message = createBaseSingleOwnerDAO();
|
|
970
|
+
message.name = object.name ?? "";
|
|
971
|
+
message.owner = object.owner ?? "";
|
|
972
|
+
message.pendingOwner = object.pendingOwner ?? "";
|
|
973
|
+
message.transferInitiatedAt = object.transferInitiatedAt ?? undefined;
|
|
974
|
+
message.actions = object.actions?.map((e) => SingleOwnerAction.fromPartial(e)) || [];
|
|
975
|
+
message.ownershipHistory = object.ownershipHistory?.map((e) => OwnershipTransfer.fromPartial(e)) || [];
|
|
976
|
+
message.metadata = (object.metadata !== undefined && object.metadata !== null)
|
|
977
|
+
? DAOMetadata.fromPartial(object.metadata)
|
|
978
|
+
: undefined;
|
|
979
|
+
message.status = object.status ?? DAOStatus.DAO_STATUS_UNSPECIFIED;
|
|
980
|
+
return message;
|
|
981
|
+
},
|
|
982
|
+
};
|
|
983
|
+
function createBaseSingleOwnerAction() {
|
|
984
|
+
return { id: "", actionType: "", payload: undefined, executedAt: undefined };
|
|
985
|
+
}
|
|
986
|
+
export const SingleOwnerAction = {
|
|
987
|
+
encode(message, writer = new BinaryWriter()) {
|
|
988
|
+
if (message.id !== "") {
|
|
989
|
+
writer.uint32(10).string(message.id);
|
|
990
|
+
}
|
|
991
|
+
if (message.actionType !== "") {
|
|
992
|
+
writer.uint32(18).string(message.actionType);
|
|
993
|
+
}
|
|
994
|
+
if (message.payload !== undefined) {
|
|
995
|
+
Struct.encode(Struct.wrap(message.payload), writer.uint32(26).fork()).join();
|
|
996
|
+
}
|
|
997
|
+
if (message.executedAt !== undefined) {
|
|
998
|
+
Timestamp.encode(toTimestamp(message.executedAt), writer.uint32(34).fork()).join();
|
|
999
|
+
}
|
|
1000
|
+
return writer;
|
|
1001
|
+
},
|
|
1002
|
+
decode(input, length) {
|
|
1003
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1004
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1005
|
+
const message = createBaseSingleOwnerAction();
|
|
1006
|
+
while (reader.pos < end) {
|
|
1007
|
+
const tag = reader.uint32();
|
|
1008
|
+
switch (tag >>> 3) {
|
|
1009
|
+
case 1: {
|
|
1010
|
+
if (tag !== 10) {
|
|
1011
|
+
break;
|
|
1012
|
+
}
|
|
1013
|
+
message.id = reader.string();
|
|
1014
|
+
continue;
|
|
1015
|
+
}
|
|
1016
|
+
case 2: {
|
|
1017
|
+
if (tag !== 18) {
|
|
1018
|
+
break;
|
|
1019
|
+
}
|
|
1020
|
+
message.actionType = reader.string();
|
|
1021
|
+
continue;
|
|
1022
|
+
}
|
|
1023
|
+
case 3: {
|
|
1024
|
+
if (tag !== 26) {
|
|
1025
|
+
break;
|
|
1026
|
+
}
|
|
1027
|
+
message.payload = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
1028
|
+
continue;
|
|
1029
|
+
}
|
|
1030
|
+
case 4: {
|
|
1031
|
+
if (tag !== 34) {
|
|
1032
|
+
break;
|
|
1033
|
+
}
|
|
1034
|
+
message.executedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
1035
|
+
continue;
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1039
|
+
break;
|
|
1040
|
+
}
|
|
1041
|
+
reader.skip(tag & 7);
|
|
1042
|
+
}
|
|
1043
|
+
return message;
|
|
1044
|
+
},
|
|
1045
|
+
fromJSON(object) {
|
|
1046
|
+
return {
|
|
1047
|
+
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
1048
|
+
actionType: isSet(object.actionType)
|
|
1049
|
+
? globalThis.String(object.actionType)
|
|
1050
|
+
: isSet(object.action_type)
|
|
1051
|
+
? globalThis.String(object.action_type)
|
|
1052
|
+
: "",
|
|
1053
|
+
payload: isObject(object.payload) ? object.payload : undefined,
|
|
1054
|
+
executedAt: isSet(object.executedAt)
|
|
1055
|
+
? fromJsonTimestamp(object.executedAt)
|
|
1056
|
+
: isSet(object.executed_at)
|
|
1057
|
+
? fromJsonTimestamp(object.executed_at)
|
|
1058
|
+
: undefined,
|
|
1059
|
+
};
|
|
1060
|
+
},
|
|
1061
|
+
toJSON(message) {
|
|
1062
|
+
const obj = {};
|
|
1063
|
+
if (message.id !== "") {
|
|
1064
|
+
obj.id = message.id;
|
|
1065
|
+
}
|
|
1066
|
+
if (message.actionType !== "") {
|
|
1067
|
+
obj.actionType = message.actionType;
|
|
1068
|
+
}
|
|
1069
|
+
if (message.payload !== undefined) {
|
|
1070
|
+
obj.payload = message.payload;
|
|
1071
|
+
}
|
|
1072
|
+
if (message.executedAt !== undefined) {
|
|
1073
|
+
obj.executedAt = message.executedAt.toISOString();
|
|
1074
|
+
}
|
|
1075
|
+
return obj;
|
|
1076
|
+
},
|
|
1077
|
+
create(base) {
|
|
1078
|
+
return SingleOwnerAction.fromPartial(base ?? {});
|
|
1079
|
+
},
|
|
1080
|
+
fromPartial(object) {
|
|
1081
|
+
const message = createBaseSingleOwnerAction();
|
|
1082
|
+
message.id = object.id ?? "";
|
|
1083
|
+
message.actionType = object.actionType ?? "";
|
|
1084
|
+
message.payload = object.payload ?? undefined;
|
|
1085
|
+
message.executedAt = object.executedAt ?? undefined;
|
|
1086
|
+
return message;
|
|
1087
|
+
},
|
|
1088
|
+
};
|
|
1089
|
+
function createBaseOwnershipTransfer() {
|
|
1090
|
+
return { from: "", to: "", at: undefined };
|
|
1091
|
+
}
|
|
1092
|
+
export const OwnershipTransfer = {
|
|
1093
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1094
|
+
if (message.from !== "") {
|
|
1095
|
+
writer.uint32(10).string(message.from);
|
|
1096
|
+
}
|
|
1097
|
+
if (message.to !== "") {
|
|
1098
|
+
writer.uint32(18).string(message.to);
|
|
1099
|
+
}
|
|
1100
|
+
if (message.at !== undefined) {
|
|
1101
|
+
Timestamp.encode(toTimestamp(message.at), writer.uint32(26).fork()).join();
|
|
1102
|
+
}
|
|
1103
|
+
return writer;
|
|
1104
|
+
},
|
|
1105
|
+
decode(input, length) {
|
|
1106
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1107
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1108
|
+
const message = createBaseOwnershipTransfer();
|
|
1109
|
+
while (reader.pos < end) {
|
|
1110
|
+
const tag = reader.uint32();
|
|
1111
|
+
switch (tag >>> 3) {
|
|
1112
|
+
case 1: {
|
|
1113
|
+
if (tag !== 10) {
|
|
1114
|
+
break;
|
|
1115
|
+
}
|
|
1116
|
+
message.from = reader.string();
|
|
1117
|
+
continue;
|
|
1118
|
+
}
|
|
1119
|
+
case 2: {
|
|
1120
|
+
if (tag !== 18) {
|
|
1121
|
+
break;
|
|
1122
|
+
}
|
|
1123
|
+
message.to = reader.string();
|
|
1124
|
+
continue;
|
|
1125
|
+
}
|
|
1126
|
+
case 3: {
|
|
1127
|
+
if (tag !== 26) {
|
|
1128
|
+
break;
|
|
1129
|
+
}
|
|
1130
|
+
message.at = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
1131
|
+
continue;
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1135
|
+
break;
|
|
1136
|
+
}
|
|
1137
|
+
reader.skip(tag & 7);
|
|
1138
|
+
}
|
|
1139
|
+
return message;
|
|
1140
|
+
},
|
|
1141
|
+
fromJSON(object) {
|
|
1142
|
+
return {
|
|
1143
|
+
from: isSet(object.from) ? globalThis.String(object.from) : "",
|
|
1144
|
+
to: isSet(object.to) ? globalThis.String(object.to) : "",
|
|
1145
|
+
at: isSet(object.at) ? fromJsonTimestamp(object.at) : undefined,
|
|
1146
|
+
};
|
|
1147
|
+
},
|
|
1148
|
+
toJSON(message) {
|
|
1149
|
+
const obj = {};
|
|
1150
|
+
if (message.from !== "") {
|
|
1151
|
+
obj.from = message.from;
|
|
1152
|
+
}
|
|
1153
|
+
if (message.to !== "") {
|
|
1154
|
+
obj.to = message.to;
|
|
1155
|
+
}
|
|
1156
|
+
if (message.at !== undefined) {
|
|
1157
|
+
obj.at = message.at.toISOString();
|
|
1158
|
+
}
|
|
1159
|
+
return obj;
|
|
1160
|
+
},
|
|
1161
|
+
create(base) {
|
|
1162
|
+
return OwnershipTransfer.fromPartial(base ?? {});
|
|
1163
|
+
},
|
|
1164
|
+
fromPartial(object) {
|
|
1165
|
+
const message = createBaseOwnershipTransfer();
|
|
1166
|
+
message.from = object.from ?? "";
|
|
1167
|
+
message.to = object.to ?? "";
|
|
1168
|
+
message.at = object.at ?? undefined;
|
|
1169
|
+
return message;
|
|
1170
|
+
},
|
|
1171
|
+
};
|
|
1172
|
+
function createBaseMultisigDAO() {
|
|
1173
|
+
return {
|
|
1174
|
+
name: "",
|
|
1175
|
+
signers: [],
|
|
1176
|
+
threshold: 0,
|
|
1177
|
+
proposalTtlMs: 0,
|
|
1178
|
+
proposal: undefined,
|
|
1179
|
+
signatures: {},
|
|
1180
|
+
actions: [],
|
|
1181
|
+
cancelledProposals: [],
|
|
1182
|
+
metadata: undefined,
|
|
1183
|
+
status: DAOStatus.DAO_STATUS_UNSPECIFIED,
|
|
1184
|
+
};
|
|
1185
|
+
}
|
|
1186
|
+
export const MultisigDAO = {
|
|
1187
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1188
|
+
if (message.name !== "") {
|
|
1189
|
+
writer.uint32(10).string(message.name);
|
|
1190
|
+
}
|
|
1191
|
+
for (const v of message.signers) {
|
|
1192
|
+
writer.uint32(18).string(v);
|
|
1193
|
+
}
|
|
1194
|
+
if (message.threshold !== 0) {
|
|
1195
|
+
writer.uint32(24).int32(message.threshold);
|
|
1196
|
+
}
|
|
1197
|
+
if (message.proposalTtlMs !== 0) {
|
|
1198
|
+
writer.uint32(32).int64(message.proposalTtlMs);
|
|
1199
|
+
}
|
|
1200
|
+
if (message.proposal !== undefined) {
|
|
1201
|
+
Proposal.encode(message.proposal, writer.uint32(42).fork()).join();
|
|
1202
|
+
}
|
|
1203
|
+
globalThis.Object.entries(message.signatures).forEach(([key, value]) => {
|
|
1204
|
+
MultisigDAO_SignaturesEntry.encode({ key: key, value }, writer.uint32(50).fork()).join();
|
|
1205
|
+
});
|
|
1206
|
+
for (const v of message.actions) {
|
|
1207
|
+
MultisigAction.encode(v, writer.uint32(58).fork()).join();
|
|
1208
|
+
}
|
|
1209
|
+
for (const v of message.cancelledProposals) {
|
|
1210
|
+
Proposal.encode(v, writer.uint32(66).fork()).join();
|
|
1211
|
+
}
|
|
1212
|
+
if (message.metadata !== undefined) {
|
|
1213
|
+
DAOMetadata.encode(message.metadata, writer.uint32(74).fork()).join();
|
|
1214
|
+
}
|
|
1215
|
+
if (message.status !== DAOStatus.DAO_STATUS_UNSPECIFIED) {
|
|
1216
|
+
writer.uint32(80).int32(dAOStatusToNumber(message.status));
|
|
1217
|
+
}
|
|
1218
|
+
return writer;
|
|
1219
|
+
},
|
|
1220
|
+
decode(input, length) {
|
|
1221
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1222
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1223
|
+
const message = createBaseMultisigDAO();
|
|
1224
|
+
while (reader.pos < end) {
|
|
1225
|
+
const tag = reader.uint32();
|
|
1226
|
+
switch (tag >>> 3) {
|
|
1227
|
+
case 1: {
|
|
1228
|
+
if (tag !== 10) {
|
|
1229
|
+
break;
|
|
1230
|
+
}
|
|
1231
|
+
message.name = reader.string();
|
|
1232
|
+
continue;
|
|
1233
|
+
}
|
|
1234
|
+
case 2: {
|
|
1235
|
+
if (tag !== 18) {
|
|
1236
|
+
break;
|
|
1237
|
+
}
|
|
1238
|
+
message.signers.push(reader.string());
|
|
1239
|
+
continue;
|
|
1240
|
+
}
|
|
1241
|
+
case 3: {
|
|
1242
|
+
if (tag !== 24) {
|
|
1243
|
+
break;
|
|
1244
|
+
}
|
|
1245
|
+
message.threshold = reader.int32();
|
|
1246
|
+
continue;
|
|
1247
|
+
}
|
|
1248
|
+
case 4: {
|
|
1249
|
+
if (tag !== 32) {
|
|
1250
|
+
break;
|
|
1251
|
+
}
|
|
1252
|
+
message.proposalTtlMs = longToNumber(reader.int64());
|
|
1253
|
+
continue;
|
|
1254
|
+
}
|
|
1255
|
+
case 5: {
|
|
1256
|
+
if (tag !== 42) {
|
|
1257
|
+
break;
|
|
1258
|
+
}
|
|
1259
|
+
message.proposal = Proposal.decode(reader, reader.uint32());
|
|
1260
|
+
continue;
|
|
1261
|
+
}
|
|
1262
|
+
case 6: {
|
|
1263
|
+
if (tag !== 50) {
|
|
1264
|
+
break;
|
|
1265
|
+
}
|
|
1266
|
+
const entry6 = MultisigDAO_SignaturesEntry.decode(reader, reader.uint32());
|
|
1267
|
+
if (entry6.value !== undefined) {
|
|
1268
|
+
message.signatures[entry6.key] = entry6.value;
|
|
1269
|
+
}
|
|
1270
|
+
continue;
|
|
1271
|
+
}
|
|
1272
|
+
case 7: {
|
|
1273
|
+
if (tag !== 58) {
|
|
1274
|
+
break;
|
|
1275
|
+
}
|
|
1276
|
+
message.actions.push(MultisigAction.decode(reader, reader.uint32()));
|
|
1277
|
+
continue;
|
|
1278
|
+
}
|
|
1279
|
+
case 8: {
|
|
1280
|
+
if (tag !== 66) {
|
|
1281
|
+
break;
|
|
1282
|
+
}
|
|
1283
|
+
message.cancelledProposals.push(Proposal.decode(reader, reader.uint32()));
|
|
1284
|
+
continue;
|
|
1285
|
+
}
|
|
1286
|
+
case 9: {
|
|
1287
|
+
if (tag !== 74) {
|
|
1288
|
+
break;
|
|
1289
|
+
}
|
|
1290
|
+
message.metadata = DAOMetadata.decode(reader, reader.uint32());
|
|
1291
|
+
continue;
|
|
1292
|
+
}
|
|
1293
|
+
case 10: {
|
|
1294
|
+
if (tag !== 80) {
|
|
1295
|
+
break;
|
|
1296
|
+
}
|
|
1297
|
+
message.status = dAOStatusFromJSON(reader.int32());
|
|
1298
|
+
continue;
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1302
|
+
break;
|
|
1303
|
+
}
|
|
1304
|
+
reader.skip(tag & 7);
|
|
1305
|
+
}
|
|
1306
|
+
return message;
|
|
1307
|
+
},
|
|
1308
|
+
fromJSON(object) {
|
|
1309
|
+
return {
|
|
1310
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
1311
|
+
signers: globalThis.Array.isArray(object?.signers) ? object.signers.map((e) => globalThis.String(e)) : [],
|
|
1312
|
+
threshold: isSet(object.threshold) ? globalThis.Number(object.threshold) : 0,
|
|
1313
|
+
proposalTtlMs: isSet(object.proposalTtlMs)
|
|
1314
|
+
? globalThis.Number(object.proposalTtlMs)
|
|
1315
|
+
: isSet(object.proposal_ttl_ms)
|
|
1316
|
+
? globalThis.Number(object.proposal_ttl_ms)
|
|
1317
|
+
: 0,
|
|
1318
|
+
proposal: isSet(object.proposal) ? Proposal.fromJSON(object.proposal) : undefined,
|
|
1319
|
+
signatures: isObject(object.signatures)
|
|
1320
|
+
? globalThis.Object.entries(object.signatures).reduce((acc, [key, value]) => {
|
|
1321
|
+
acc[key] = globalThis.Number(value);
|
|
1322
|
+
return acc;
|
|
1323
|
+
}, {})
|
|
1324
|
+
: {},
|
|
1325
|
+
actions: globalThis.Array.isArray(object?.actions)
|
|
1326
|
+
? object.actions.map((e) => MultisigAction.fromJSON(e))
|
|
1327
|
+
: [],
|
|
1328
|
+
cancelledProposals: globalThis.Array.isArray(object?.cancelledProposals)
|
|
1329
|
+
? object.cancelledProposals.map((e) => Proposal.fromJSON(e))
|
|
1330
|
+
: globalThis.Array.isArray(object?.cancelled_proposals)
|
|
1331
|
+
? object.cancelled_proposals.map((e) => Proposal.fromJSON(e))
|
|
1332
|
+
: [],
|
|
1333
|
+
metadata: isSet(object.metadata) ? DAOMetadata.fromJSON(object.metadata) : undefined,
|
|
1334
|
+
status: isSet(object.status) ? dAOStatusFromJSON(object.status) : DAOStatus.DAO_STATUS_UNSPECIFIED,
|
|
1335
|
+
};
|
|
1336
|
+
},
|
|
1337
|
+
toJSON(message) {
|
|
1338
|
+
const obj = {};
|
|
1339
|
+
if (message.name !== "") {
|
|
1340
|
+
obj.name = message.name;
|
|
1341
|
+
}
|
|
1342
|
+
if (message.signers?.length) {
|
|
1343
|
+
obj.signers = message.signers;
|
|
1344
|
+
}
|
|
1345
|
+
if (message.threshold !== 0) {
|
|
1346
|
+
obj.threshold = Math.round(message.threshold);
|
|
1347
|
+
}
|
|
1348
|
+
if (message.proposalTtlMs !== 0) {
|
|
1349
|
+
obj.proposalTtlMs = Math.round(message.proposalTtlMs);
|
|
1350
|
+
}
|
|
1351
|
+
if (message.proposal !== undefined) {
|
|
1352
|
+
obj.proposal = Proposal.toJSON(message.proposal);
|
|
1353
|
+
}
|
|
1354
|
+
if (message.signatures) {
|
|
1355
|
+
const entries = globalThis.Object.entries(message.signatures);
|
|
1356
|
+
if (entries.length > 0) {
|
|
1357
|
+
obj.signatures = {};
|
|
1358
|
+
entries.forEach(([k, v]) => {
|
|
1359
|
+
obj.signatures[k] = Math.round(v);
|
|
1360
|
+
});
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
if (message.actions?.length) {
|
|
1364
|
+
obj.actions = message.actions.map((e) => MultisigAction.toJSON(e));
|
|
1365
|
+
}
|
|
1366
|
+
if (message.cancelledProposals?.length) {
|
|
1367
|
+
obj.cancelledProposals = message.cancelledProposals.map((e) => Proposal.toJSON(e));
|
|
1368
|
+
}
|
|
1369
|
+
if (message.metadata !== undefined) {
|
|
1370
|
+
obj.metadata = DAOMetadata.toJSON(message.metadata);
|
|
1371
|
+
}
|
|
1372
|
+
if (message.status !== DAOStatus.DAO_STATUS_UNSPECIFIED) {
|
|
1373
|
+
obj.status = dAOStatusToJSON(message.status);
|
|
1374
|
+
}
|
|
1375
|
+
return obj;
|
|
1376
|
+
},
|
|
1377
|
+
create(base) {
|
|
1378
|
+
return MultisigDAO.fromPartial(base ?? {});
|
|
1379
|
+
},
|
|
1380
|
+
fromPartial(object) {
|
|
1381
|
+
const message = createBaseMultisigDAO();
|
|
1382
|
+
message.name = object.name ?? "";
|
|
1383
|
+
message.signers = object.signers?.map((e) => e) || [];
|
|
1384
|
+
message.threshold = object.threshold ?? 0;
|
|
1385
|
+
message.proposalTtlMs = object.proposalTtlMs ?? 0;
|
|
1386
|
+
message.proposal = (object.proposal !== undefined && object.proposal !== null)
|
|
1387
|
+
? Proposal.fromPartial(object.proposal)
|
|
1388
|
+
: undefined;
|
|
1389
|
+
message.signatures = globalThis.Object.entries(object.signatures ?? {}).reduce((acc, [key, value]) => {
|
|
1390
|
+
if (value !== undefined) {
|
|
1391
|
+
acc[key] = globalThis.Number(value);
|
|
1392
|
+
}
|
|
1393
|
+
return acc;
|
|
1394
|
+
}, {});
|
|
1395
|
+
message.actions = object.actions?.map((e) => MultisigAction.fromPartial(e)) || [];
|
|
1396
|
+
message.cancelledProposals = object.cancelledProposals?.map((e) => Proposal.fromPartial(e)) || [];
|
|
1397
|
+
message.metadata = (object.metadata !== undefined && object.metadata !== null)
|
|
1398
|
+
? DAOMetadata.fromPartial(object.metadata)
|
|
1399
|
+
: undefined;
|
|
1400
|
+
message.status = object.status ?? DAOStatus.DAO_STATUS_UNSPECIFIED;
|
|
1401
|
+
return message;
|
|
1402
|
+
},
|
|
1403
|
+
};
|
|
1404
|
+
function createBaseMultisigDAO_SignaturesEntry() {
|
|
1405
|
+
return { key: "", value: 0 };
|
|
1406
|
+
}
|
|
1407
|
+
export const MultisigDAO_SignaturesEntry = {
|
|
1408
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1409
|
+
if (message.key !== "") {
|
|
1410
|
+
writer.uint32(10).string(message.key);
|
|
1411
|
+
}
|
|
1412
|
+
if (message.value !== 0) {
|
|
1413
|
+
writer.uint32(16).int64(message.value);
|
|
1414
|
+
}
|
|
1415
|
+
return writer;
|
|
1416
|
+
},
|
|
1417
|
+
decode(input, length) {
|
|
1418
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1419
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1420
|
+
const message = createBaseMultisigDAO_SignaturesEntry();
|
|
1421
|
+
while (reader.pos < end) {
|
|
1422
|
+
const tag = reader.uint32();
|
|
1423
|
+
switch (tag >>> 3) {
|
|
1424
|
+
case 1: {
|
|
1425
|
+
if (tag !== 10) {
|
|
1426
|
+
break;
|
|
1427
|
+
}
|
|
1428
|
+
message.key = reader.string();
|
|
1429
|
+
continue;
|
|
1430
|
+
}
|
|
1431
|
+
case 2: {
|
|
1432
|
+
if (tag !== 16) {
|
|
1433
|
+
break;
|
|
1434
|
+
}
|
|
1435
|
+
message.value = longToNumber(reader.int64());
|
|
1436
|
+
continue;
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1440
|
+
break;
|
|
1441
|
+
}
|
|
1442
|
+
reader.skip(tag & 7);
|
|
1443
|
+
}
|
|
1444
|
+
return message;
|
|
1445
|
+
},
|
|
1446
|
+
fromJSON(object) {
|
|
1447
|
+
return {
|
|
1448
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
1449
|
+
value: isSet(object.value) ? globalThis.Number(object.value) : 0,
|
|
1450
|
+
};
|
|
1451
|
+
},
|
|
1452
|
+
toJSON(message) {
|
|
1453
|
+
const obj = {};
|
|
1454
|
+
if (message.key !== "") {
|
|
1455
|
+
obj.key = message.key;
|
|
1456
|
+
}
|
|
1457
|
+
if (message.value !== 0) {
|
|
1458
|
+
obj.value = Math.round(message.value);
|
|
1459
|
+
}
|
|
1460
|
+
return obj;
|
|
1461
|
+
},
|
|
1462
|
+
create(base) {
|
|
1463
|
+
return MultisigDAO_SignaturesEntry.fromPartial(base ?? {});
|
|
1464
|
+
},
|
|
1465
|
+
fromPartial(object) {
|
|
1466
|
+
const message = createBaseMultisigDAO_SignaturesEntry();
|
|
1467
|
+
message.key = object.key ?? "";
|
|
1468
|
+
message.value = object.value ?? 0;
|
|
1469
|
+
return message;
|
|
1470
|
+
},
|
|
1471
|
+
};
|
|
1472
|
+
function createBaseMultisigAction() {
|
|
1473
|
+
return { proposal: undefined, signatures: {}, executedAt: undefined };
|
|
1474
|
+
}
|
|
1475
|
+
export const MultisigAction = {
|
|
1476
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1477
|
+
if (message.proposal !== undefined) {
|
|
1478
|
+
Proposal.encode(message.proposal, writer.uint32(10).fork()).join();
|
|
1479
|
+
}
|
|
1480
|
+
globalThis.Object.entries(message.signatures).forEach(([key, value]) => {
|
|
1481
|
+
MultisigAction_SignaturesEntry.encode({ key: key, value }, writer.uint32(18).fork()).join();
|
|
1482
|
+
});
|
|
1483
|
+
if (message.executedAt !== undefined) {
|
|
1484
|
+
Timestamp.encode(toTimestamp(message.executedAt), writer.uint32(26).fork()).join();
|
|
1485
|
+
}
|
|
1486
|
+
return writer;
|
|
1487
|
+
},
|
|
1488
|
+
decode(input, length) {
|
|
1489
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1490
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1491
|
+
const message = createBaseMultisigAction();
|
|
1492
|
+
while (reader.pos < end) {
|
|
1493
|
+
const tag = reader.uint32();
|
|
1494
|
+
switch (tag >>> 3) {
|
|
1495
|
+
case 1: {
|
|
1496
|
+
if (tag !== 10) {
|
|
1497
|
+
break;
|
|
1498
|
+
}
|
|
1499
|
+
message.proposal = Proposal.decode(reader, reader.uint32());
|
|
1500
|
+
continue;
|
|
1501
|
+
}
|
|
1502
|
+
case 2: {
|
|
1503
|
+
if (tag !== 18) {
|
|
1504
|
+
break;
|
|
1505
|
+
}
|
|
1506
|
+
const entry2 = MultisigAction_SignaturesEntry.decode(reader, reader.uint32());
|
|
1507
|
+
if (entry2.value !== undefined) {
|
|
1508
|
+
message.signatures[entry2.key] = entry2.value;
|
|
1509
|
+
}
|
|
1510
|
+
continue;
|
|
1511
|
+
}
|
|
1512
|
+
case 3: {
|
|
1513
|
+
if (tag !== 26) {
|
|
1514
|
+
break;
|
|
1515
|
+
}
|
|
1516
|
+
message.executedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
1517
|
+
continue;
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1521
|
+
break;
|
|
1522
|
+
}
|
|
1523
|
+
reader.skip(tag & 7);
|
|
1524
|
+
}
|
|
1525
|
+
return message;
|
|
1526
|
+
},
|
|
1527
|
+
fromJSON(object) {
|
|
1528
|
+
return {
|
|
1529
|
+
proposal: isSet(object.proposal) ? Proposal.fromJSON(object.proposal) : undefined,
|
|
1530
|
+
signatures: isObject(object.signatures)
|
|
1531
|
+
? globalThis.Object.entries(object.signatures).reduce((acc, [key, value]) => {
|
|
1532
|
+
acc[key] = globalThis.Number(value);
|
|
1533
|
+
return acc;
|
|
1534
|
+
}, {})
|
|
1535
|
+
: {},
|
|
1536
|
+
executedAt: isSet(object.executedAt)
|
|
1537
|
+
? fromJsonTimestamp(object.executedAt)
|
|
1538
|
+
: isSet(object.executed_at)
|
|
1539
|
+
? fromJsonTimestamp(object.executed_at)
|
|
1540
|
+
: undefined,
|
|
1541
|
+
};
|
|
1542
|
+
},
|
|
1543
|
+
toJSON(message) {
|
|
1544
|
+
const obj = {};
|
|
1545
|
+
if (message.proposal !== undefined) {
|
|
1546
|
+
obj.proposal = Proposal.toJSON(message.proposal);
|
|
1547
|
+
}
|
|
1548
|
+
if (message.signatures) {
|
|
1549
|
+
const entries = globalThis.Object.entries(message.signatures);
|
|
1550
|
+
if (entries.length > 0) {
|
|
1551
|
+
obj.signatures = {};
|
|
1552
|
+
entries.forEach(([k, v]) => {
|
|
1553
|
+
obj.signatures[k] = Math.round(v);
|
|
1554
|
+
});
|
|
1555
|
+
}
|
|
1556
|
+
}
|
|
1557
|
+
if (message.executedAt !== undefined) {
|
|
1558
|
+
obj.executedAt = message.executedAt.toISOString();
|
|
1559
|
+
}
|
|
1560
|
+
return obj;
|
|
1561
|
+
},
|
|
1562
|
+
create(base) {
|
|
1563
|
+
return MultisigAction.fromPartial(base ?? {});
|
|
1564
|
+
},
|
|
1565
|
+
fromPartial(object) {
|
|
1566
|
+
const message = createBaseMultisigAction();
|
|
1567
|
+
message.proposal = (object.proposal !== undefined && object.proposal !== null)
|
|
1568
|
+
? Proposal.fromPartial(object.proposal)
|
|
1569
|
+
: undefined;
|
|
1570
|
+
message.signatures = globalThis.Object.entries(object.signatures ?? {}).reduce((acc, [key, value]) => {
|
|
1571
|
+
if (value !== undefined) {
|
|
1572
|
+
acc[key] = globalThis.Number(value);
|
|
1573
|
+
}
|
|
1574
|
+
return acc;
|
|
1575
|
+
}, {});
|
|
1576
|
+
message.executedAt = object.executedAt ?? undefined;
|
|
1577
|
+
return message;
|
|
1578
|
+
},
|
|
1579
|
+
};
|
|
1580
|
+
function createBaseMultisigAction_SignaturesEntry() {
|
|
1581
|
+
return { key: "", value: 0 };
|
|
1582
|
+
}
|
|
1583
|
+
export const MultisigAction_SignaturesEntry = {
|
|
1584
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1585
|
+
if (message.key !== "") {
|
|
1586
|
+
writer.uint32(10).string(message.key);
|
|
1587
|
+
}
|
|
1588
|
+
if (message.value !== 0) {
|
|
1589
|
+
writer.uint32(16).int64(message.value);
|
|
1590
|
+
}
|
|
1591
|
+
return writer;
|
|
1592
|
+
},
|
|
1593
|
+
decode(input, length) {
|
|
1594
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1595
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1596
|
+
const message = createBaseMultisigAction_SignaturesEntry();
|
|
1597
|
+
while (reader.pos < end) {
|
|
1598
|
+
const tag = reader.uint32();
|
|
1599
|
+
switch (tag >>> 3) {
|
|
1600
|
+
case 1: {
|
|
1601
|
+
if (tag !== 10) {
|
|
1602
|
+
break;
|
|
1603
|
+
}
|
|
1604
|
+
message.key = reader.string();
|
|
1605
|
+
continue;
|
|
1606
|
+
}
|
|
1607
|
+
case 2: {
|
|
1608
|
+
if (tag !== 16) {
|
|
1609
|
+
break;
|
|
1610
|
+
}
|
|
1611
|
+
message.value = longToNumber(reader.int64());
|
|
1612
|
+
continue;
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1616
|
+
break;
|
|
1617
|
+
}
|
|
1618
|
+
reader.skip(tag & 7);
|
|
1619
|
+
}
|
|
1620
|
+
return message;
|
|
1621
|
+
},
|
|
1622
|
+
fromJSON(object) {
|
|
1623
|
+
return {
|
|
1624
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
1625
|
+
value: isSet(object.value) ? globalThis.Number(object.value) : 0,
|
|
1626
|
+
};
|
|
1627
|
+
},
|
|
1628
|
+
toJSON(message) {
|
|
1629
|
+
const obj = {};
|
|
1630
|
+
if (message.key !== "") {
|
|
1631
|
+
obj.key = message.key;
|
|
1632
|
+
}
|
|
1633
|
+
if (message.value !== 0) {
|
|
1634
|
+
obj.value = Math.round(message.value);
|
|
1635
|
+
}
|
|
1636
|
+
return obj;
|
|
1637
|
+
},
|
|
1638
|
+
create(base) {
|
|
1639
|
+
return MultisigAction_SignaturesEntry.fromPartial(base ?? {});
|
|
1640
|
+
},
|
|
1641
|
+
fromPartial(object) {
|
|
1642
|
+
const message = createBaseMultisigAction_SignaturesEntry();
|
|
1643
|
+
message.key = object.key ?? "";
|
|
1644
|
+
message.value = object.value ?? 0;
|
|
1645
|
+
return message;
|
|
1646
|
+
},
|
|
1647
|
+
};
|
|
1648
|
+
function createBaseTokenDAO() {
|
|
1649
|
+
return {
|
|
1650
|
+
name: "",
|
|
1651
|
+
tokenId: "",
|
|
1652
|
+
balances: {},
|
|
1653
|
+
delegations: {},
|
|
1654
|
+
proposalThreshold: 0,
|
|
1655
|
+
votingPeriodMs: 0,
|
|
1656
|
+
timelockMs: 0,
|
|
1657
|
+
quorum: 0,
|
|
1658
|
+
proposal: undefined,
|
|
1659
|
+
votes: undefined,
|
|
1660
|
+
executedProposals: [],
|
|
1661
|
+
rejectedProposals: [],
|
|
1662
|
+
cancelledProposals: [],
|
|
1663
|
+
metadata: undefined,
|
|
1664
|
+
status: DAOStatus.DAO_STATUS_UNSPECIFIED,
|
|
1665
|
+
};
|
|
1666
|
+
}
|
|
1667
|
+
export const TokenDAO = {
|
|
1668
|
+
encode(message, writer = new BinaryWriter()) {
|
|
1669
|
+
if (message.name !== "") {
|
|
1670
|
+
writer.uint32(10).string(message.name);
|
|
1671
|
+
}
|
|
1672
|
+
if (message.tokenId !== "") {
|
|
1673
|
+
writer.uint32(18).string(message.tokenId);
|
|
1674
|
+
}
|
|
1675
|
+
globalThis.Object.entries(message.balances).forEach(([key, value]) => {
|
|
1676
|
+
TokenDAO_BalancesEntry.encode({ key: key, value }, writer.uint32(26).fork()).join();
|
|
1677
|
+
});
|
|
1678
|
+
globalThis.Object.entries(message.delegations).forEach(([key, value]) => {
|
|
1679
|
+
TokenDAO_DelegationsEntry.encode({ key: key, value }, writer.uint32(34).fork()).join();
|
|
1680
|
+
});
|
|
1681
|
+
if (message.proposalThreshold !== 0) {
|
|
1682
|
+
writer.uint32(40).int64(message.proposalThreshold);
|
|
1683
|
+
}
|
|
1684
|
+
if (message.votingPeriodMs !== 0) {
|
|
1685
|
+
writer.uint32(48).int64(message.votingPeriodMs);
|
|
1686
|
+
}
|
|
1687
|
+
if (message.timelockMs !== 0) {
|
|
1688
|
+
writer.uint32(56).int64(message.timelockMs);
|
|
1689
|
+
}
|
|
1690
|
+
if (message.quorum !== 0) {
|
|
1691
|
+
writer.uint32(64).int64(message.quorum);
|
|
1692
|
+
}
|
|
1693
|
+
if (message.proposal !== undefined) {
|
|
1694
|
+
Proposal.encode(message.proposal, writer.uint32(74).fork()).join();
|
|
1695
|
+
}
|
|
1696
|
+
if (message.votes !== undefined) {
|
|
1697
|
+
VoteTally.encode(message.votes, writer.uint32(82).fork()).join();
|
|
1698
|
+
}
|
|
1699
|
+
for (const v of message.executedProposals) {
|
|
1700
|
+
TokenProposalResult.encode(v, writer.uint32(90).fork()).join();
|
|
1701
|
+
}
|
|
1702
|
+
for (const v of message.rejectedProposals) {
|
|
1703
|
+
TokenProposalResult.encode(v, writer.uint32(98).fork()).join();
|
|
1704
|
+
}
|
|
1705
|
+
for (const v of message.cancelledProposals) {
|
|
1706
|
+
Proposal.encode(v, writer.uint32(106).fork()).join();
|
|
1707
|
+
}
|
|
1708
|
+
if (message.metadata !== undefined) {
|
|
1709
|
+
DAOMetadata.encode(message.metadata, writer.uint32(114).fork()).join();
|
|
1710
|
+
}
|
|
1711
|
+
if (message.status !== DAOStatus.DAO_STATUS_UNSPECIFIED) {
|
|
1712
|
+
writer.uint32(120).int32(dAOStatusToNumber(message.status));
|
|
1713
|
+
}
|
|
1714
|
+
return writer;
|
|
1715
|
+
},
|
|
1716
|
+
decode(input, length) {
|
|
1717
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
1718
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
1719
|
+
const message = createBaseTokenDAO();
|
|
1720
|
+
while (reader.pos < end) {
|
|
1721
|
+
const tag = reader.uint32();
|
|
1722
|
+
switch (tag >>> 3) {
|
|
1723
|
+
case 1: {
|
|
1724
|
+
if (tag !== 10) {
|
|
1725
|
+
break;
|
|
1726
|
+
}
|
|
1727
|
+
message.name = reader.string();
|
|
1728
|
+
continue;
|
|
1729
|
+
}
|
|
1730
|
+
case 2: {
|
|
1731
|
+
if (tag !== 18) {
|
|
1732
|
+
break;
|
|
1733
|
+
}
|
|
1734
|
+
message.tokenId = reader.string();
|
|
1735
|
+
continue;
|
|
1736
|
+
}
|
|
1737
|
+
case 3: {
|
|
1738
|
+
if (tag !== 26) {
|
|
1739
|
+
break;
|
|
1740
|
+
}
|
|
1741
|
+
const entry3 = TokenDAO_BalancesEntry.decode(reader, reader.uint32());
|
|
1742
|
+
if (entry3.value !== undefined) {
|
|
1743
|
+
message.balances[entry3.key] = entry3.value;
|
|
1744
|
+
}
|
|
1745
|
+
continue;
|
|
1746
|
+
}
|
|
1747
|
+
case 4: {
|
|
1748
|
+
if (tag !== 34) {
|
|
1749
|
+
break;
|
|
1750
|
+
}
|
|
1751
|
+
const entry4 = TokenDAO_DelegationsEntry.decode(reader, reader.uint32());
|
|
1752
|
+
if (entry4.value !== undefined) {
|
|
1753
|
+
message.delegations[entry4.key] = entry4.value;
|
|
1754
|
+
}
|
|
1755
|
+
continue;
|
|
1756
|
+
}
|
|
1757
|
+
case 5: {
|
|
1758
|
+
if (tag !== 40) {
|
|
1759
|
+
break;
|
|
1760
|
+
}
|
|
1761
|
+
message.proposalThreshold = longToNumber(reader.int64());
|
|
1762
|
+
continue;
|
|
1763
|
+
}
|
|
1764
|
+
case 6: {
|
|
1765
|
+
if (tag !== 48) {
|
|
1766
|
+
break;
|
|
1767
|
+
}
|
|
1768
|
+
message.votingPeriodMs = longToNumber(reader.int64());
|
|
1769
|
+
continue;
|
|
1770
|
+
}
|
|
1771
|
+
case 7: {
|
|
1772
|
+
if (tag !== 56) {
|
|
1773
|
+
break;
|
|
1774
|
+
}
|
|
1775
|
+
message.timelockMs = longToNumber(reader.int64());
|
|
1776
|
+
continue;
|
|
1777
|
+
}
|
|
1778
|
+
case 8: {
|
|
1779
|
+
if (tag !== 64) {
|
|
1780
|
+
break;
|
|
1781
|
+
}
|
|
1782
|
+
message.quorum = longToNumber(reader.int64());
|
|
1783
|
+
continue;
|
|
1784
|
+
}
|
|
1785
|
+
case 9: {
|
|
1786
|
+
if (tag !== 74) {
|
|
1787
|
+
break;
|
|
1788
|
+
}
|
|
1789
|
+
message.proposal = Proposal.decode(reader, reader.uint32());
|
|
1790
|
+
continue;
|
|
1791
|
+
}
|
|
1792
|
+
case 10: {
|
|
1793
|
+
if (tag !== 82) {
|
|
1794
|
+
break;
|
|
1795
|
+
}
|
|
1796
|
+
message.votes = VoteTally.decode(reader, reader.uint32());
|
|
1797
|
+
continue;
|
|
1798
|
+
}
|
|
1799
|
+
case 11: {
|
|
1800
|
+
if (tag !== 90) {
|
|
1801
|
+
break;
|
|
1802
|
+
}
|
|
1803
|
+
message.executedProposals.push(TokenProposalResult.decode(reader, reader.uint32()));
|
|
1804
|
+
continue;
|
|
1805
|
+
}
|
|
1806
|
+
case 12: {
|
|
1807
|
+
if (tag !== 98) {
|
|
1808
|
+
break;
|
|
1809
|
+
}
|
|
1810
|
+
message.rejectedProposals.push(TokenProposalResult.decode(reader, reader.uint32()));
|
|
1811
|
+
continue;
|
|
1812
|
+
}
|
|
1813
|
+
case 13: {
|
|
1814
|
+
if (tag !== 106) {
|
|
1815
|
+
break;
|
|
1816
|
+
}
|
|
1817
|
+
message.cancelledProposals.push(Proposal.decode(reader, reader.uint32()));
|
|
1818
|
+
continue;
|
|
1819
|
+
}
|
|
1820
|
+
case 14: {
|
|
1821
|
+
if (tag !== 114) {
|
|
1822
|
+
break;
|
|
1823
|
+
}
|
|
1824
|
+
message.metadata = DAOMetadata.decode(reader, reader.uint32());
|
|
1825
|
+
continue;
|
|
1826
|
+
}
|
|
1827
|
+
case 15: {
|
|
1828
|
+
if (tag !== 120) {
|
|
1829
|
+
break;
|
|
1830
|
+
}
|
|
1831
|
+
message.status = dAOStatusFromJSON(reader.int32());
|
|
1832
|
+
continue;
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1836
|
+
break;
|
|
1837
|
+
}
|
|
1838
|
+
reader.skip(tag & 7);
|
|
1839
|
+
}
|
|
1840
|
+
return message;
|
|
1841
|
+
},
|
|
1842
|
+
fromJSON(object) {
|
|
1843
|
+
return {
|
|
1844
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
1845
|
+
tokenId: isSet(object.tokenId)
|
|
1846
|
+
? globalThis.String(object.tokenId)
|
|
1847
|
+
: isSet(object.token_id)
|
|
1848
|
+
? globalThis.String(object.token_id)
|
|
1849
|
+
: "",
|
|
1850
|
+
balances: isObject(object.balances)
|
|
1851
|
+
? globalThis.Object.entries(object.balances).reduce((acc, [key, value]) => {
|
|
1852
|
+
acc[key] = globalThis.Number(value);
|
|
1853
|
+
return acc;
|
|
1854
|
+
}, {})
|
|
1855
|
+
: {},
|
|
1856
|
+
delegations: isObject(object.delegations)
|
|
1857
|
+
? globalThis.Object.entries(object.delegations).reduce((acc, [key, value]) => {
|
|
1858
|
+
acc[key] = globalThis.String(value);
|
|
1859
|
+
return acc;
|
|
1860
|
+
}, {})
|
|
1861
|
+
: {},
|
|
1862
|
+
proposalThreshold: isSet(object.proposalThreshold)
|
|
1863
|
+
? globalThis.Number(object.proposalThreshold)
|
|
1864
|
+
: isSet(object.proposal_threshold)
|
|
1865
|
+
? globalThis.Number(object.proposal_threshold)
|
|
1866
|
+
: 0,
|
|
1867
|
+
votingPeriodMs: isSet(object.votingPeriodMs)
|
|
1868
|
+
? globalThis.Number(object.votingPeriodMs)
|
|
1869
|
+
: isSet(object.voting_period_ms)
|
|
1870
|
+
? globalThis.Number(object.voting_period_ms)
|
|
1871
|
+
: 0,
|
|
1872
|
+
timelockMs: isSet(object.timelockMs)
|
|
1873
|
+
? globalThis.Number(object.timelockMs)
|
|
1874
|
+
: isSet(object.timelock_ms)
|
|
1875
|
+
? globalThis.Number(object.timelock_ms)
|
|
1876
|
+
: 0,
|
|
1877
|
+
quorum: isSet(object.quorum) ? globalThis.Number(object.quorum) : 0,
|
|
1878
|
+
proposal: isSet(object.proposal) ? Proposal.fromJSON(object.proposal) : undefined,
|
|
1879
|
+
votes: isSet(object.votes) ? VoteTally.fromJSON(object.votes) : undefined,
|
|
1880
|
+
executedProposals: globalThis.Array.isArray(object?.executedProposals)
|
|
1881
|
+
? object.executedProposals.map((e) => TokenProposalResult.fromJSON(e))
|
|
1882
|
+
: globalThis.Array.isArray(object?.executed_proposals)
|
|
1883
|
+
? object.executed_proposals.map((e) => TokenProposalResult.fromJSON(e))
|
|
1884
|
+
: [],
|
|
1885
|
+
rejectedProposals: globalThis.Array.isArray(object?.rejectedProposals)
|
|
1886
|
+
? object.rejectedProposals.map((e) => TokenProposalResult.fromJSON(e))
|
|
1887
|
+
: globalThis.Array.isArray(object?.rejected_proposals)
|
|
1888
|
+
? object.rejected_proposals.map((e) => TokenProposalResult.fromJSON(e))
|
|
1889
|
+
: [],
|
|
1890
|
+
cancelledProposals: globalThis.Array.isArray(object?.cancelledProposals)
|
|
1891
|
+
? object.cancelledProposals.map((e) => Proposal.fromJSON(e))
|
|
1892
|
+
: globalThis.Array.isArray(object?.cancelled_proposals)
|
|
1893
|
+
? object.cancelled_proposals.map((e) => Proposal.fromJSON(e))
|
|
1894
|
+
: [],
|
|
1895
|
+
metadata: isSet(object.metadata) ? DAOMetadata.fromJSON(object.metadata) : undefined,
|
|
1896
|
+
status: isSet(object.status) ? dAOStatusFromJSON(object.status) : DAOStatus.DAO_STATUS_UNSPECIFIED,
|
|
1897
|
+
};
|
|
1898
|
+
},
|
|
1899
|
+
toJSON(message) {
|
|
1900
|
+
const obj = {};
|
|
1901
|
+
if (message.name !== "") {
|
|
1902
|
+
obj.name = message.name;
|
|
1903
|
+
}
|
|
1904
|
+
if (message.tokenId !== "") {
|
|
1905
|
+
obj.tokenId = message.tokenId;
|
|
1906
|
+
}
|
|
1907
|
+
if (message.balances) {
|
|
1908
|
+
const entries = globalThis.Object.entries(message.balances);
|
|
1909
|
+
if (entries.length > 0) {
|
|
1910
|
+
obj.balances = {};
|
|
1911
|
+
entries.forEach(([k, v]) => {
|
|
1912
|
+
obj.balances[k] = Math.round(v);
|
|
1913
|
+
});
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1916
|
+
if (message.delegations) {
|
|
1917
|
+
const entries = globalThis.Object.entries(message.delegations);
|
|
1918
|
+
if (entries.length > 0) {
|
|
1919
|
+
obj.delegations = {};
|
|
1920
|
+
entries.forEach(([k, v]) => {
|
|
1921
|
+
obj.delegations[k] = v;
|
|
1922
|
+
});
|
|
1923
|
+
}
|
|
1924
|
+
}
|
|
1925
|
+
if (message.proposalThreshold !== 0) {
|
|
1926
|
+
obj.proposalThreshold = Math.round(message.proposalThreshold);
|
|
1927
|
+
}
|
|
1928
|
+
if (message.votingPeriodMs !== 0) {
|
|
1929
|
+
obj.votingPeriodMs = Math.round(message.votingPeriodMs);
|
|
1930
|
+
}
|
|
1931
|
+
if (message.timelockMs !== 0) {
|
|
1932
|
+
obj.timelockMs = Math.round(message.timelockMs);
|
|
1933
|
+
}
|
|
1934
|
+
if (message.quorum !== 0) {
|
|
1935
|
+
obj.quorum = Math.round(message.quorum);
|
|
1936
|
+
}
|
|
1937
|
+
if (message.proposal !== undefined) {
|
|
1938
|
+
obj.proposal = Proposal.toJSON(message.proposal);
|
|
1939
|
+
}
|
|
1940
|
+
if (message.votes !== undefined) {
|
|
1941
|
+
obj.votes = VoteTally.toJSON(message.votes);
|
|
1942
|
+
}
|
|
1943
|
+
if (message.executedProposals?.length) {
|
|
1944
|
+
obj.executedProposals = message.executedProposals.map((e) => TokenProposalResult.toJSON(e));
|
|
1945
|
+
}
|
|
1946
|
+
if (message.rejectedProposals?.length) {
|
|
1947
|
+
obj.rejectedProposals = message.rejectedProposals.map((e) => TokenProposalResult.toJSON(e));
|
|
1948
|
+
}
|
|
1949
|
+
if (message.cancelledProposals?.length) {
|
|
1950
|
+
obj.cancelledProposals = message.cancelledProposals.map((e) => Proposal.toJSON(e));
|
|
1951
|
+
}
|
|
1952
|
+
if (message.metadata !== undefined) {
|
|
1953
|
+
obj.metadata = DAOMetadata.toJSON(message.metadata);
|
|
1954
|
+
}
|
|
1955
|
+
if (message.status !== DAOStatus.DAO_STATUS_UNSPECIFIED) {
|
|
1956
|
+
obj.status = dAOStatusToJSON(message.status);
|
|
1957
|
+
}
|
|
1958
|
+
return obj;
|
|
1959
|
+
},
|
|
1960
|
+
create(base) {
|
|
1961
|
+
return TokenDAO.fromPartial(base ?? {});
|
|
1962
|
+
},
|
|
1963
|
+
fromPartial(object) {
|
|
1964
|
+
const message = createBaseTokenDAO();
|
|
1965
|
+
message.name = object.name ?? "";
|
|
1966
|
+
message.tokenId = object.tokenId ?? "";
|
|
1967
|
+
message.balances = globalThis.Object.entries(object.balances ?? {}).reduce((acc, [key, value]) => {
|
|
1968
|
+
if (value !== undefined) {
|
|
1969
|
+
acc[key] = globalThis.Number(value);
|
|
1970
|
+
}
|
|
1971
|
+
return acc;
|
|
1972
|
+
}, {});
|
|
1973
|
+
message.delegations = globalThis.Object.entries(object.delegations ?? {}).reduce((acc, [key, value]) => {
|
|
1974
|
+
if (value !== undefined) {
|
|
1975
|
+
acc[key] = globalThis.String(value);
|
|
1976
|
+
}
|
|
1977
|
+
return acc;
|
|
1978
|
+
}, {});
|
|
1979
|
+
message.proposalThreshold = object.proposalThreshold ?? 0;
|
|
1980
|
+
message.votingPeriodMs = object.votingPeriodMs ?? 0;
|
|
1981
|
+
message.timelockMs = object.timelockMs ?? 0;
|
|
1982
|
+
message.quorum = object.quorum ?? 0;
|
|
1983
|
+
message.proposal = (object.proposal !== undefined && object.proposal !== null)
|
|
1984
|
+
? Proposal.fromPartial(object.proposal)
|
|
1985
|
+
: undefined;
|
|
1986
|
+
message.votes = (object.votes !== undefined && object.votes !== null)
|
|
1987
|
+
? VoteTally.fromPartial(object.votes)
|
|
1988
|
+
: undefined;
|
|
1989
|
+
message.executedProposals = object.executedProposals?.map((e) => TokenProposalResult.fromPartial(e)) || [];
|
|
1990
|
+
message.rejectedProposals = object.rejectedProposals?.map((e) => TokenProposalResult.fromPartial(e)) || [];
|
|
1991
|
+
message.cancelledProposals = object.cancelledProposals?.map((e) => Proposal.fromPartial(e)) || [];
|
|
1992
|
+
message.metadata = (object.metadata !== undefined && object.metadata !== null)
|
|
1993
|
+
? DAOMetadata.fromPartial(object.metadata)
|
|
1994
|
+
: undefined;
|
|
1995
|
+
message.status = object.status ?? DAOStatus.DAO_STATUS_UNSPECIFIED;
|
|
1996
|
+
return message;
|
|
1997
|
+
},
|
|
1998
|
+
};
|
|
1999
|
+
function createBaseTokenDAO_BalancesEntry() {
|
|
2000
|
+
return { key: "", value: 0 };
|
|
2001
|
+
}
|
|
2002
|
+
export const TokenDAO_BalancesEntry = {
|
|
2003
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2004
|
+
if (message.key !== "") {
|
|
2005
|
+
writer.uint32(10).string(message.key);
|
|
2006
|
+
}
|
|
2007
|
+
if (message.value !== 0) {
|
|
2008
|
+
writer.uint32(16).int64(message.value);
|
|
2009
|
+
}
|
|
2010
|
+
return writer;
|
|
2011
|
+
},
|
|
2012
|
+
decode(input, length) {
|
|
2013
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2014
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2015
|
+
const message = createBaseTokenDAO_BalancesEntry();
|
|
2016
|
+
while (reader.pos < end) {
|
|
2017
|
+
const tag = reader.uint32();
|
|
2018
|
+
switch (tag >>> 3) {
|
|
2019
|
+
case 1: {
|
|
2020
|
+
if (tag !== 10) {
|
|
2021
|
+
break;
|
|
2022
|
+
}
|
|
2023
|
+
message.key = reader.string();
|
|
2024
|
+
continue;
|
|
2025
|
+
}
|
|
2026
|
+
case 2: {
|
|
2027
|
+
if (tag !== 16) {
|
|
2028
|
+
break;
|
|
2029
|
+
}
|
|
2030
|
+
message.value = longToNumber(reader.int64());
|
|
2031
|
+
continue;
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2035
|
+
break;
|
|
2036
|
+
}
|
|
2037
|
+
reader.skip(tag & 7);
|
|
2038
|
+
}
|
|
2039
|
+
return message;
|
|
2040
|
+
},
|
|
2041
|
+
fromJSON(object) {
|
|
2042
|
+
return {
|
|
2043
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
2044
|
+
value: isSet(object.value) ? globalThis.Number(object.value) : 0,
|
|
2045
|
+
};
|
|
2046
|
+
},
|
|
2047
|
+
toJSON(message) {
|
|
2048
|
+
const obj = {};
|
|
2049
|
+
if (message.key !== "") {
|
|
2050
|
+
obj.key = message.key;
|
|
2051
|
+
}
|
|
2052
|
+
if (message.value !== 0) {
|
|
2053
|
+
obj.value = Math.round(message.value);
|
|
2054
|
+
}
|
|
2055
|
+
return obj;
|
|
2056
|
+
},
|
|
2057
|
+
create(base) {
|
|
2058
|
+
return TokenDAO_BalancesEntry.fromPartial(base ?? {});
|
|
2059
|
+
},
|
|
2060
|
+
fromPartial(object) {
|
|
2061
|
+
const message = createBaseTokenDAO_BalancesEntry();
|
|
2062
|
+
message.key = object.key ?? "";
|
|
2063
|
+
message.value = object.value ?? 0;
|
|
2064
|
+
return message;
|
|
2065
|
+
},
|
|
2066
|
+
};
|
|
2067
|
+
function createBaseTokenDAO_DelegationsEntry() {
|
|
2068
|
+
return { key: "", value: "" };
|
|
2069
|
+
}
|
|
2070
|
+
export const TokenDAO_DelegationsEntry = {
|
|
2071
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2072
|
+
if (message.key !== "") {
|
|
2073
|
+
writer.uint32(10).string(message.key);
|
|
2074
|
+
}
|
|
2075
|
+
if (message.value !== "") {
|
|
2076
|
+
writer.uint32(18).string(message.value);
|
|
2077
|
+
}
|
|
2078
|
+
return writer;
|
|
2079
|
+
},
|
|
2080
|
+
decode(input, length) {
|
|
2081
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2082
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2083
|
+
const message = createBaseTokenDAO_DelegationsEntry();
|
|
2084
|
+
while (reader.pos < end) {
|
|
2085
|
+
const tag = reader.uint32();
|
|
2086
|
+
switch (tag >>> 3) {
|
|
2087
|
+
case 1: {
|
|
2088
|
+
if (tag !== 10) {
|
|
2089
|
+
break;
|
|
2090
|
+
}
|
|
2091
|
+
message.key = reader.string();
|
|
2092
|
+
continue;
|
|
2093
|
+
}
|
|
2094
|
+
case 2: {
|
|
2095
|
+
if (tag !== 18) {
|
|
2096
|
+
break;
|
|
2097
|
+
}
|
|
2098
|
+
message.value = reader.string();
|
|
2099
|
+
continue;
|
|
2100
|
+
}
|
|
2101
|
+
}
|
|
2102
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2103
|
+
break;
|
|
2104
|
+
}
|
|
2105
|
+
reader.skip(tag & 7);
|
|
2106
|
+
}
|
|
2107
|
+
return message;
|
|
2108
|
+
},
|
|
2109
|
+
fromJSON(object) {
|
|
2110
|
+
return {
|
|
2111
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
2112
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
2113
|
+
};
|
|
2114
|
+
},
|
|
2115
|
+
toJSON(message) {
|
|
2116
|
+
const obj = {};
|
|
2117
|
+
if (message.key !== "") {
|
|
2118
|
+
obj.key = message.key;
|
|
2119
|
+
}
|
|
2120
|
+
if (message.value !== "") {
|
|
2121
|
+
obj.value = message.value;
|
|
2122
|
+
}
|
|
2123
|
+
return obj;
|
|
2124
|
+
},
|
|
2125
|
+
create(base) {
|
|
2126
|
+
return TokenDAO_DelegationsEntry.fromPartial(base ?? {});
|
|
2127
|
+
},
|
|
2128
|
+
fromPartial(object) {
|
|
2129
|
+
const message = createBaseTokenDAO_DelegationsEntry();
|
|
2130
|
+
message.key = object.key ?? "";
|
|
2131
|
+
message.value = object.value ?? "";
|
|
2132
|
+
return message;
|
|
2133
|
+
},
|
|
2134
|
+
};
|
|
2135
|
+
function createBaseTokenProposalResult() {
|
|
2136
|
+
return { proposal: undefined, votes: undefined, finalizedAt: undefined };
|
|
2137
|
+
}
|
|
2138
|
+
export const TokenProposalResult = {
|
|
2139
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2140
|
+
if (message.proposal !== undefined) {
|
|
2141
|
+
Proposal.encode(message.proposal, writer.uint32(10).fork()).join();
|
|
2142
|
+
}
|
|
2143
|
+
if (message.votes !== undefined) {
|
|
2144
|
+
VoteTally.encode(message.votes, writer.uint32(18).fork()).join();
|
|
2145
|
+
}
|
|
2146
|
+
if (message.finalizedAt !== undefined) {
|
|
2147
|
+
Timestamp.encode(toTimestamp(message.finalizedAt), writer.uint32(26).fork()).join();
|
|
2148
|
+
}
|
|
2149
|
+
return writer;
|
|
2150
|
+
},
|
|
2151
|
+
decode(input, length) {
|
|
2152
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2153
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2154
|
+
const message = createBaseTokenProposalResult();
|
|
2155
|
+
while (reader.pos < end) {
|
|
2156
|
+
const tag = reader.uint32();
|
|
2157
|
+
switch (tag >>> 3) {
|
|
2158
|
+
case 1: {
|
|
2159
|
+
if (tag !== 10) {
|
|
2160
|
+
break;
|
|
2161
|
+
}
|
|
2162
|
+
message.proposal = Proposal.decode(reader, reader.uint32());
|
|
2163
|
+
continue;
|
|
2164
|
+
}
|
|
2165
|
+
case 2: {
|
|
2166
|
+
if (tag !== 18) {
|
|
2167
|
+
break;
|
|
2168
|
+
}
|
|
2169
|
+
message.votes = VoteTally.decode(reader, reader.uint32());
|
|
2170
|
+
continue;
|
|
2171
|
+
}
|
|
2172
|
+
case 3: {
|
|
2173
|
+
if (tag !== 26) {
|
|
2174
|
+
break;
|
|
2175
|
+
}
|
|
2176
|
+
message.finalizedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
2177
|
+
continue;
|
|
2178
|
+
}
|
|
2179
|
+
}
|
|
2180
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2181
|
+
break;
|
|
2182
|
+
}
|
|
2183
|
+
reader.skip(tag & 7);
|
|
2184
|
+
}
|
|
2185
|
+
return message;
|
|
2186
|
+
},
|
|
2187
|
+
fromJSON(object) {
|
|
2188
|
+
return {
|
|
2189
|
+
proposal: isSet(object.proposal) ? Proposal.fromJSON(object.proposal) : undefined,
|
|
2190
|
+
votes: isSet(object.votes) ? VoteTally.fromJSON(object.votes) : undefined,
|
|
2191
|
+
finalizedAt: isSet(object.finalizedAt)
|
|
2192
|
+
? fromJsonTimestamp(object.finalizedAt)
|
|
2193
|
+
: isSet(object.finalized_at)
|
|
2194
|
+
? fromJsonTimestamp(object.finalized_at)
|
|
2195
|
+
: undefined,
|
|
2196
|
+
};
|
|
2197
|
+
},
|
|
2198
|
+
toJSON(message) {
|
|
2199
|
+
const obj = {};
|
|
2200
|
+
if (message.proposal !== undefined) {
|
|
2201
|
+
obj.proposal = Proposal.toJSON(message.proposal);
|
|
2202
|
+
}
|
|
2203
|
+
if (message.votes !== undefined) {
|
|
2204
|
+
obj.votes = VoteTally.toJSON(message.votes);
|
|
2205
|
+
}
|
|
2206
|
+
if (message.finalizedAt !== undefined) {
|
|
2207
|
+
obj.finalizedAt = message.finalizedAt.toISOString();
|
|
2208
|
+
}
|
|
2209
|
+
return obj;
|
|
2210
|
+
},
|
|
2211
|
+
create(base) {
|
|
2212
|
+
return TokenProposalResult.fromPartial(base ?? {});
|
|
2213
|
+
},
|
|
2214
|
+
fromPartial(object) {
|
|
2215
|
+
const message = createBaseTokenProposalResult();
|
|
2216
|
+
message.proposal = (object.proposal !== undefined && object.proposal !== null)
|
|
2217
|
+
? Proposal.fromPartial(object.proposal)
|
|
2218
|
+
: undefined;
|
|
2219
|
+
message.votes = (object.votes !== undefined && object.votes !== null)
|
|
2220
|
+
? VoteTally.fromPartial(object.votes)
|
|
2221
|
+
: undefined;
|
|
2222
|
+
message.finalizedAt = object.finalizedAt ?? undefined;
|
|
2223
|
+
return message;
|
|
2224
|
+
},
|
|
2225
|
+
};
|
|
2226
|
+
function createBaseThresholdDAO() {
|
|
2227
|
+
return {
|
|
2228
|
+
name: "",
|
|
2229
|
+
members: [],
|
|
2230
|
+
memberJoinedAt: {},
|
|
2231
|
+
memberThreshold: 0,
|
|
2232
|
+
voteThreshold: 0,
|
|
2233
|
+
proposeThreshold: 0,
|
|
2234
|
+
quorum: 0,
|
|
2235
|
+
votingPeriodMs: 0,
|
|
2236
|
+
proposal: undefined,
|
|
2237
|
+
votes: undefined,
|
|
2238
|
+
history: [],
|
|
2239
|
+
metadata: undefined,
|
|
2240
|
+
status: DAOStatus.DAO_STATUS_UNSPECIFIED,
|
|
2241
|
+
};
|
|
2242
|
+
}
|
|
2243
|
+
export const ThresholdDAO = {
|
|
2244
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2245
|
+
if (message.name !== "") {
|
|
2246
|
+
writer.uint32(10).string(message.name);
|
|
2247
|
+
}
|
|
2248
|
+
for (const v of message.members) {
|
|
2249
|
+
writer.uint32(18).string(v);
|
|
2250
|
+
}
|
|
2251
|
+
globalThis.Object.entries(message.memberJoinedAt).forEach(([key, value]) => {
|
|
2252
|
+
ThresholdDAO_MemberJoinedAtEntry.encode({ key: key, value }, writer.uint32(26).fork()).join();
|
|
2253
|
+
});
|
|
2254
|
+
if (message.memberThreshold !== 0) {
|
|
2255
|
+
writer.uint32(32).int64(message.memberThreshold);
|
|
2256
|
+
}
|
|
2257
|
+
if (message.voteThreshold !== 0) {
|
|
2258
|
+
writer.uint32(40).int64(message.voteThreshold);
|
|
2259
|
+
}
|
|
2260
|
+
if (message.proposeThreshold !== 0) {
|
|
2261
|
+
writer.uint32(48).int64(message.proposeThreshold);
|
|
2262
|
+
}
|
|
2263
|
+
if (message.quorum !== 0) {
|
|
2264
|
+
writer.uint32(56).int64(message.quorum);
|
|
2265
|
+
}
|
|
2266
|
+
if (message.votingPeriodMs !== 0) {
|
|
2267
|
+
writer.uint32(64).int64(message.votingPeriodMs);
|
|
2268
|
+
}
|
|
2269
|
+
if (message.proposal !== undefined) {
|
|
2270
|
+
Proposal.encode(message.proposal, writer.uint32(74).fork()).join();
|
|
2271
|
+
}
|
|
2272
|
+
if (message.votes !== undefined) {
|
|
2273
|
+
ThresholdVotes.encode(message.votes, writer.uint32(82).fork()).join();
|
|
2274
|
+
}
|
|
2275
|
+
for (const v of message.history) {
|
|
2276
|
+
ThresholdHistoryEntry.encode(v, writer.uint32(90).fork()).join();
|
|
2277
|
+
}
|
|
2278
|
+
if (message.metadata !== undefined) {
|
|
2279
|
+
DAOMetadata.encode(message.metadata, writer.uint32(98).fork()).join();
|
|
2280
|
+
}
|
|
2281
|
+
if (message.status !== DAOStatus.DAO_STATUS_UNSPECIFIED) {
|
|
2282
|
+
writer.uint32(104).int32(dAOStatusToNumber(message.status));
|
|
2283
|
+
}
|
|
2284
|
+
return writer;
|
|
2285
|
+
},
|
|
2286
|
+
decode(input, length) {
|
|
2287
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2288
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2289
|
+
const message = createBaseThresholdDAO();
|
|
2290
|
+
while (reader.pos < end) {
|
|
2291
|
+
const tag = reader.uint32();
|
|
2292
|
+
switch (tag >>> 3) {
|
|
2293
|
+
case 1: {
|
|
2294
|
+
if (tag !== 10) {
|
|
2295
|
+
break;
|
|
2296
|
+
}
|
|
2297
|
+
message.name = reader.string();
|
|
2298
|
+
continue;
|
|
2299
|
+
}
|
|
2300
|
+
case 2: {
|
|
2301
|
+
if (tag !== 18) {
|
|
2302
|
+
break;
|
|
2303
|
+
}
|
|
2304
|
+
message.members.push(reader.string());
|
|
2305
|
+
continue;
|
|
2306
|
+
}
|
|
2307
|
+
case 3: {
|
|
2308
|
+
if (tag !== 26) {
|
|
2309
|
+
break;
|
|
2310
|
+
}
|
|
2311
|
+
const entry3 = ThresholdDAO_MemberJoinedAtEntry.decode(reader, reader.uint32());
|
|
2312
|
+
if (entry3.value !== undefined) {
|
|
2313
|
+
message.memberJoinedAt[entry3.key] = entry3.value;
|
|
2314
|
+
}
|
|
2315
|
+
continue;
|
|
2316
|
+
}
|
|
2317
|
+
case 4: {
|
|
2318
|
+
if (tag !== 32) {
|
|
2319
|
+
break;
|
|
2320
|
+
}
|
|
2321
|
+
message.memberThreshold = longToNumber(reader.int64());
|
|
2322
|
+
continue;
|
|
2323
|
+
}
|
|
2324
|
+
case 5: {
|
|
2325
|
+
if (tag !== 40) {
|
|
2326
|
+
break;
|
|
2327
|
+
}
|
|
2328
|
+
message.voteThreshold = longToNumber(reader.int64());
|
|
2329
|
+
continue;
|
|
2330
|
+
}
|
|
2331
|
+
case 6: {
|
|
2332
|
+
if (tag !== 48) {
|
|
2333
|
+
break;
|
|
2334
|
+
}
|
|
2335
|
+
message.proposeThreshold = longToNumber(reader.int64());
|
|
2336
|
+
continue;
|
|
2337
|
+
}
|
|
2338
|
+
case 7: {
|
|
2339
|
+
if (tag !== 56) {
|
|
2340
|
+
break;
|
|
2341
|
+
}
|
|
2342
|
+
message.quorum = longToNumber(reader.int64());
|
|
2343
|
+
continue;
|
|
2344
|
+
}
|
|
2345
|
+
case 8: {
|
|
2346
|
+
if (tag !== 64) {
|
|
2347
|
+
break;
|
|
2348
|
+
}
|
|
2349
|
+
message.votingPeriodMs = longToNumber(reader.int64());
|
|
2350
|
+
continue;
|
|
2351
|
+
}
|
|
2352
|
+
case 9: {
|
|
2353
|
+
if (tag !== 74) {
|
|
2354
|
+
break;
|
|
2355
|
+
}
|
|
2356
|
+
message.proposal = Proposal.decode(reader, reader.uint32());
|
|
2357
|
+
continue;
|
|
2358
|
+
}
|
|
2359
|
+
case 10: {
|
|
2360
|
+
if (tag !== 82) {
|
|
2361
|
+
break;
|
|
2362
|
+
}
|
|
2363
|
+
message.votes = ThresholdVotes.decode(reader, reader.uint32());
|
|
2364
|
+
continue;
|
|
2365
|
+
}
|
|
2366
|
+
case 11: {
|
|
2367
|
+
if (tag !== 90) {
|
|
2368
|
+
break;
|
|
2369
|
+
}
|
|
2370
|
+
message.history.push(ThresholdHistoryEntry.decode(reader, reader.uint32()));
|
|
2371
|
+
continue;
|
|
2372
|
+
}
|
|
2373
|
+
case 12: {
|
|
2374
|
+
if (tag !== 98) {
|
|
2375
|
+
break;
|
|
2376
|
+
}
|
|
2377
|
+
message.metadata = DAOMetadata.decode(reader, reader.uint32());
|
|
2378
|
+
continue;
|
|
2379
|
+
}
|
|
2380
|
+
case 13: {
|
|
2381
|
+
if (tag !== 104) {
|
|
2382
|
+
break;
|
|
2383
|
+
}
|
|
2384
|
+
message.status = dAOStatusFromJSON(reader.int32());
|
|
2385
|
+
continue;
|
|
2386
|
+
}
|
|
2387
|
+
}
|
|
2388
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2389
|
+
break;
|
|
2390
|
+
}
|
|
2391
|
+
reader.skip(tag & 7);
|
|
2392
|
+
}
|
|
2393
|
+
return message;
|
|
2394
|
+
},
|
|
2395
|
+
fromJSON(object) {
|
|
2396
|
+
return {
|
|
2397
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
2398
|
+
members: globalThis.Array.isArray(object?.members) ? object.members.map((e) => globalThis.String(e)) : [],
|
|
2399
|
+
memberJoinedAt: isObject(object.memberJoinedAt)
|
|
2400
|
+
? globalThis.Object.entries(object.memberJoinedAt).reduce((acc, [key, value]) => {
|
|
2401
|
+
acc[key] = globalThis.Number(value);
|
|
2402
|
+
return acc;
|
|
2403
|
+
}, {})
|
|
2404
|
+
: isObject(object.member_joined_at)
|
|
2405
|
+
? globalThis.Object.entries(object.member_joined_at).reduce((acc, [key, value]) => {
|
|
2406
|
+
acc[key] = globalThis.Number(value);
|
|
2407
|
+
return acc;
|
|
2408
|
+
}, {})
|
|
2409
|
+
: {},
|
|
2410
|
+
memberThreshold: isSet(object.memberThreshold)
|
|
2411
|
+
? globalThis.Number(object.memberThreshold)
|
|
2412
|
+
: isSet(object.member_threshold)
|
|
2413
|
+
? globalThis.Number(object.member_threshold)
|
|
2414
|
+
: 0,
|
|
2415
|
+
voteThreshold: isSet(object.voteThreshold)
|
|
2416
|
+
? globalThis.Number(object.voteThreshold)
|
|
2417
|
+
: isSet(object.vote_threshold)
|
|
2418
|
+
? globalThis.Number(object.vote_threshold)
|
|
2419
|
+
: 0,
|
|
2420
|
+
proposeThreshold: isSet(object.proposeThreshold)
|
|
2421
|
+
? globalThis.Number(object.proposeThreshold)
|
|
2422
|
+
: isSet(object.propose_threshold)
|
|
2423
|
+
? globalThis.Number(object.propose_threshold)
|
|
2424
|
+
: 0,
|
|
2425
|
+
quorum: isSet(object.quorum) ? globalThis.Number(object.quorum) : 0,
|
|
2426
|
+
votingPeriodMs: isSet(object.votingPeriodMs)
|
|
2427
|
+
? globalThis.Number(object.votingPeriodMs)
|
|
2428
|
+
: isSet(object.voting_period_ms)
|
|
2429
|
+
? globalThis.Number(object.voting_period_ms)
|
|
2430
|
+
: 0,
|
|
2431
|
+
proposal: isSet(object.proposal) ? Proposal.fromJSON(object.proposal) : undefined,
|
|
2432
|
+
votes: isSet(object.votes) ? ThresholdVotes.fromJSON(object.votes) : undefined,
|
|
2433
|
+
history: globalThis.Array.isArray(object?.history)
|
|
2434
|
+
? object.history.map((e) => ThresholdHistoryEntry.fromJSON(e))
|
|
2435
|
+
: [],
|
|
2436
|
+
metadata: isSet(object.metadata) ? DAOMetadata.fromJSON(object.metadata) : undefined,
|
|
2437
|
+
status: isSet(object.status) ? dAOStatusFromJSON(object.status) : DAOStatus.DAO_STATUS_UNSPECIFIED,
|
|
2438
|
+
};
|
|
2439
|
+
},
|
|
2440
|
+
toJSON(message) {
|
|
2441
|
+
const obj = {};
|
|
2442
|
+
if (message.name !== "") {
|
|
2443
|
+
obj.name = message.name;
|
|
2444
|
+
}
|
|
2445
|
+
if (message.members?.length) {
|
|
2446
|
+
obj.members = message.members;
|
|
2447
|
+
}
|
|
2448
|
+
if (message.memberJoinedAt) {
|
|
2449
|
+
const entries = globalThis.Object.entries(message.memberJoinedAt);
|
|
2450
|
+
if (entries.length > 0) {
|
|
2451
|
+
obj.memberJoinedAt = {};
|
|
2452
|
+
entries.forEach(([k, v]) => {
|
|
2453
|
+
obj.memberJoinedAt[k] = Math.round(v);
|
|
2454
|
+
});
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
if (message.memberThreshold !== 0) {
|
|
2458
|
+
obj.memberThreshold = Math.round(message.memberThreshold);
|
|
2459
|
+
}
|
|
2460
|
+
if (message.voteThreshold !== 0) {
|
|
2461
|
+
obj.voteThreshold = Math.round(message.voteThreshold);
|
|
2462
|
+
}
|
|
2463
|
+
if (message.proposeThreshold !== 0) {
|
|
2464
|
+
obj.proposeThreshold = Math.round(message.proposeThreshold);
|
|
2465
|
+
}
|
|
2466
|
+
if (message.quorum !== 0) {
|
|
2467
|
+
obj.quorum = Math.round(message.quorum);
|
|
2468
|
+
}
|
|
2469
|
+
if (message.votingPeriodMs !== 0) {
|
|
2470
|
+
obj.votingPeriodMs = Math.round(message.votingPeriodMs);
|
|
2471
|
+
}
|
|
2472
|
+
if (message.proposal !== undefined) {
|
|
2473
|
+
obj.proposal = Proposal.toJSON(message.proposal);
|
|
2474
|
+
}
|
|
2475
|
+
if (message.votes !== undefined) {
|
|
2476
|
+
obj.votes = ThresholdVotes.toJSON(message.votes);
|
|
2477
|
+
}
|
|
2478
|
+
if (message.history?.length) {
|
|
2479
|
+
obj.history = message.history.map((e) => ThresholdHistoryEntry.toJSON(e));
|
|
2480
|
+
}
|
|
2481
|
+
if (message.metadata !== undefined) {
|
|
2482
|
+
obj.metadata = DAOMetadata.toJSON(message.metadata);
|
|
2483
|
+
}
|
|
2484
|
+
if (message.status !== DAOStatus.DAO_STATUS_UNSPECIFIED) {
|
|
2485
|
+
obj.status = dAOStatusToJSON(message.status);
|
|
2486
|
+
}
|
|
2487
|
+
return obj;
|
|
2488
|
+
},
|
|
2489
|
+
create(base) {
|
|
2490
|
+
return ThresholdDAO.fromPartial(base ?? {});
|
|
2491
|
+
},
|
|
2492
|
+
fromPartial(object) {
|
|
2493
|
+
const message = createBaseThresholdDAO();
|
|
2494
|
+
message.name = object.name ?? "";
|
|
2495
|
+
message.members = object.members?.map((e) => e) || [];
|
|
2496
|
+
message.memberJoinedAt = globalThis.Object.entries(object.memberJoinedAt ?? {}).reduce((acc, [key, value]) => {
|
|
2497
|
+
if (value !== undefined) {
|
|
2498
|
+
acc[key] = globalThis.Number(value);
|
|
2499
|
+
}
|
|
2500
|
+
return acc;
|
|
2501
|
+
}, {});
|
|
2502
|
+
message.memberThreshold = object.memberThreshold ?? 0;
|
|
2503
|
+
message.voteThreshold = object.voteThreshold ?? 0;
|
|
2504
|
+
message.proposeThreshold = object.proposeThreshold ?? 0;
|
|
2505
|
+
message.quorum = object.quorum ?? 0;
|
|
2506
|
+
message.votingPeriodMs = object.votingPeriodMs ?? 0;
|
|
2507
|
+
message.proposal = (object.proposal !== undefined && object.proposal !== null)
|
|
2508
|
+
? Proposal.fromPartial(object.proposal)
|
|
2509
|
+
: undefined;
|
|
2510
|
+
message.votes = (object.votes !== undefined && object.votes !== null)
|
|
2511
|
+
? ThresholdVotes.fromPartial(object.votes)
|
|
2512
|
+
: undefined;
|
|
2513
|
+
message.history = object.history?.map((e) => ThresholdHistoryEntry.fromPartial(e)) || [];
|
|
2514
|
+
message.metadata = (object.metadata !== undefined && object.metadata !== null)
|
|
2515
|
+
? DAOMetadata.fromPartial(object.metadata)
|
|
2516
|
+
: undefined;
|
|
2517
|
+
message.status = object.status ?? DAOStatus.DAO_STATUS_UNSPECIFIED;
|
|
2518
|
+
return message;
|
|
2519
|
+
},
|
|
2520
|
+
};
|
|
2521
|
+
function createBaseThresholdDAO_MemberJoinedAtEntry() {
|
|
2522
|
+
return { key: "", value: 0 };
|
|
2523
|
+
}
|
|
2524
|
+
export const ThresholdDAO_MemberJoinedAtEntry = {
|
|
2525
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2526
|
+
if (message.key !== "") {
|
|
2527
|
+
writer.uint32(10).string(message.key);
|
|
2528
|
+
}
|
|
2529
|
+
if (message.value !== 0) {
|
|
2530
|
+
writer.uint32(16).int64(message.value);
|
|
2531
|
+
}
|
|
2532
|
+
return writer;
|
|
2533
|
+
},
|
|
2534
|
+
decode(input, length) {
|
|
2535
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2536
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2537
|
+
const message = createBaseThresholdDAO_MemberJoinedAtEntry();
|
|
2538
|
+
while (reader.pos < end) {
|
|
2539
|
+
const tag = reader.uint32();
|
|
2540
|
+
switch (tag >>> 3) {
|
|
2541
|
+
case 1: {
|
|
2542
|
+
if (tag !== 10) {
|
|
2543
|
+
break;
|
|
2544
|
+
}
|
|
2545
|
+
message.key = reader.string();
|
|
2546
|
+
continue;
|
|
2547
|
+
}
|
|
2548
|
+
case 2: {
|
|
2549
|
+
if (tag !== 16) {
|
|
2550
|
+
break;
|
|
2551
|
+
}
|
|
2552
|
+
message.value = longToNumber(reader.int64());
|
|
2553
|
+
continue;
|
|
2554
|
+
}
|
|
2555
|
+
}
|
|
2556
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2557
|
+
break;
|
|
2558
|
+
}
|
|
2559
|
+
reader.skip(tag & 7);
|
|
2560
|
+
}
|
|
2561
|
+
return message;
|
|
2562
|
+
},
|
|
2563
|
+
fromJSON(object) {
|
|
2564
|
+
return {
|
|
2565
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
2566
|
+
value: isSet(object.value) ? globalThis.Number(object.value) : 0,
|
|
2567
|
+
};
|
|
2568
|
+
},
|
|
2569
|
+
toJSON(message) {
|
|
2570
|
+
const obj = {};
|
|
2571
|
+
if (message.key !== "") {
|
|
2572
|
+
obj.key = message.key;
|
|
2573
|
+
}
|
|
2574
|
+
if (message.value !== 0) {
|
|
2575
|
+
obj.value = Math.round(message.value);
|
|
2576
|
+
}
|
|
2577
|
+
return obj;
|
|
2578
|
+
},
|
|
2579
|
+
create(base) {
|
|
2580
|
+
return ThresholdDAO_MemberJoinedAtEntry.fromPartial(base ?? {});
|
|
2581
|
+
},
|
|
2582
|
+
fromPartial(object) {
|
|
2583
|
+
const message = createBaseThresholdDAO_MemberJoinedAtEntry();
|
|
2584
|
+
message.key = object.key ?? "";
|
|
2585
|
+
message.value = object.value ?? 0;
|
|
2586
|
+
return message;
|
|
2587
|
+
},
|
|
2588
|
+
};
|
|
2589
|
+
function createBaseThresholdVotes() {
|
|
2590
|
+
return { votesFor: [], votesAgainst: [], votesAbstain: [] };
|
|
2591
|
+
}
|
|
2592
|
+
export const ThresholdVotes = {
|
|
2593
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2594
|
+
for (const v of message.votesFor) {
|
|
2595
|
+
writer.uint32(10).string(v);
|
|
2596
|
+
}
|
|
2597
|
+
for (const v of message.votesAgainst) {
|
|
2598
|
+
writer.uint32(18).string(v);
|
|
2599
|
+
}
|
|
2600
|
+
for (const v of message.votesAbstain) {
|
|
2601
|
+
writer.uint32(26).string(v);
|
|
2602
|
+
}
|
|
2603
|
+
return writer;
|
|
2604
|
+
},
|
|
2605
|
+
decode(input, length) {
|
|
2606
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2607
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2608
|
+
const message = createBaseThresholdVotes();
|
|
2609
|
+
while (reader.pos < end) {
|
|
2610
|
+
const tag = reader.uint32();
|
|
2611
|
+
switch (tag >>> 3) {
|
|
2612
|
+
case 1: {
|
|
2613
|
+
if (tag !== 10) {
|
|
2614
|
+
break;
|
|
2615
|
+
}
|
|
2616
|
+
message.votesFor.push(reader.string());
|
|
2617
|
+
continue;
|
|
2618
|
+
}
|
|
2619
|
+
case 2: {
|
|
2620
|
+
if (tag !== 18) {
|
|
2621
|
+
break;
|
|
2622
|
+
}
|
|
2623
|
+
message.votesAgainst.push(reader.string());
|
|
2624
|
+
continue;
|
|
2625
|
+
}
|
|
2626
|
+
case 3: {
|
|
2627
|
+
if (tag !== 26) {
|
|
2628
|
+
break;
|
|
2629
|
+
}
|
|
2630
|
+
message.votesAbstain.push(reader.string());
|
|
2631
|
+
continue;
|
|
2632
|
+
}
|
|
2633
|
+
}
|
|
2634
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2635
|
+
break;
|
|
2636
|
+
}
|
|
2637
|
+
reader.skip(tag & 7);
|
|
2638
|
+
}
|
|
2639
|
+
return message;
|
|
2640
|
+
},
|
|
2641
|
+
fromJSON(object) {
|
|
2642
|
+
return {
|
|
2643
|
+
votesFor: globalThis.Array.isArray(object?.votesFor)
|
|
2644
|
+
? object.votesFor.map((e) => globalThis.String(e))
|
|
2645
|
+
: globalThis.Array.isArray(object?.votes_for)
|
|
2646
|
+
? object.votes_for.map((e) => globalThis.String(e))
|
|
2647
|
+
: [],
|
|
2648
|
+
votesAgainst: globalThis.Array.isArray(object?.votesAgainst)
|
|
2649
|
+
? object.votesAgainst.map((e) => globalThis.String(e))
|
|
2650
|
+
: globalThis.Array.isArray(object?.votes_against)
|
|
2651
|
+
? object.votes_against.map((e) => globalThis.String(e))
|
|
2652
|
+
: [],
|
|
2653
|
+
votesAbstain: globalThis.Array.isArray(object?.votesAbstain)
|
|
2654
|
+
? object.votesAbstain.map((e) => globalThis.String(e))
|
|
2655
|
+
: globalThis.Array.isArray(object?.votes_abstain)
|
|
2656
|
+
? object.votes_abstain.map((e) => globalThis.String(e))
|
|
2657
|
+
: [],
|
|
2658
|
+
};
|
|
2659
|
+
},
|
|
2660
|
+
toJSON(message) {
|
|
2661
|
+
const obj = {};
|
|
2662
|
+
if (message.votesFor?.length) {
|
|
2663
|
+
obj.votesFor = message.votesFor;
|
|
2664
|
+
}
|
|
2665
|
+
if (message.votesAgainst?.length) {
|
|
2666
|
+
obj.votesAgainst = message.votesAgainst;
|
|
2667
|
+
}
|
|
2668
|
+
if (message.votesAbstain?.length) {
|
|
2669
|
+
obj.votesAbstain = message.votesAbstain;
|
|
2670
|
+
}
|
|
2671
|
+
return obj;
|
|
2672
|
+
},
|
|
2673
|
+
create(base) {
|
|
2674
|
+
return ThresholdVotes.fromPartial(base ?? {});
|
|
2675
|
+
},
|
|
2676
|
+
fromPartial(object) {
|
|
2677
|
+
const message = createBaseThresholdVotes();
|
|
2678
|
+
message.votesFor = object.votesFor?.map((e) => e) || [];
|
|
2679
|
+
message.votesAgainst = object.votesAgainst?.map((e) => e) || [];
|
|
2680
|
+
message.votesAbstain = object.votesAbstain?.map((e) => e) || [];
|
|
2681
|
+
return message;
|
|
2682
|
+
},
|
|
2683
|
+
};
|
|
2684
|
+
function createBaseThresholdHistoryEntry() {
|
|
2685
|
+
return { resultType: "", proposal: undefined, votes: undefined, at: undefined };
|
|
2686
|
+
}
|
|
2687
|
+
export const ThresholdHistoryEntry = {
|
|
2688
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2689
|
+
if (message.resultType !== "") {
|
|
2690
|
+
writer.uint32(10).string(message.resultType);
|
|
2691
|
+
}
|
|
2692
|
+
if (message.proposal !== undefined) {
|
|
2693
|
+
Proposal.encode(message.proposal, writer.uint32(18).fork()).join();
|
|
2694
|
+
}
|
|
2695
|
+
if (message.votes !== undefined) {
|
|
2696
|
+
ThresholdVotes.encode(message.votes, writer.uint32(26).fork()).join();
|
|
2697
|
+
}
|
|
2698
|
+
if (message.at !== undefined) {
|
|
2699
|
+
Timestamp.encode(toTimestamp(message.at), writer.uint32(34).fork()).join();
|
|
2700
|
+
}
|
|
2701
|
+
return writer;
|
|
2702
|
+
},
|
|
2703
|
+
decode(input, length) {
|
|
2704
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2705
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2706
|
+
const message = createBaseThresholdHistoryEntry();
|
|
2707
|
+
while (reader.pos < end) {
|
|
2708
|
+
const tag = reader.uint32();
|
|
2709
|
+
switch (tag >>> 3) {
|
|
2710
|
+
case 1: {
|
|
2711
|
+
if (tag !== 10) {
|
|
2712
|
+
break;
|
|
2713
|
+
}
|
|
2714
|
+
message.resultType = reader.string();
|
|
2715
|
+
continue;
|
|
2716
|
+
}
|
|
2717
|
+
case 2: {
|
|
2718
|
+
if (tag !== 18) {
|
|
2719
|
+
break;
|
|
2720
|
+
}
|
|
2721
|
+
message.proposal = Proposal.decode(reader, reader.uint32());
|
|
2722
|
+
continue;
|
|
2723
|
+
}
|
|
2724
|
+
case 3: {
|
|
2725
|
+
if (tag !== 26) {
|
|
2726
|
+
break;
|
|
2727
|
+
}
|
|
2728
|
+
message.votes = ThresholdVotes.decode(reader, reader.uint32());
|
|
2729
|
+
continue;
|
|
2730
|
+
}
|
|
2731
|
+
case 4: {
|
|
2732
|
+
if (tag !== 34) {
|
|
2733
|
+
break;
|
|
2734
|
+
}
|
|
2735
|
+
message.at = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
2736
|
+
continue;
|
|
2737
|
+
}
|
|
2738
|
+
}
|
|
2739
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2740
|
+
break;
|
|
2741
|
+
}
|
|
2742
|
+
reader.skip(tag & 7);
|
|
2743
|
+
}
|
|
2744
|
+
return message;
|
|
2745
|
+
},
|
|
2746
|
+
fromJSON(object) {
|
|
2747
|
+
return {
|
|
2748
|
+
resultType: isSet(object.resultType)
|
|
2749
|
+
? globalThis.String(object.resultType)
|
|
2750
|
+
: isSet(object.result_type)
|
|
2751
|
+
? globalThis.String(object.result_type)
|
|
2752
|
+
: "",
|
|
2753
|
+
proposal: isSet(object.proposal) ? Proposal.fromJSON(object.proposal) : undefined,
|
|
2754
|
+
votes: isSet(object.votes) ? ThresholdVotes.fromJSON(object.votes) : undefined,
|
|
2755
|
+
at: isSet(object.at) ? fromJsonTimestamp(object.at) : undefined,
|
|
2756
|
+
};
|
|
2757
|
+
},
|
|
2758
|
+
toJSON(message) {
|
|
2759
|
+
const obj = {};
|
|
2760
|
+
if (message.resultType !== "") {
|
|
2761
|
+
obj.resultType = message.resultType;
|
|
2762
|
+
}
|
|
2763
|
+
if (message.proposal !== undefined) {
|
|
2764
|
+
obj.proposal = Proposal.toJSON(message.proposal);
|
|
2765
|
+
}
|
|
2766
|
+
if (message.votes !== undefined) {
|
|
2767
|
+
obj.votes = ThresholdVotes.toJSON(message.votes);
|
|
2768
|
+
}
|
|
2769
|
+
if (message.at !== undefined) {
|
|
2770
|
+
obj.at = message.at.toISOString();
|
|
2771
|
+
}
|
|
2772
|
+
return obj;
|
|
2773
|
+
},
|
|
2774
|
+
create(base) {
|
|
2775
|
+
return ThresholdHistoryEntry.fromPartial(base ?? {});
|
|
2776
|
+
},
|
|
2777
|
+
fromPartial(object) {
|
|
2778
|
+
const message = createBaseThresholdHistoryEntry();
|
|
2779
|
+
message.resultType = object.resultType ?? "";
|
|
2780
|
+
message.proposal = (object.proposal !== undefined && object.proposal !== null)
|
|
2781
|
+
? Proposal.fromPartial(object.proposal)
|
|
2782
|
+
: undefined;
|
|
2783
|
+
message.votes = (object.votes !== undefined && object.votes !== null)
|
|
2784
|
+
? ThresholdVotes.fromPartial(object.votes)
|
|
2785
|
+
: undefined;
|
|
2786
|
+
message.at = object.at ?? undefined;
|
|
2787
|
+
return message;
|
|
2788
|
+
},
|
|
2789
|
+
};
|
|
2790
|
+
function createBaseCreateDAORequest() {
|
|
2791
|
+
return { daoType: DAOType.DAO_TYPE_UNSPECIFIED, name: "", creator: "", metadata: undefined, config: undefined };
|
|
2792
|
+
}
|
|
2793
|
+
export const CreateDAORequest = {
|
|
2794
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2795
|
+
if (message.daoType !== DAOType.DAO_TYPE_UNSPECIFIED) {
|
|
2796
|
+
writer.uint32(8).int32(dAOTypeToNumber(message.daoType));
|
|
2797
|
+
}
|
|
2798
|
+
if (message.name !== "") {
|
|
2799
|
+
writer.uint32(18).string(message.name);
|
|
2800
|
+
}
|
|
2801
|
+
if (message.creator !== "") {
|
|
2802
|
+
writer.uint32(26).string(message.creator);
|
|
2803
|
+
}
|
|
2804
|
+
if (message.metadata !== undefined) {
|
|
2805
|
+
DAOMetadata.encode(message.metadata, writer.uint32(34).fork()).join();
|
|
2806
|
+
}
|
|
2807
|
+
if (message.config !== undefined) {
|
|
2808
|
+
Struct.encode(Struct.wrap(message.config), writer.uint32(42).fork()).join();
|
|
2809
|
+
}
|
|
2810
|
+
return writer;
|
|
2811
|
+
},
|
|
2812
|
+
decode(input, length) {
|
|
2813
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2814
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2815
|
+
const message = createBaseCreateDAORequest();
|
|
2816
|
+
while (reader.pos < end) {
|
|
2817
|
+
const tag = reader.uint32();
|
|
2818
|
+
switch (tag >>> 3) {
|
|
2819
|
+
case 1: {
|
|
2820
|
+
if (tag !== 8) {
|
|
2821
|
+
break;
|
|
2822
|
+
}
|
|
2823
|
+
message.daoType = dAOTypeFromJSON(reader.int32());
|
|
2824
|
+
continue;
|
|
2825
|
+
}
|
|
2826
|
+
case 2: {
|
|
2827
|
+
if (tag !== 18) {
|
|
2828
|
+
break;
|
|
2829
|
+
}
|
|
2830
|
+
message.name = reader.string();
|
|
2831
|
+
continue;
|
|
2832
|
+
}
|
|
2833
|
+
case 3: {
|
|
2834
|
+
if (tag !== 26) {
|
|
2835
|
+
break;
|
|
2836
|
+
}
|
|
2837
|
+
message.creator = reader.string();
|
|
2838
|
+
continue;
|
|
2839
|
+
}
|
|
2840
|
+
case 4: {
|
|
2841
|
+
if (tag !== 34) {
|
|
2842
|
+
break;
|
|
2843
|
+
}
|
|
2844
|
+
message.metadata = DAOMetadata.decode(reader, reader.uint32());
|
|
2845
|
+
continue;
|
|
2846
|
+
}
|
|
2847
|
+
case 5: {
|
|
2848
|
+
if (tag !== 42) {
|
|
2849
|
+
break;
|
|
2850
|
+
}
|
|
2851
|
+
message.config = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
2852
|
+
continue;
|
|
2853
|
+
}
|
|
2854
|
+
}
|
|
2855
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2856
|
+
break;
|
|
2857
|
+
}
|
|
2858
|
+
reader.skip(tag & 7);
|
|
2859
|
+
}
|
|
2860
|
+
return message;
|
|
2861
|
+
},
|
|
2862
|
+
fromJSON(object) {
|
|
2863
|
+
return {
|
|
2864
|
+
daoType: isSet(object.daoType)
|
|
2865
|
+
? dAOTypeFromJSON(object.daoType)
|
|
2866
|
+
: isSet(object.dao_type)
|
|
2867
|
+
? dAOTypeFromJSON(object.dao_type)
|
|
2868
|
+
: DAOType.DAO_TYPE_UNSPECIFIED,
|
|
2869
|
+
name: isSet(object.name) ? globalThis.String(object.name) : "",
|
|
2870
|
+
creator: isSet(object.creator) ? globalThis.String(object.creator) : "",
|
|
2871
|
+
metadata: isSet(object.metadata) ? DAOMetadata.fromJSON(object.metadata) : undefined,
|
|
2872
|
+
config: isObject(object.config) ? object.config : undefined,
|
|
2873
|
+
};
|
|
2874
|
+
},
|
|
2875
|
+
toJSON(message) {
|
|
2876
|
+
const obj = {};
|
|
2877
|
+
if (message.daoType !== DAOType.DAO_TYPE_UNSPECIFIED) {
|
|
2878
|
+
obj.daoType = dAOTypeToJSON(message.daoType);
|
|
2879
|
+
}
|
|
2880
|
+
if (message.name !== "") {
|
|
2881
|
+
obj.name = message.name;
|
|
2882
|
+
}
|
|
2883
|
+
if (message.creator !== "") {
|
|
2884
|
+
obj.creator = message.creator;
|
|
2885
|
+
}
|
|
2886
|
+
if (message.metadata !== undefined) {
|
|
2887
|
+
obj.metadata = DAOMetadata.toJSON(message.metadata);
|
|
2888
|
+
}
|
|
2889
|
+
if (message.config !== undefined) {
|
|
2890
|
+
obj.config = message.config;
|
|
2891
|
+
}
|
|
2892
|
+
return obj;
|
|
2893
|
+
},
|
|
2894
|
+
create(base) {
|
|
2895
|
+
return CreateDAORequest.fromPartial(base ?? {});
|
|
2896
|
+
},
|
|
2897
|
+
fromPartial(object) {
|
|
2898
|
+
const message = createBaseCreateDAORequest();
|
|
2899
|
+
message.daoType = object.daoType ?? DAOType.DAO_TYPE_UNSPECIFIED;
|
|
2900
|
+
message.name = object.name ?? "";
|
|
2901
|
+
message.creator = object.creator ?? "";
|
|
2902
|
+
message.metadata = (object.metadata !== undefined && object.metadata !== null)
|
|
2903
|
+
? DAOMetadata.fromPartial(object.metadata)
|
|
2904
|
+
: undefined;
|
|
2905
|
+
message.config = object.config ?? undefined;
|
|
2906
|
+
return message;
|
|
2907
|
+
},
|
|
2908
|
+
};
|
|
2909
|
+
function createBaseProposeRequest() {
|
|
2910
|
+
return { daoId: "", proposer: "", title: "", description: "", actionType: "", payload: undefined };
|
|
2911
|
+
}
|
|
2912
|
+
export const ProposeRequest = {
|
|
2913
|
+
encode(message, writer = new BinaryWriter()) {
|
|
2914
|
+
if (message.daoId !== "") {
|
|
2915
|
+
writer.uint32(10).string(message.daoId);
|
|
2916
|
+
}
|
|
2917
|
+
if (message.proposer !== "") {
|
|
2918
|
+
writer.uint32(18).string(message.proposer);
|
|
2919
|
+
}
|
|
2920
|
+
if (message.title !== "") {
|
|
2921
|
+
writer.uint32(26).string(message.title);
|
|
2922
|
+
}
|
|
2923
|
+
if (message.description !== "") {
|
|
2924
|
+
writer.uint32(34).string(message.description);
|
|
2925
|
+
}
|
|
2926
|
+
if (message.actionType !== "") {
|
|
2927
|
+
writer.uint32(42).string(message.actionType);
|
|
2928
|
+
}
|
|
2929
|
+
if (message.payload !== undefined) {
|
|
2930
|
+
Struct.encode(Struct.wrap(message.payload), writer.uint32(50).fork()).join();
|
|
2931
|
+
}
|
|
2932
|
+
return writer;
|
|
2933
|
+
},
|
|
2934
|
+
decode(input, length) {
|
|
2935
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
2936
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
2937
|
+
const message = createBaseProposeRequest();
|
|
2938
|
+
while (reader.pos < end) {
|
|
2939
|
+
const tag = reader.uint32();
|
|
2940
|
+
switch (tag >>> 3) {
|
|
2941
|
+
case 1: {
|
|
2942
|
+
if (tag !== 10) {
|
|
2943
|
+
break;
|
|
2944
|
+
}
|
|
2945
|
+
message.daoId = reader.string();
|
|
2946
|
+
continue;
|
|
2947
|
+
}
|
|
2948
|
+
case 2: {
|
|
2949
|
+
if (tag !== 18) {
|
|
2950
|
+
break;
|
|
2951
|
+
}
|
|
2952
|
+
message.proposer = reader.string();
|
|
2953
|
+
continue;
|
|
2954
|
+
}
|
|
2955
|
+
case 3: {
|
|
2956
|
+
if (tag !== 26) {
|
|
2957
|
+
break;
|
|
2958
|
+
}
|
|
2959
|
+
message.title = reader.string();
|
|
2960
|
+
continue;
|
|
2961
|
+
}
|
|
2962
|
+
case 4: {
|
|
2963
|
+
if (tag !== 34) {
|
|
2964
|
+
break;
|
|
2965
|
+
}
|
|
2966
|
+
message.description = reader.string();
|
|
2967
|
+
continue;
|
|
2968
|
+
}
|
|
2969
|
+
case 5: {
|
|
2970
|
+
if (tag !== 42) {
|
|
2971
|
+
break;
|
|
2972
|
+
}
|
|
2973
|
+
message.actionType = reader.string();
|
|
2974
|
+
continue;
|
|
2975
|
+
}
|
|
2976
|
+
case 6: {
|
|
2977
|
+
if (tag !== 50) {
|
|
2978
|
+
break;
|
|
2979
|
+
}
|
|
2980
|
+
message.payload = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
|
2981
|
+
continue;
|
|
2982
|
+
}
|
|
2983
|
+
}
|
|
2984
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
2985
|
+
break;
|
|
2986
|
+
}
|
|
2987
|
+
reader.skip(tag & 7);
|
|
2988
|
+
}
|
|
2989
|
+
return message;
|
|
2990
|
+
},
|
|
2991
|
+
fromJSON(object) {
|
|
2992
|
+
return {
|
|
2993
|
+
daoId: isSet(object.daoId)
|
|
2994
|
+
? globalThis.String(object.daoId)
|
|
2995
|
+
: isSet(object.dao_id)
|
|
2996
|
+
? globalThis.String(object.dao_id)
|
|
2997
|
+
: "",
|
|
2998
|
+
proposer: isSet(object.proposer) ? globalThis.String(object.proposer) : "",
|
|
2999
|
+
title: isSet(object.title) ? globalThis.String(object.title) : "",
|
|
3000
|
+
description: isSet(object.description) ? globalThis.String(object.description) : "",
|
|
3001
|
+
actionType: isSet(object.actionType)
|
|
3002
|
+
? globalThis.String(object.actionType)
|
|
3003
|
+
: isSet(object.action_type)
|
|
3004
|
+
? globalThis.String(object.action_type)
|
|
3005
|
+
: "",
|
|
3006
|
+
payload: isObject(object.payload) ? object.payload : undefined,
|
|
3007
|
+
};
|
|
3008
|
+
},
|
|
3009
|
+
toJSON(message) {
|
|
3010
|
+
const obj = {};
|
|
3011
|
+
if (message.daoId !== "") {
|
|
3012
|
+
obj.daoId = message.daoId;
|
|
3013
|
+
}
|
|
3014
|
+
if (message.proposer !== "") {
|
|
3015
|
+
obj.proposer = message.proposer;
|
|
3016
|
+
}
|
|
3017
|
+
if (message.title !== "") {
|
|
3018
|
+
obj.title = message.title;
|
|
3019
|
+
}
|
|
3020
|
+
if (message.description !== "") {
|
|
3021
|
+
obj.description = message.description;
|
|
3022
|
+
}
|
|
3023
|
+
if (message.actionType !== "") {
|
|
3024
|
+
obj.actionType = message.actionType;
|
|
3025
|
+
}
|
|
3026
|
+
if (message.payload !== undefined) {
|
|
3027
|
+
obj.payload = message.payload;
|
|
3028
|
+
}
|
|
3029
|
+
return obj;
|
|
3030
|
+
},
|
|
3031
|
+
create(base) {
|
|
3032
|
+
return ProposeRequest.fromPartial(base ?? {});
|
|
3033
|
+
},
|
|
3034
|
+
fromPartial(object) {
|
|
3035
|
+
const message = createBaseProposeRequest();
|
|
3036
|
+
message.daoId = object.daoId ?? "";
|
|
3037
|
+
message.proposer = object.proposer ?? "";
|
|
3038
|
+
message.title = object.title ?? "";
|
|
3039
|
+
message.description = object.description ?? "";
|
|
3040
|
+
message.actionType = object.actionType ?? "";
|
|
3041
|
+
message.payload = object.payload ?? undefined;
|
|
3042
|
+
return message;
|
|
3043
|
+
},
|
|
3044
|
+
};
|
|
3045
|
+
function createBaseVoteRequest() {
|
|
3046
|
+
return { daoId: "", voter: "", choice: VoteChoice.VOTE_CHOICE_UNSPECIFIED };
|
|
3047
|
+
}
|
|
3048
|
+
export const VoteRequest = {
|
|
3049
|
+
encode(message, writer = new BinaryWriter()) {
|
|
3050
|
+
if (message.daoId !== "") {
|
|
3051
|
+
writer.uint32(10).string(message.daoId);
|
|
3052
|
+
}
|
|
3053
|
+
if (message.voter !== "") {
|
|
3054
|
+
writer.uint32(18).string(message.voter);
|
|
3055
|
+
}
|
|
3056
|
+
if (message.choice !== VoteChoice.VOTE_CHOICE_UNSPECIFIED) {
|
|
3057
|
+
writer.uint32(24).int32(voteChoiceToNumber(message.choice));
|
|
3058
|
+
}
|
|
3059
|
+
return writer;
|
|
3060
|
+
},
|
|
3061
|
+
decode(input, length) {
|
|
3062
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3063
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
3064
|
+
const message = createBaseVoteRequest();
|
|
3065
|
+
while (reader.pos < end) {
|
|
3066
|
+
const tag = reader.uint32();
|
|
3067
|
+
switch (tag >>> 3) {
|
|
3068
|
+
case 1: {
|
|
3069
|
+
if (tag !== 10) {
|
|
3070
|
+
break;
|
|
3071
|
+
}
|
|
3072
|
+
message.daoId = reader.string();
|
|
3073
|
+
continue;
|
|
3074
|
+
}
|
|
3075
|
+
case 2: {
|
|
3076
|
+
if (tag !== 18) {
|
|
3077
|
+
break;
|
|
3078
|
+
}
|
|
3079
|
+
message.voter = reader.string();
|
|
3080
|
+
continue;
|
|
3081
|
+
}
|
|
3082
|
+
case 3: {
|
|
3083
|
+
if (tag !== 24) {
|
|
3084
|
+
break;
|
|
3085
|
+
}
|
|
3086
|
+
message.choice = voteChoiceFromJSON(reader.int32());
|
|
3087
|
+
continue;
|
|
3088
|
+
}
|
|
3089
|
+
}
|
|
3090
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3091
|
+
break;
|
|
3092
|
+
}
|
|
3093
|
+
reader.skip(tag & 7);
|
|
3094
|
+
}
|
|
3095
|
+
return message;
|
|
3096
|
+
},
|
|
3097
|
+
fromJSON(object) {
|
|
3098
|
+
return {
|
|
3099
|
+
daoId: isSet(object.daoId)
|
|
3100
|
+
? globalThis.String(object.daoId)
|
|
3101
|
+
: isSet(object.dao_id)
|
|
3102
|
+
? globalThis.String(object.dao_id)
|
|
3103
|
+
: "",
|
|
3104
|
+
voter: isSet(object.voter) ? globalThis.String(object.voter) : "",
|
|
3105
|
+
choice: isSet(object.choice) ? voteChoiceFromJSON(object.choice) : VoteChoice.VOTE_CHOICE_UNSPECIFIED,
|
|
3106
|
+
};
|
|
3107
|
+
},
|
|
3108
|
+
toJSON(message) {
|
|
3109
|
+
const obj = {};
|
|
3110
|
+
if (message.daoId !== "") {
|
|
3111
|
+
obj.daoId = message.daoId;
|
|
3112
|
+
}
|
|
3113
|
+
if (message.voter !== "") {
|
|
3114
|
+
obj.voter = message.voter;
|
|
3115
|
+
}
|
|
3116
|
+
if (message.choice !== VoteChoice.VOTE_CHOICE_UNSPECIFIED) {
|
|
3117
|
+
obj.choice = voteChoiceToJSON(message.choice);
|
|
3118
|
+
}
|
|
3119
|
+
return obj;
|
|
3120
|
+
},
|
|
3121
|
+
create(base) {
|
|
3122
|
+
return VoteRequest.fromPartial(base ?? {});
|
|
3123
|
+
},
|
|
3124
|
+
fromPartial(object) {
|
|
3125
|
+
const message = createBaseVoteRequest();
|
|
3126
|
+
message.daoId = object.daoId ?? "";
|
|
3127
|
+
message.voter = object.voter ?? "";
|
|
3128
|
+
message.choice = object.choice ?? VoteChoice.VOTE_CHOICE_UNSPECIFIED;
|
|
3129
|
+
return message;
|
|
3130
|
+
},
|
|
3131
|
+
};
|
|
3132
|
+
function createBaseExecuteRequest() {
|
|
3133
|
+
return { daoId: "", executor: "" };
|
|
3134
|
+
}
|
|
3135
|
+
export const ExecuteRequest = {
|
|
3136
|
+
encode(message, writer = new BinaryWriter()) {
|
|
3137
|
+
if (message.daoId !== "") {
|
|
3138
|
+
writer.uint32(10).string(message.daoId);
|
|
3139
|
+
}
|
|
3140
|
+
if (message.executor !== "") {
|
|
3141
|
+
writer.uint32(18).string(message.executor);
|
|
3142
|
+
}
|
|
3143
|
+
return writer;
|
|
3144
|
+
},
|
|
3145
|
+
decode(input, length) {
|
|
3146
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
3147
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
3148
|
+
const message = createBaseExecuteRequest();
|
|
3149
|
+
while (reader.pos < end) {
|
|
3150
|
+
const tag = reader.uint32();
|
|
3151
|
+
switch (tag >>> 3) {
|
|
3152
|
+
case 1: {
|
|
3153
|
+
if (tag !== 10) {
|
|
3154
|
+
break;
|
|
3155
|
+
}
|
|
3156
|
+
message.daoId = reader.string();
|
|
3157
|
+
continue;
|
|
3158
|
+
}
|
|
3159
|
+
case 2: {
|
|
3160
|
+
if (tag !== 18) {
|
|
3161
|
+
break;
|
|
3162
|
+
}
|
|
3163
|
+
message.executor = reader.string();
|
|
3164
|
+
continue;
|
|
3165
|
+
}
|
|
3166
|
+
}
|
|
3167
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
3168
|
+
break;
|
|
3169
|
+
}
|
|
3170
|
+
reader.skip(tag & 7);
|
|
3171
|
+
}
|
|
3172
|
+
return message;
|
|
3173
|
+
},
|
|
3174
|
+
fromJSON(object) {
|
|
3175
|
+
return {
|
|
3176
|
+
daoId: isSet(object.daoId)
|
|
3177
|
+
? globalThis.String(object.daoId)
|
|
3178
|
+
: isSet(object.dao_id)
|
|
3179
|
+
? globalThis.String(object.dao_id)
|
|
3180
|
+
: "",
|
|
3181
|
+
executor: isSet(object.executor) ? globalThis.String(object.executor) : "",
|
|
3182
|
+
};
|
|
3183
|
+
},
|
|
3184
|
+
toJSON(message) {
|
|
3185
|
+
const obj = {};
|
|
3186
|
+
if (message.daoId !== "") {
|
|
3187
|
+
obj.daoId = message.daoId;
|
|
3188
|
+
}
|
|
3189
|
+
if (message.executor !== "") {
|
|
3190
|
+
obj.executor = message.executor;
|
|
3191
|
+
}
|
|
3192
|
+
return obj;
|
|
3193
|
+
},
|
|
3194
|
+
create(base) {
|
|
3195
|
+
return ExecuteRequest.fromPartial(base ?? {});
|
|
3196
|
+
},
|
|
3197
|
+
fromPartial(object) {
|
|
3198
|
+
const message = createBaseExecuteRequest();
|
|
3199
|
+
message.daoId = object.daoId ?? "";
|
|
3200
|
+
message.executor = object.executor ?? "";
|
|
3201
|
+
return message;
|
|
3202
|
+
},
|
|
3203
|
+
};
|
|
3204
|
+
function toTimestamp(date) {
|
|
3205
|
+
const seconds = Math.trunc(date.getTime() / 1000);
|
|
3206
|
+
const nanos = (date.getTime() % 1000) * 1000000;
|
|
3207
|
+
return { seconds, nanos };
|
|
3208
|
+
}
|
|
3209
|
+
function fromTimestamp(t) {
|
|
3210
|
+
let millis = (t.seconds || 0) * 1000;
|
|
3211
|
+
millis += (t.nanos || 0) / 1000000;
|
|
3212
|
+
return new globalThis.Date(millis);
|
|
3213
|
+
}
|
|
3214
|
+
function fromJsonTimestamp(o) {
|
|
3215
|
+
if (o instanceof globalThis.Date) {
|
|
3216
|
+
return o;
|
|
3217
|
+
}
|
|
3218
|
+
else if (typeof o === "string") {
|
|
3219
|
+
return new globalThis.Date(o);
|
|
3220
|
+
}
|
|
3221
|
+
else {
|
|
3222
|
+
return fromTimestamp(Timestamp.fromJSON(o));
|
|
3223
|
+
}
|
|
3224
|
+
}
|
|
3225
|
+
function longToNumber(int64) {
|
|
3226
|
+
const num = globalThis.Number(int64.toString());
|
|
3227
|
+
if (num > globalThis.Number.MAX_SAFE_INTEGER) {
|
|
3228
|
+
throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
|
3229
|
+
}
|
|
3230
|
+
if (num < globalThis.Number.MIN_SAFE_INTEGER) {
|
|
3231
|
+
throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER");
|
|
3232
|
+
}
|
|
3233
|
+
return num;
|
|
3234
|
+
}
|
|
3235
|
+
function isObject(value) {
|
|
3236
|
+
return typeof value === "object" && value !== null;
|
|
3237
|
+
}
|
|
3238
|
+
function isSet(value) {
|
|
3239
|
+
return value !== null && value !== undefined;
|
|
3240
|
+
}
|