@loyal-labs/loyal-smart-accounts-core 0.1.1
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/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/internal.d.ts +1 -0
- package/dist/internal.js +1 -0
- package/dist/loyal.d.ts +1 -0
- package/dist/loyal.js +1 -0
- package/dist/src/accounts.d.ts +1 -0
- package/dist/src/accounts.js +1 -0
- package/dist/src/codecs.d.ts +6 -0
- package/dist/src/codecs.js +6 -0
- package/dist/src/core/codecs/index.d.ts +6 -0
- package/dist/src/core/codecs/index.js +6 -0
- package/dist/src/core/codecs/primitives.d.ts +7 -0
- package/dist/src/core/codecs/primitives.js +28 -0
- package/dist/src/core/errors/index.d.ts +29 -0
- package/dist/src/core/errors/index.js +124 -0
- package/dist/src/core/generated/index.d.ts +1 -0
- package/dist/src/core/generated/index.js +1 -0
- package/dist/src/core/pda/index.d.ts +44 -0
- package/dist/src/core/pda/index.js +80 -0
- package/dist/src/core/spec/features.d.ts +1 -0
- package/dist/src/core/spec/features.js +1 -0
- package/dist/src/core/spec/idl.d.ts +1 -0
- package/dist/src/core/spec/idl.js +1 -0
- package/dist/src/core/spec/index.d.ts +4 -0
- package/dist/src/core/spec/index.js +4 -0
- package/dist/src/core/spec/pda-registry.d.ts +1 -0
- package/dist/src/core/spec/pda-registry.js +1 -0
- package/dist/src/core/transport/index.d.ts +54 -0
- package/dist/src/core/transport/index.js +96 -0
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.js +1 -0
- package/dist/src/generated/accounts/Batch.d.ts +130 -0
- package/dist/src/generated/accounts/Batch.js +158 -0
- package/dist/src/generated/accounts/BatchTransaction.d.ts +105 -0
- package/dist/src/generated/accounts/BatchTransaction.js +130 -0
- package/dist/src/generated/accounts/LegacyTransaction.d.ts +122 -0
- package/dist/src/generated/accounts/LegacyTransaction.js +163 -0
- package/dist/src/generated/accounts/Policy.d.ts +139 -0
- package/dist/src/generated/accounts/Policy.js +208 -0
- package/dist/src/generated/accounts/ProgramConfig.d.ts +116 -0
- package/dist/src/generated/accounts/ProgramConfig.js +153 -0
- package/dist/src/generated/accounts/Proposal.d.ts +119 -0
- package/dist/src/generated/accounts/Proposal.js +157 -0
- package/dist/src/generated/accounts/Settings.d.ts +140 -0
- package/dist/src/generated/accounts/Settings.js +210 -0
- package/dist/src/generated/accounts/SettingsTransaction.d.ts +113 -0
- package/dist/src/generated/accounts/SettingsTransaction.js +151 -0
- package/dist/src/generated/accounts/SpendingLimit.d.ts +137 -0
- package/dist/src/generated/accounts/SpendingLimit.js +206 -0
- package/dist/src/generated/accounts/Transaction.d.ts +110 -0
- package/dist/src/generated/accounts/Transaction.js +145 -0
- package/dist/src/generated/accounts/TransactionBuffer.d.ts +113 -0
- package/dist/src/generated/accounts/TransactionBuffer.js +143 -0
- package/dist/src/generated/accounts/index.d.ts +35 -0
- package/dist/src/generated/accounts/index.js +35 -0
- package/dist/src/generated/errors/index.d.ts +1420 -0
- package/dist/src/generated/errors/index.js +2312 -0
- package/dist/src/generated/index.d.ts +19 -0
- package/dist/src/generated/index.js +19 -0
- package/dist/src/generated/instructions/activateProposal.d.ts +42 -0
- package/dist/src/generated/instructions/activateProposal.js +58 -0
- package/dist/src/generated/instructions/addSignerAsAuthority.d.ts +59 -0
- package/dist/src/generated/instructions/addSignerAsAuthority.js +78 -0
- package/dist/src/generated/instructions/addSpendingLimitAsAuthority.d.ts +58 -0
- package/dist/src/generated/instructions/addSpendingLimitAsAuthority.js +80 -0
- package/dist/src/generated/instructions/addTransactionToBatch.d.ts +60 -0
- package/dist/src/generated/instructions/addTransactionToBatch.js +85 -0
- package/dist/src/generated/instructions/approveProposal.d.ts +59 -0
- package/dist/src/generated/instructions/approveProposal.js +78 -0
- package/dist/src/generated/instructions/cancelProposal.d.ts +59 -0
- package/dist/src/generated/instructions/cancelProposal.js +78 -0
- package/dist/src/generated/instructions/changeThresholdAsAuthority.d.ts +59 -0
- package/dist/src/generated/instructions/changeThresholdAsAuthority.js +78 -0
- package/dist/src/generated/instructions/closeBatch.d.ts +49 -0
- package/dist/src/generated/instructions/closeBatch.js +78 -0
- package/dist/src/generated/instructions/closeBatchTransaction.d.ts +47 -0
- package/dist/src/generated/instructions/closeBatchTransaction.js +73 -0
- package/dist/src/generated/instructions/closeEmptyPolicyTransaction.d.ts +51 -0
- package/dist/src/generated/instructions/closeEmptyPolicyTransaction.js +83 -0
- package/dist/src/generated/instructions/closeSettingsTransaction.d.ts +49 -0
- package/dist/src/generated/instructions/closeSettingsTransaction.js +78 -0
- package/dist/src/generated/instructions/closeTransaction.d.ts +49 -0
- package/dist/src/generated/instructions/closeTransaction.js +78 -0
- package/dist/src/generated/instructions/closeTransactionBuffer.d.ts +42 -0
- package/dist/src/generated/instructions/closeTransactionBuffer.js +58 -0
- package/dist/src/generated/instructions/createBatch.d.ts +56 -0
- package/dist/src/generated/instructions/createBatch.js +75 -0
- package/dist/src/generated/instructions/createProposal.d.ts +58 -0
- package/dist/src/generated/instructions/createProposal.js +80 -0
- package/dist/src/generated/instructions/createSettingsTransaction.d.ts +58 -0
- package/dist/src/generated/instructions/createSettingsTransaction.js +80 -0
- package/dist/src/generated/instructions/createSmartAccount.d.ts +56 -0
- package/dist/src/generated/instructions/createSmartAccount.js +75 -0
- package/dist/src/generated/instructions/createTransaction.d.ts +58 -0
- package/dist/src/generated/instructions/createTransaction.js +80 -0
- package/dist/src/generated/instructions/createTransactionBuffer.d.ts +56 -0
- package/dist/src/generated/instructions/createTransactionBuffer.js +75 -0
- package/dist/src/generated/instructions/createTransactionFromBuffer.d.ts +63 -0
- package/dist/src/generated/instructions/createTransactionFromBuffer.js +90 -0
- package/dist/src/generated/instructions/executeBatchTransaction.d.ts +46 -0
- package/dist/src/generated/instructions/executeBatchTransaction.js +68 -0
- package/dist/src/generated/instructions/executeSettingsTransaction.d.ts +52 -0
- package/dist/src/generated/instructions/executeSettingsTransaction.js +81 -0
- package/dist/src/generated/instructions/executeSettingsTransactionSync.d.ts +57 -0
- package/dist/src/generated/instructions/executeSettingsTransactionSync.js +73 -0
- package/dist/src/generated/instructions/executeTransaction.d.ts +46 -0
- package/dist/src/generated/instructions/executeTransaction.js +68 -0
- package/dist/src/generated/instructions/executeTransactionSync.d.ts +51 -0
- package/dist/src/generated/instructions/executeTransactionSync.js +60 -0
- package/dist/src/generated/instructions/executeTransactionSyncV2.d.ts +51 -0
- package/dist/src/generated/instructions/executeTransactionSyncV2.js +60 -0
- package/dist/src/generated/instructions/extendTransactionBuffer.d.ts +53 -0
- package/dist/src/generated/instructions/extendTransactionBuffer.js +65 -0
- package/dist/src/generated/instructions/index.d.ts +39 -0
- package/dist/src/generated/instructions/index.js +39 -0
- package/dist/src/generated/instructions/initializeProgramConfig.d.ts +52 -0
- package/dist/src/generated/instructions/initializeProgramConfig.js +65 -0
- package/dist/src/generated/instructions/logEvent.d.ts +49 -0
- package/dist/src/generated/instructions/logEvent.js +55 -0
- package/dist/src/generated/instructions/rejectProposal.d.ts +59 -0
- package/dist/src/generated/instructions/rejectProposal.js +78 -0
- package/dist/src/generated/instructions/removeSignerAsAuthority.d.ts +59 -0
- package/dist/src/generated/instructions/removeSignerAsAuthority.js +78 -0
- package/dist/src/generated/instructions/removeSpendingLimitAsAuthority.d.ts +57 -0
- package/dist/src/generated/instructions/removeSpendingLimitAsAuthority.js +75 -0
- package/dist/src/generated/instructions/setArchivalAuthorityAsAuthority.d.ts +59 -0
- package/dist/src/generated/instructions/setArchivalAuthorityAsAuthority.js +78 -0
- package/dist/src/generated/instructions/setNewSettingsAuthorityAsAuthority.d.ts +59 -0
- package/dist/src/generated/instructions/setNewSettingsAuthorityAsAuthority.js +78 -0
- package/dist/src/generated/instructions/setProgramConfigAuthority.d.ts +51 -0
- package/dist/src/generated/instructions/setProgramConfigAuthority.js +60 -0
- package/dist/src/generated/instructions/setProgramConfigSmartAccountCreationFee.d.ts +51 -0
- package/dist/src/generated/instructions/setProgramConfigSmartAccountCreationFee.js +60 -0
- package/dist/src/generated/instructions/setProgramConfigTreasury.d.ts +51 -0
- package/dist/src/generated/instructions/setProgramConfigTreasury.js +60 -0
- package/dist/src/generated/instructions/setTimeLockAsAuthority.d.ts +59 -0
- package/dist/src/generated/instructions/setTimeLockAsAuthority.js +78 -0
- package/dist/src/generated/instructions/useSpendingLimit.d.ts +70 -0
- package/dist/src/generated/instructions/useSpendingLimit.js +108 -0
- package/dist/src/generated/types/AccountConstraint.d.ts +19 -0
- package/dist/src/generated/types/AccountConstraint.js +18 -0
- package/dist/src/generated/types/AccountConstraintType.d.ts +49 -0
- package/dist/src/generated/types/AccountConstraintType.js +25 -0
- package/dist/src/generated/types/AddSignerArgs.d.ts +17 -0
- package/dist/src/generated/types/AddSignerArgs.js +16 -0
- package/dist/src/generated/types/AddSpendingLimitArgs.d.ts +25 -0
- package/dist/src/generated/types/AddSpendingLimitArgs.js +24 -0
- package/dist/src/generated/types/AddTransactionToBatchArgs.d.ts +16 -0
- package/dist/src/generated/types/AddTransactionToBatchArgs.js +15 -0
- package/dist/src/generated/types/AllowedSettingsChange.d.ts +60 -0
- package/dist/src/generated/types/AllowedSettingsChange.js +35 -0
- package/dist/src/generated/types/ChangeThresholdArgs.d.ts +16 -0
- package/dist/src/generated/types/ChangeThresholdArgs.js +15 -0
- package/dist/src/generated/types/ConsensusAccountType.d.ts +20 -0
- package/dist/src/generated/types/ConsensusAccountType.js +21 -0
- package/dist/src/generated/types/CreateBatchArgs.d.ts +16 -0
- package/dist/src/generated/types/CreateBatchArgs.js +15 -0
- package/dist/src/generated/types/CreateProposalArgs.d.ts +16 -0
- package/dist/src/generated/types/CreateProposalArgs.js +15 -0
- package/dist/src/generated/types/CreateSettingsTransactionArgs.d.ts +17 -0
- package/dist/src/generated/types/CreateSettingsTransactionArgs.js +16 -0
- package/dist/src/generated/types/CreateSmartAccountArgs.d.ts +22 -0
- package/dist/src/generated/types/CreateSmartAccountArgs.js +21 -0
- package/dist/src/generated/types/CreateTransactionArgs.d.ts +49 -0
- package/dist/src/generated/types/CreateTransactionArgs.js +25 -0
- package/dist/src/generated/types/CreateTransactionBufferArgs.d.ts +19 -0
- package/dist/src/generated/types/CreateTransactionBufferArgs.js +18 -0
- package/dist/src/generated/types/DataConstraint.d.ts +19 -0
- package/dist/src/generated/types/DataConstraint.js +18 -0
- package/dist/src/generated/types/DataOperator.d.ts +24 -0
- package/dist/src/generated/types/DataOperator.js +25 -0
- package/dist/src/generated/types/DataValue.d.ts +71 -0
- package/dist/src/generated/types/DataValue.js +43 -0
- package/dist/src/generated/types/ExtendTransactionBufferArgs.d.ts +15 -0
- package/dist/src/generated/types/ExtendTransactionBufferArgs.js +12 -0
- package/dist/src/generated/types/Hook.d.ts +21 -0
- package/dist/src/generated/types/Hook.js +20 -0
- package/dist/src/generated/types/InitProgramConfigArgs.d.ts +18 -0
- package/dist/src/generated/types/InitProgramConfigArgs.js +17 -0
- package/dist/src/generated/types/InstructionConstraint.d.ts +20 -0
- package/dist/src/generated/types/InstructionConstraint.js +19 -0
- package/dist/src/generated/types/InternalFundTransferPayload.d.ts +20 -0
- package/dist/src/generated/types/InternalFundTransferPayload.js +19 -0
- package/dist/src/generated/types/InternalFundTransferPolicy.d.ts +18 -0
- package/dist/src/generated/types/InternalFundTransferPolicy.js +17 -0
- package/dist/src/generated/types/InternalFundTransferPolicyCreationPayload.d.ts +18 -0
- package/dist/src/generated/types/InternalFundTransferPolicyCreationPayload.js +17 -0
- package/dist/src/generated/types/LegacySyncTransactionArgs.d.ts +17 -0
- package/dist/src/generated/types/LegacySyncTransactionArgs.js +16 -0
- package/dist/src/generated/types/LimitedQuantityConstraints.d.ts +15 -0
- package/dist/src/generated/types/LimitedQuantityConstraints.js +12 -0
- package/dist/src/generated/types/LimitedSettingsAction.d.ts +61 -0
- package/dist/src/generated/types/LimitedSettingsAction.js +35 -0
- package/dist/src/generated/types/LimitedSpendingLimit.d.ts +20 -0
- package/dist/src/generated/types/LimitedSpendingLimit.js +19 -0
- package/dist/src/generated/types/LimitedTimeConstraints.d.ts +18 -0
- package/dist/src/generated/types/LimitedTimeConstraints.js +17 -0
- package/dist/src/generated/types/LogEventArgs.d.ts +17 -0
- package/dist/src/generated/types/LogEventArgs.js +16 -0
- package/dist/src/generated/types/LogEventArgsV2.d.ts +15 -0
- package/dist/src/generated/types/LogEventArgsV2.js +12 -0
- package/dist/src/generated/types/Payload.d.ts +49 -0
- package/dist/src/generated/types/Payload.js +25 -0
- package/dist/src/generated/types/Period.d.ts +22 -0
- package/dist/src/generated/types/Period.js +23 -0
- package/dist/src/generated/types/PeriodV2.d.ts +57 -0
- package/dist/src/generated/types/PeriodV2.js +26 -0
- package/dist/src/generated/types/Permissions.d.ts +15 -0
- package/dist/src/generated/types/Permissions.js +12 -0
- package/dist/src/generated/types/PolicyActionPayloadDetails.d.ts +16 -0
- package/dist/src/generated/types/PolicyActionPayloadDetails.js +13 -0
- package/dist/src/generated/types/PolicyCreationPayload.d.ts +63 -0
- package/dist/src/generated/types/PolicyCreationPayload.js +42 -0
- package/dist/src/generated/types/PolicyEventType.d.ts +22 -0
- package/dist/src/generated/types/PolicyEventType.js +23 -0
- package/dist/src/generated/types/PolicyExecutionContext.d.ts +20 -0
- package/dist/src/generated/types/PolicyExecutionContext.js +21 -0
- package/dist/src/generated/types/PolicyExpiration.d.ts +47 -0
- package/dist/src/generated/types/PolicyExpiration.js +28 -0
- package/dist/src/generated/types/PolicyExpirationArgs.d.ts +45 -0
- package/dist/src/generated/types/PolicyExpirationArgs.js +20 -0
- package/dist/src/generated/types/PolicyPayload.d.ts +63 -0
- package/dist/src/generated/types/PolicyPayload.js +37 -0
- package/dist/src/generated/types/PolicyState.d.ts +63 -0
- package/dist/src/generated/types/PolicyState.js +37 -0
- package/dist/src/generated/types/ProgramConfigSetAuthorityArgs.d.ts +16 -0
- package/dist/src/generated/types/ProgramConfigSetAuthorityArgs.js +13 -0
- package/dist/src/generated/types/ProgramConfigSetSmartAccountCreationFeeArgs.d.ts +15 -0
- package/dist/src/generated/types/ProgramConfigSetSmartAccountCreationFeeArgs.js +12 -0
- package/dist/src/generated/types/ProgramConfigSetTreasuryArgs.d.ts +16 -0
- package/dist/src/generated/types/ProgramConfigSetTreasuryArgs.js +13 -0
- package/dist/src/generated/types/ProgramInteractionPayload.d.ts +17 -0
- package/dist/src/generated/types/ProgramInteractionPayload.js +16 -0
- package/dist/src/generated/types/ProgramInteractionPolicy.d.ts +22 -0
- package/dist/src/generated/types/ProgramInteractionPolicy.js +21 -0
- package/dist/src/generated/types/ProgramInteractionPolicyCreationPayload.d.ts +22 -0
- package/dist/src/generated/types/ProgramInteractionPolicyCreationPayload.js +21 -0
- package/dist/src/generated/types/ProgramInteractionTransactionPayload.d.ts +49 -0
- package/dist/src/generated/types/ProgramInteractionTransactionPayload.js +25 -0
- package/dist/src/generated/types/ProposalEventType.d.ts +24 -0
- package/dist/src/generated/types/ProposalEventType.js +25 -0
- package/dist/src/generated/types/ProposalStatus.d.ts +75 -0
- package/dist/src/generated/types/ProposalStatus.js +45 -0
- package/dist/src/generated/types/QuantityConstraints.d.ts +17 -0
- package/dist/src/generated/types/QuantityConstraints.js +16 -0
- package/dist/src/generated/types/RemoveSignerArgs.d.ts +17 -0
- package/dist/src/generated/types/RemoveSignerArgs.js +16 -0
- package/dist/src/generated/types/RemoveSpendingLimitArgs.d.ts +15 -0
- package/dist/src/generated/types/RemoveSpendingLimitArgs.js +12 -0
- package/dist/src/generated/types/SetArchivalAuthorityArgs.d.ts +17 -0
- package/dist/src/generated/types/SetArchivalAuthorityArgs.js +16 -0
- package/dist/src/generated/types/SetNewSettingsAuthorityArgs.d.ts +17 -0
- package/dist/src/generated/types/SetNewSettingsAuthorityArgs.js +16 -0
- package/dist/src/generated/types/SetTimeLockArgs.d.ts +16 -0
- package/dist/src/generated/types/SetTimeLockArgs.js +15 -0
- package/dist/src/generated/types/SettingsAction.d.ts +118 -0
- package/dist/src/generated/types/SettingsAction.js +92 -0
- package/dist/src/generated/types/SettingsChangePayload.d.ts +17 -0
- package/dist/src/generated/types/SettingsChangePayload.js +16 -0
- package/dist/src/generated/types/SettingsChangePolicy.d.ts +16 -0
- package/dist/src/generated/types/SettingsChangePolicy.js +13 -0
- package/dist/src/generated/types/SettingsChangePolicyCreationPayload.d.ts +16 -0
- package/dist/src/generated/types/SettingsChangePolicyCreationPayload.js +13 -0
- package/dist/src/generated/types/SmartAccountCompiledInstruction.d.ts +17 -0
- package/dist/src/generated/types/SmartAccountCompiledInstruction.js +16 -0
- package/dist/src/generated/types/SmartAccountMessageAddressTableLookup.d.ts +18 -0
- package/dist/src/generated/types/SmartAccountMessageAddressTableLookup.js +17 -0
- package/dist/src/generated/types/SmartAccountSigner.d.ts +18 -0
- package/dist/src/generated/types/SmartAccountSigner.js +17 -0
- package/dist/src/generated/types/SmartAccountTransactionMessage.d.ts +23 -0
- package/dist/src/generated/types/SmartAccountTransactionMessage.js +25 -0
- package/dist/src/generated/types/SpendingLimitPayload.d.ts +18 -0
- package/dist/src/generated/types/SpendingLimitPayload.js +17 -0
- package/dist/src/generated/types/SpendingLimitPolicy.d.ts +19 -0
- package/dist/src/generated/types/SpendingLimitPolicy.js +18 -0
- package/dist/src/generated/types/SpendingLimitPolicyCreationPayload.d.ts +24 -0
- package/dist/src/generated/types/SpendingLimitPolicyCreationPayload.js +23 -0
- package/dist/src/generated/types/SpendingLimitV2.d.ts +22 -0
- package/dist/src/generated/types/SpendingLimitV2.js +21 -0
- package/dist/src/generated/types/SyncPayload.d.ts +48 -0
- package/dist/src/generated/types/SyncPayload.js +24 -0
- package/dist/src/generated/types/SyncSettingsTransactionArgs.d.ts +18 -0
- package/dist/src/generated/types/SyncSettingsTransactionArgs.js +17 -0
- package/dist/src/generated/types/SyncTransactionArgs.d.ts +18 -0
- package/dist/src/generated/types/SyncTransactionArgs.js +17 -0
- package/dist/src/generated/types/SyncTransactionPayloadDetails.d.ts +16 -0
- package/dist/src/generated/types/SyncTransactionPayloadDetails.js +15 -0
- package/dist/src/generated/types/SynchronousTransactionEventPayload.d.ts +50 -0
- package/dist/src/generated/types/SynchronousTransactionEventPayload.js +28 -0
- package/dist/src/generated/types/TimeConstraints.d.ts +19 -0
- package/dist/src/generated/types/TimeConstraints.js +18 -0
- package/dist/src/generated/types/TransactionEventType.d.ts +21 -0
- package/dist/src/generated/types/TransactionEventType.js +22 -0
- package/dist/src/generated/types/TransactionPayload.d.ts +18 -0
- package/dist/src/generated/types/TransactionPayload.js +17 -0
- package/dist/src/generated/types/TransactionPayloadDetails.d.ts +18 -0
- package/dist/src/generated/types/TransactionPayloadDetails.js +17 -0
- package/dist/src/generated/types/UsageState.d.ts +16 -0
- package/dist/src/generated/types/UsageState.js +15 -0
- package/dist/src/generated/types/UseSpendingLimitArgs.d.ts +17 -0
- package/dist/src/generated/types/UseSpendingLimitArgs.js +16 -0
- package/dist/src/generated/types/Vote.d.ts +21 -0
- package/dist/src/generated/types/Vote.js +22 -0
- package/dist/src/generated/types/VoteOnProposalArgs.d.ts +15 -0
- package/dist/src/generated/types/VoteOnProposalArgs.js +12 -0
- package/dist/src/generated/types/index.d.ts +83 -0
- package/dist/src/generated/types/index.js +83 -0
- package/dist/src/index.d.ts +15 -0
- package/dist/src/index.js +15 -0
- package/dist/src/internal/generated.d.ts +1 -0
- package/dist/src/internal/generated.js +1 -0
- package/dist/src/internal/index.d.ts +2 -0
- package/dist/src/internal/index.js +2 -0
- package/dist/src/internal/instructions/activateProposal.d.ts +7 -0
- package/dist/src/internal/instructions/activateProposal.js +14 -0
- package/dist/src/internal/instructions/addSignerAsAuthority.d.ts +10 -0
- package/dist/src/internal/instructions/addSignerAsAuthority.js +11 -0
- package/dist/src/internal/instructions/addSpendingLimitAsAuthority.d.ts +18 -0
- package/dist/src/internal/instructions/addSpendingLimitAsAuthority.js +27 -0
- package/dist/src/internal/instructions/addTransactionToBatch.d.ts +18 -0
- package/dist/src/internal/instructions/addTransactionToBatch.js +44 -0
- package/dist/src/internal/instructions/approveProposal.d.ts +8 -0
- package/dist/src/internal/instructions/approveProposal.js +10 -0
- package/dist/src/internal/instructions/cancelProposal.d.ts +8 -0
- package/dist/src/internal/instructions/cancelProposal.js +11 -0
- package/dist/src/internal/instructions/changeThresholdAsAuthority.d.ts +9 -0
- package/dist/src/internal/instructions/changeThresholdAsAuthority.js +14 -0
- package/dist/src/internal/instructions/closeBatch.d.ts +15 -0
- package/dist/src/internal/instructions/closeBatch.js +29 -0
- package/dist/src/internal/instructions/closeBatchTransaction.d.ts +15 -0
- package/dist/src/internal/instructions/closeBatchTransaction.js +34 -0
- package/dist/src/internal/instructions/closeEmptyPolicyTransaction.d.ts +8 -0
- package/dist/src/internal/instructions/closeEmptyPolicyTransaction.js +26 -0
- package/dist/src/internal/instructions/closeSettingsTransaction.d.ts +8 -0
- package/dist/src/internal/instructions/closeSettingsTransaction.js +22 -0
- package/dist/src/internal/instructions/closeTransaction.d.ts +8 -0
- package/dist/src/internal/instructions/closeTransaction.js +22 -0
- package/dist/src/internal/instructions/closeTransactionBuffer.d.ts +8 -0
- package/dist/src/internal/instructions/closeTransactionBuffer.js +15 -0
- package/dist/src/internal/instructions/createBatch.d.ts +12 -0
- package/dist/src/internal/instructions/createBatch.js +15 -0
- package/dist/src/internal/instructions/createPolicyTransaction.d.ts +11 -0
- package/dist/src/internal/instructions/createPolicyTransaction.js +21 -0
- package/dist/src/internal/instructions/createProposal.d.ts +11 -0
- package/dist/src/internal/instructions/createProposal.js +19 -0
- package/dist/src/internal/instructions/createSettingsTransaction.d.ts +14 -0
- package/dist/src/internal/instructions/createSettingsTransaction.js +17 -0
- package/dist/src/internal/instructions/createSmartAccount.d.ts +15 -0
- package/dist/src/internal/instructions/createSmartAccount.js +30 -0
- package/dist/src/internal/instructions/createTransaction.d.ts +16 -0
- package/dist/src/internal/instructions/createTransaction.js +39 -0
- package/dist/src/internal/instructions/createTransactionBuffer.d.ts +13 -0
- package/dist/src/internal/instructions/createTransactionBuffer.js +24 -0
- package/dist/src/internal/instructions/createTransactionFromBuffer.d.ts +13 -0
- package/dist/src/internal/instructions/createTransactionFromBuffer.js +39 -0
- package/dist/src/internal/instructions/executeBatchTransaction.d.ts +13 -0
- package/dist/src/internal/instructions/executeBatchTransaction.js +47 -0
- package/dist/src/internal/instructions/executePolicyPayloadSync.d.ts +15 -0
- package/dist/src/internal/instructions/executePolicyPayloadSync.js +18 -0
- package/dist/src/internal/instructions/executePolicyTransaction.d.ts +9 -0
- package/dist/src/internal/instructions/executePolicyTransaction.js +22 -0
- package/dist/src/internal/instructions/executeSettingsTransaction.d.ts +12 -0
- package/dist/src/internal/instructions/executeSettingsTransaction.js +37 -0
- package/dist/src/internal/instructions/executeSettingsTransactionSync.d.ts +11 -0
- package/dist/src/internal/instructions/executeSettingsTransactionSync.js +26 -0
- package/dist/src/internal/instructions/executeTransaction.d.ts +12 -0
- package/dist/src/internal/instructions/executeTransaction.js +49 -0
- package/dist/src/internal/instructions/executeTransactionSync.d.ts +14 -0
- package/dist/src/internal/instructions/executeTransactionSync.js +15 -0
- package/dist/src/internal/instructions/executeTransactionSyncV2.d.ts +14 -0
- package/dist/src/internal/instructions/executeTransactionSyncV2.js +18 -0
- package/dist/src/internal/instructions/extendTransactionBuffer.d.ts +9 -0
- package/dist/src/internal/instructions/extendTransactionBuffer.js +19 -0
- package/dist/src/internal/instructions/index.d.ts +42 -0
- package/dist/src/internal/instructions/index.js +42 -0
- package/dist/src/internal/instructions/initializeProgramConfig.d.ts +9 -0
- package/dist/src/internal/instructions/initializeProgramConfig.js +16 -0
- package/dist/src/internal/instructions/logEvent.d.ts +6 -0
- package/dist/src/internal/instructions/logEvent.js +10 -0
- package/dist/src/internal/instructions/rejectProposal.d.ts +8 -0
- package/dist/src/internal/instructions/rejectProposal.js +15 -0
- package/dist/src/internal/instructions/removeSignerAsAuthority.d.ts +8 -0
- package/dist/src/internal/instructions/removeSignerAsAuthority.js +10 -0
- package/dist/src/internal/instructions/removeSpendingLimitAsAuthority.d.ts +9 -0
- package/dist/src/internal/instructions/removeSpendingLimitAsAuthority.js +14 -0
- package/dist/src/internal/instructions/setArchivalAuthorityAsAuthority.d.ts +8 -0
- package/dist/src/internal/instructions/setArchivalAuthorityAsAuthority.js +15 -0
- package/dist/src/internal/instructions/setNewSettingsAuthorityAsAuthority.d.ts +8 -0
- package/dist/src/internal/instructions/setNewSettingsAuthorityAsAuthority.js +13 -0
- package/dist/src/internal/instructions/setProgramConfigAuthority.d.ts +6 -0
- package/dist/src/internal/instructions/setProgramConfigAuthority.js +13 -0
- package/dist/src/internal/instructions/setProgramConfigSmartAccountCreationFee.d.ts +7 -0
- package/dist/src/internal/instructions/setProgramConfigSmartAccountCreationFee.js +14 -0
- package/dist/src/internal/instructions/setProgramConfigTreasury.d.ts +6 -0
- package/dist/src/internal/instructions/setProgramConfigTreasury.js +13 -0
- package/dist/src/internal/instructions/setTimeLockAsAuthority.d.ts +8 -0
- package/dist/src/internal/instructions/setTimeLockAsAuthority.js +13 -0
- package/dist/src/internal/instructions/useSpendingLimit.d.ts +15 -0
- package/dist/src/internal/instructions/useSpendingLimit.js +24 -0
- package/dist/src/internal/pda.d.ts +1 -0
- package/dist/src/internal/pda.js +1 -0
- package/dist/src/internal/utils.d.ts +1 -0
- package/dist/src/internal/utils.js +1 -0
- package/dist/src/loyal.d.ts +18 -0
- package/dist/src/loyal.js +56 -0
- package/dist/src/pda.d.ts +1 -0
- package/dist/src/pda.js +1 -0
- package/dist/src/spec/features.d.ts +15 -0
- package/dist/src/spec/features.js +69 -0
- package/dist/src/spec/idl.d.ts +3 -0
- package/dist/src/spec/idl.js +75 -0
- package/dist/src/spec/index.d.ts +4 -0
- package/dist/src/spec/index.js +4 -0
- package/dist/src/spec/operation-registry.d.ts +385 -0
- package/dist/src/spec/operation-registry.js +390 -0
- package/dist/src/spec/pda-registry.d.ts +32 -0
- package/dist/src/spec/pda-registry.js +71 -0
- package/dist/src/transport.d.ts +1 -0
- package/dist/src/transport.js +1 -0
- package/dist/src/types.d.ts +69 -0
- package/dist/src/types.js +129 -0
- package/dist/src/utils/compileToSynchronousMessage.d.ts +9 -0
- package/dist/src/utils/compileToSynchronousMessage.js +87 -0
- package/dist/src/utils/compileToSynchronousMessageV2.d.ts +19 -0
- package/dist/src/utils/compileToSynchronousMessageV2.js +154 -0
- package/dist/src/utils/compileToWrappedMessageV0.d.ts +7 -0
- package/dist/src/utils/compileToWrappedMessageV0.js +30 -0
- package/dist/src/utils/compiled-keys.d.ts +31 -0
- package/dist/src/utils/compiled-keys.js +144 -0
- package/dist/src/utils.d.ts +61 -0
- package/dist/src/utils.js +217 -0
- package/package.json +71 -0
- package/upstream/manifest.json +14 -0
- package/upstream/normalized/squads_smart_account_program.json +6020 -0
- package/upstream/raw/squads_smart_account_program.json +6020 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was GENERATED using the solita package.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
|
|
4
|
+
*
|
|
5
|
+
* See: https://github.com/metaplex-foundation/solita
|
|
6
|
+
*/
|
|
7
|
+
import * as beet from '@metaplex-foundation/beet';
|
|
8
|
+
import * as web3 from '@solana/web3.js';
|
|
9
|
+
import * as beetSolana from '@metaplex-foundation/beet-solana';
|
|
10
|
+
export const programConfigDiscriminator = [196, 210, 90, 231, 144, 149, 140, 63];
|
|
11
|
+
/**
|
|
12
|
+
* Holds the data for the {@link ProgramConfig} Account and provides de/serialization
|
|
13
|
+
* functionality for that data
|
|
14
|
+
*
|
|
15
|
+
* @category Accounts
|
|
16
|
+
* @category generated
|
|
17
|
+
*/
|
|
18
|
+
export class ProgramConfig {
|
|
19
|
+
smartAccountIndex;
|
|
20
|
+
authority;
|
|
21
|
+
smartAccountCreationFee;
|
|
22
|
+
treasury;
|
|
23
|
+
reserved;
|
|
24
|
+
constructor(smartAccountIndex, authority, smartAccountCreationFee, treasury, reserved /* size: 64 */) {
|
|
25
|
+
this.smartAccountIndex = smartAccountIndex;
|
|
26
|
+
this.authority = authority;
|
|
27
|
+
this.smartAccountCreationFee = smartAccountCreationFee;
|
|
28
|
+
this.treasury = treasury;
|
|
29
|
+
this.reserved = reserved;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Creates a {@link ProgramConfig} instance from the provided args.
|
|
33
|
+
*/
|
|
34
|
+
static fromArgs(args) {
|
|
35
|
+
return new ProgramConfig(args.smartAccountIndex, args.authority, args.smartAccountCreationFee, args.treasury, args.reserved);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Deserializes the {@link ProgramConfig} from the data of the provided {@link web3.AccountInfo}.
|
|
39
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
40
|
+
*/
|
|
41
|
+
static fromAccountInfo(accountInfo, offset = 0) {
|
|
42
|
+
return ProgramConfig.deserialize(accountInfo.data, offset);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Retrieves the account info from the provided address and deserializes
|
|
46
|
+
* the {@link ProgramConfig} from its data.
|
|
47
|
+
*
|
|
48
|
+
* @throws Error if no account info is found at the address or if deserialization fails
|
|
49
|
+
*/
|
|
50
|
+
static async fromAccountAddress(connection, address, commitmentOrConfig) {
|
|
51
|
+
const accountInfo = await connection.getAccountInfo(address, commitmentOrConfig);
|
|
52
|
+
if (accountInfo == null) {
|
|
53
|
+
throw new Error(`Unable to find ProgramConfig account at ${address}`);
|
|
54
|
+
}
|
|
55
|
+
return ProgramConfig.fromAccountInfo(accountInfo, 0)[0];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Provides a {@link web3.Connection.getProgramAccounts} config builder,
|
|
59
|
+
* to fetch accounts matching filters that can be specified via that builder.
|
|
60
|
+
*
|
|
61
|
+
* @param programId - the program that owns the accounts we are filtering
|
|
62
|
+
*/
|
|
63
|
+
static gpaBuilder(programId = new web3.PublicKey('SMRTzfY6DfH5ik3TKiyLFfXexV8uSG3d2UksSCYdunG')) {
|
|
64
|
+
return beetSolana.GpaBuilder.fromStruct(programId, programConfigBeet);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Deserializes the {@link ProgramConfig} from the provided data Buffer.
|
|
68
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
69
|
+
*/
|
|
70
|
+
static deserialize(buf, offset = 0) {
|
|
71
|
+
return programConfigBeet.deserialize(buf, offset);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Serializes the {@link ProgramConfig} into a Buffer.
|
|
75
|
+
* @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it.
|
|
76
|
+
*/
|
|
77
|
+
serialize() {
|
|
78
|
+
return programConfigBeet.serialize({
|
|
79
|
+
accountDiscriminator: programConfigDiscriminator,
|
|
80
|
+
...this,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Returns the byteSize of a {@link Buffer} holding the serialized data of
|
|
85
|
+
* {@link ProgramConfig}
|
|
86
|
+
*/
|
|
87
|
+
static get byteSize() {
|
|
88
|
+
return programConfigBeet.byteSize;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Fetches the minimum balance needed to exempt an account holding
|
|
92
|
+
* {@link ProgramConfig} data from rent
|
|
93
|
+
*
|
|
94
|
+
* @param connection used to retrieve the rent exemption information
|
|
95
|
+
*/
|
|
96
|
+
static async getMinimumBalanceForRentExemption(connection, commitment) {
|
|
97
|
+
return connection.getMinimumBalanceForRentExemption(ProgramConfig.byteSize, commitment);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Determines if the provided {@link Buffer} has the correct byte size to
|
|
101
|
+
* hold {@link ProgramConfig} data.
|
|
102
|
+
*/
|
|
103
|
+
static hasCorrectByteSize(buf, offset = 0) {
|
|
104
|
+
return buf.byteLength - offset === ProgramConfig.byteSize;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Returns a readable version of {@link ProgramConfig} properties
|
|
108
|
+
* and can be used to convert to JSON and/or logging
|
|
109
|
+
*/
|
|
110
|
+
pretty() {
|
|
111
|
+
return {
|
|
112
|
+
smartAccountIndex: (() => {
|
|
113
|
+
const x = this.smartAccountIndex;
|
|
114
|
+
if (typeof x.toNumber === 'function') {
|
|
115
|
+
try {
|
|
116
|
+
return x.toNumber();
|
|
117
|
+
}
|
|
118
|
+
catch (_) {
|
|
119
|
+
return x;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return x;
|
|
123
|
+
})(),
|
|
124
|
+
authority: this.authority.toBase58(),
|
|
125
|
+
smartAccountCreationFee: (() => {
|
|
126
|
+
const x = this.smartAccountCreationFee;
|
|
127
|
+
if (typeof x.toNumber === 'function') {
|
|
128
|
+
try {
|
|
129
|
+
return x.toNumber();
|
|
130
|
+
}
|
|
131
|
+
catch (_) {
|
|
132
|
+
return x;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return x;
|
|
136
|
+
})(),
|
|
137
|
+
treasury: this.treasury.toBase58(),
|
|
138
|
+
reserved: this.reserved,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* @category Accounts
|
|
144
|
+
* @category generated
|
|
145
|
+
*/
|
|
146
|
+
export const programConfigBeet = new beet.BeetStruct([
|
|
147
|
+
['accountDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)],
|
|
148
|
+
['smartAccountIndex', beet.u128],
|
|
149
|
+
['authority', beetSolana.publicKey],
|
|
150
|
+
['smartAccountCreationFee', beet.u64],
|
|
151
|
+
['treasury', beetSolana.publicKey],
|
|
152
|
+
['reserved', beet.uniformFixedSizeArray(beet.u8, 64)],
|
|
153
|
+
], ProgramConfig.fromArgs, 'ProgramConfig');
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was GENERATED using the solita package.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
|
|
4
|
+
*
|
|
5
|
+
* See: https://github.com/metaplex-foundation/solita
|
|
6
|
+
*/
|
|
7
|
+
import * as web3 from '@solana/web3.js';
|
|
8
|
+
import * as beet from '@metaplex-foundation/beet';
|
|
9
|
+
import * as beetSolana from '@metaplex-foundation/beet-solana';
|
|
10
|
+
import { ProposalStatus } from '../types/ProposalStatus';
|
|
11
|
+
/**
|
|
12
|
+
* Arguments used to create {@link Proposal}
|
|
13
|
+
* @category Accounts
|
|
14
|
+
* @category generated
|
|
15
|
+
*/
|
|
16
|
+
export type ProposalArgs = {
|
|
17
|
+
settings: web3.PublicKey;
|
|
18
|
+
transactionIndex: beet.bignum;
|
|
19
|
+
rentCollector: web3.PublicKey;
|
|
20
|
+
status: ProposalStatus;
|
|
21
|
+
bump: number;
|
|
22
|
+
approved: web3.PublicKey[];
|
|
23
|
+
rejected: web3.PublicKey[];
|
|
24
|
+
cancelled: web3.PublicKey[];
|
|
25
|
+
};
|
|
26
|
+
export declare const proposalDiscriminator: number[];
|
|
27
|
+
/**
|
|
28
|
+
* Holds the data for the {@link Proposal} Account and provides de/serialization
|
|
29
|
+
* functionality for that data
|
|
30
|
+
*
|
|
31
|
+
* @category Accounts
|
|
32
|
+
* @category generated
|
|
33
|
+
*/
|
|
34
|
+
export declare class Proposal implements ProposalArgs {
|
|
35
|
+
readonly settings: web3.PublicKey;
|
|
36
|
+
readonly transactionIndex: beet.bignum;
|
|
37
|
+
readonly rentCollector: web3.PublicKey;
|
|
38
|
+
readonly status: ProposalStatus;
|
|
39
|
+
readonly bump: number;
|
|
40
|
+
readonly approved: web3.PublicKey[];
|
|
41
|
+
readonly rejected: web3.PublicKey[];
|
|
42
|
+
readonly cancelled: web3.PublicKey[];
|
|
43
|
+
private constructor();
|
|
44
|
+
/**
|
|
45
|
+
* Creates a {@link Proposal} instance from the provided args.
|
|
46
|
+
*/
|
|
47
|
+
static fromArgs(args: ProposalArgs): Proposal;
|
|
48
|
+
/**
|
|
49
|
+
* Deserializes the {@link Proposal} from the data of the provided {@link web3.AccountInfo}.
|
|
50
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
51
|
+
*/
|
|
52
|
+
static fromAccountInfo(accountInfo: web3.AccountInfo<Buffer>, offset?: number): [Proposal, number];
|
|
53
|
+
/**
|
|
54
|
+
* Retrieves the account info from the provided address and deserializes
|
|
55
|
+
* the {@link Proposal} from its data.
|
|
56
|
+
*
|
|
57
|
+
* @throws Error if no account info is found at the address or if deserialization fails
|
|
58
|
+
*/
|
|
59
|
+
static fromAccountAddress(connection: web3.Connection, address: web3.PublicKey, commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig): Promise<Proposal>;
|
|
60
|
+
/**
|
|
61
|
+
* Provides a {@link web3.Connection.getProgramAccounts} config builder,
|
|
62
|
+
* to fetch accounts matching filters that can be specified via that builder.
|
|
63
|
+
*
|
|
64
|
+
* @param programId - the program that owns the accounts we are filtering
|
|
65
|
+
*/
|
|
66
|
+
static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<ProposalArgs & {
|
|
67
|
+
accountDiscriminator: number[];
|
|
68
|
+
}>;
|
|
69
|
+
/**
|
|
70
|
+
* Deserializes the {@link Proposal} from the provided data Buffer.
|
|
71
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
72
|
+
*/
|
|
73
|
+
static deserialize(buf: Buffer, offset?: number): [Proposal, number];
|
|
74
|
+
/**
|
|
75
|
+
* Serializes the {@link Proposal} into a Buffer.
|
|
76
|
+
* @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it.
|
|
77
|
+
*/
|
|
78
|
+
serialize(): [Buffer, number];
|
|
79
|
+
/**
|
|
80
|
+
* Returns the byteSize of a {@link Buffer} holding the serialized data of
|
|
81
|
+
* {@link Proposal} for the provided args.
|
|
82
|
+
*
|
|
83
|
+
* @param args need to be provided since the byte size for this account
|
|
84
|
+
* depends on them
|
|
85
|
+
*/
|
|
86
|
+
static byteSize(args: ProposalArgs): number;
|
|
87
|
+
/**
|
|
88
|
+
* Fetches the minimum balance needed to exempt an account holding
|
|
89
|
+
* {@link Proposal} data from rent
|
|
90
|
+
*
|
|
91
|
+
* @param args need to be provided since the byte size for this account
|
|
92
|
+
* depends on them
|
|
93
|
+
* @param connection used to retrieve the rent exemption information
|
|
94
|
+
*/
|
|
95
|
+
static getMinimumBalanceForRentExemption(args: ProposalArgs, connection: web3.Connection, commitment?: web3.Commitment): Promise<number>;
|
|
96
|
+
/**
|
|
97
|
+
* Returns a readable version of {@link Proposal} properties
|
|
98
|
+
* and can be used to convert to JSON and/or logging
|
|
99
|
+
*/
|
|
100
|
+
pretty(): {
|
|
101
|
+
settings: string;
|
|
102
|
+
transactionIndex: number | {
|
|
103
|
+
toNumber: () => number;
|
|
104
|
+
};
|
|
105
|
+
rentCollector: string;
|
|
106
|
+
status: "Draft" | "Active" | "Rejected" | "Approved" | "Executing" | "Executed" | "Cancelled";
|
|
107
|
+
bump: number;
|
|
108
|
+
approved: web3.PublicKey[];
|
|
109
|
+
rejected: web3.PublicKey[];
|
|
110
|
+
cancelled: web3.PublicKey[];
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* @category Accounts
|
|
115
|
+
* @category generated
|
|
116
|
+
*/
|
|
117
|
+
export declare const proposalBeet: beet.FixableBeetStruct<Proposal, ProposalArgs & {
|
|
118
|
+
accountDiscriminator: number[];
|
|
119
|
+
}>;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was GENERATED using the solita package.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
|
|
4
|
+
*
|
|
5
|
+
* See: https://github.com/metaplex-foundation/solita
|
|
6
|
+
*/
|
|
7
|
+
import * as web3 from '@solana/web3.js';
|
|
8
|
+
import * as beet from '@metaplex-foundation/beet';
|
|
9
|
+
import * as beetSolana from '@metaplex-foundation/beet-solana';
|
|
10
|
+
import { proposalStatusBeet } from '../types/ProposalStatus';
|
|
11
|
+
export const proposalDiscriminator = [26, 94, 189, 187, 116, 136, 53, 33];
|
|
12
|
+
/**
|
|
13
|
+
* Holds the data for the {@link Proposal} Account and provides de/serialization
|
|
14
|
+
* functionality for that data
|
|
15
|
+
*
|
|
16
|
+
* @category Accounts
|
|
17
|
+
* @category generated
|
|
18
|
+
*/
|
|
19
|
+
export class Proposal {
|
|
20
|
+
settings;
|
|
21
|
+
transactionIndex;
|
|
22
|
+
rentCollector;
|
|
23
|
+
status;
|
|
24
|
+
bump;
|
|
25
|
+
approved;
|
|
26
|
+
rejected;
|
|
27
|
+
cancelled;
|
|
28
|
+
constructor(settings, transactionIndex, rentCollector, status, bump, approved, rejected, cancelled) {
|
|
29
|
+
this.settings = settings;
|
|
30
|
+
this.transactionIndex = transactionIndex;
|
|
31
|
+
this.rentCollector = rentCollector;
|
|
32
|
+
this.status = status;
|
|
33
|
+
this.bump = bump;
|
|
34
|
+
this.approved = approved;
|
|
35
|
+
this.rejected = rejected;
|
|
36
|
+
this.cancelled = cancelled;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Creates a {@link Proposal} instance from the provided args.
|
|
40
|
+
*/
|
|
41
|
+
static fromArgs(args) {
|
|
42
|
+
return new Proposal(args.settings, args.transactionIndex, args.rentCollector, args.status, args.bump, args.approved, args.rejected, args.cancelled);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Deserializes the {@link Proposal} from the data of the provided {@link web3.AccountInfo}.
|
|
46
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
47
|
+
*/
|
|
48
|
+
static fromAccountInfo(accountInfo, offset = 0) {
|
|
49
|
+
return Proposal.deserialize(accountInfo.data, offset);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Retrieves the account info from the provided address and deserializes
|
|
53
|
+
* the {@link Proposal} from its data.
|
|
54
|
+
*
|
|
55
|
+
* @throws Error if no account info is found at the address or if deserialization fails
|
|
56
|
+
*/
|
|
57
|
+
static async fromAccountAddress(connection, address, commitmentOrConfig) {
|
|
58
|
+
const accountInfo = await connection.getAccountInfo(address, commitmentOrConfig);
|
|
59
|
+
if (accountInfo == null) {
|
|
60
|
+
throw new Error(`Unable to find Proposal account at ${address}`);
|
|
61
|
+
}
|
|
62
|
+
return Proposal.fromAccountInfo(accountInfo, 0)[0];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Provides a {@link web3.Connection.getProgramAccounts} config builder,
|
|
66
|
+
* to fetch accounts matching filters that can be specified via that builder.
|
|
67
|
+
*
|
|
68
|
+
* @param programId - the program that owns the accounts we are filtering
|
|
69
|
+
*/
|
|
70
|
+
static gpaBuilder(programId = new web3.PublicKey('SMRTzfY6DfH5ik3TKiyLFfXexV8uSG3d2UksSCYdunG')) {
|
|
71
|
+
return beetSolana.GpaBuilder.fromStruct(programId, proposalBeet);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Deserializes the {@link Proposal} from the provided data Buffer.
|
|
75
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
76
|
+
*/
|
|
77
|
+
static deserialize(buf, offset = 0) {
|
|
78
|
+
return proposalBeet.deserialize(buf, offset);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Serializes the {@link Proposal} into a Buffer.
|
|
82
|
+
* @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it.
|
|
83
|
+
*/
|
|
84
|
+
serialize() {
|
|
85
|
+
return proposalBeet.serialize({
|
|
86
|
+
accountDiscriminator: proposalDiscriminator,
|
|
87
|
+
...this,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Returns the byteSize of a {@link Buffer} holding the serialized data of
|
|
92
|
+
* {@link Proposal} for the provided args.
|
|
93
|
+
*
|
|
94
|
+
* @param args need to be provided since the byte size for this account
|
|
95
|
+
* depends on them
|
|
96
|
+
*/
|
|
97
|
+
static byteSize(args) {
|
|
98
|
+
const instance = Proposal.fromArgs(args);
|
|
99
|
+
return proposalBeet.toFixedFromValue({
|
|
100
|
+
accountDiscriminator: proposalDiscriminator,
|
|
101
|
+
...instance,
|
|
102
|
+
}).byteSize;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Fetches the minimum balance needed to exempt an account holding
|
|
106
|
+
* {@link Proposal} data from rent
|
|
107
|
+
*
|
|
108
|
+
* @param args need to be provided since the byte size for this account
|
|
109
|
+
* depends on them
|
|
110
|
+
* @param connection used to retrieve the rent exemption information
|
|
111
|
+
*/
|
|
112
|
+
static async getMinimumBalanceForRentExemption(args, connection, commitment) {
|
|
113
|
+
return connection.getMinimumBalanceForRentExemption(Proposal.byteSize(args), commitment);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Returns a readable version of {@link Proposal} properties
|
|
117
|
+
* and can be used to convert to JSON and/or logging
|
|
118
|
+
*/
|
|
119
|
+
pretty() {
|
|
120
|
+
return {
|
|
121
|
+
settings: this.settings.toBase58(),
|
|
122
|
+
transactionIndex: (() => {
|
|
123
|
+
const x = this.transactionIndex;
|
|
124
|
+
if (typeof x.toNumber === 'function') {
|
|
125
|
+
try {
|
|
126
|
+
return x.toNumber();
|
|
127
|
+
}
|
|
128
|
+
catch (_) {
|
|
129
|
+
return x;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return x;
|
|
133
|
+
})(),
|
|
134
|
+
rentCollector: this.rentCollector.toBase58(),
|
|
135
|
+
status: this.status.__kind,
|
|
136
|
+
bump: this.bump,
|
|
137
|
+
approved: this.approved,
|
|
138
|
+
rejected: this.rejected,
|
|
139
|
+
cancelled: this.cancelled,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* @category Accounts
|
|
145
|
+
* @category generated
|
|
146
|
+
*/
|
|
147
|
+
export const proposalBeet = new beet.FixableBeetStruct([
|
|
148
|
+
['accountDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)],
|
|
149
|
+
['settings', beetSolana.publicKey],
|
|
150
|
+
['transactionIndex', beet.u64],
|
|
151
|
+
['rentCollector', beetSolana.publicKey],
|
|
152
|
+
['status', proposalStatusBeet],
|
|
153
|
+
['bump', beet.u8],
|
|
154
|
+
['approved', beet.array(beetSolana.publicKey)],
|
|
155
|
+
['rejected', beet.array(beetSolana.publicKey)],
|
|
156
|
+
['cancelled', beet.array(beetSolana.publicKey)],
|
|
157
|
+
], Proposal.fromArgs, 'Proposal');
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was GENERATED using the solita package.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
|
|
4
|
+
*
|
|
5
|
+
* See: https://github.com/metaplex-foundation/solita
|
|
6
|
+
*/
|
|
7
|
+
import * as beet from '@metaplex-foundation/beet';
|
|
8
|
+
import * as web3 from '@solana/web3.js';
|
|
9
|
+
import * as beetSolana from '@metaplex-foundation/beet-solana';
|
|
10
|
+
import { SmartAccountSigner } from '../types/SmartAccountSigner';
|
|
11
|
+
/**
|
|
12
|
+
* Arguments used to create {@link Settings}
|
|
13
|
+
* @category Accounts
|
|
14
|
+
* @category generated
|
|
15
|
+
*/
|
|
16
|
+
export type SettingsArgs = {
|
|
17
|
+
seed: beet.bignum;
|
|
18
|
+
settingsAuthority: web3.PublicKey;
|
|
19
|
+
threshold: number;
|
|
20
|
+
timeLock: number;
|
|
21
|
+
transactionIndex: beet.bignum;
|
|
22
|
+
staleTransactionIndex: beet.bignum;
|
|
23
|
+
archivalAuthority: beet.COption<web3.PublicKey>;
|
|
24
|
+
archivableAfter: beet.bignum;
|
|
25
|
+
bump: number;
|
|
26
|
+
signers: SmartAccountSigner[];
|
|
27
|
+
accountUtilization: number;
|
|
28
|
+
policySeed: beet.COption<beet.bignum>;
|
|
29
|
+
reserved2: number;
|
|
30
|
+
};
|
|
31
|
+
export declare const settingsDiscriminator: number[];
|
|
32
|
+
/**
|
|
33
|
+
* Holds the data for the {@link Settings} Account and provides de/serialization
|
|
34
|
+
* functionality for that data
|
|
35
|
+
*
|
|
36
|
+
* @category Accounts
|
|
37
|
+
* @category generated
|
|
38
|
+
*/
|
|
39
|
+
export declare class Settings implements SettingsArgs {
|
|
40
|
+
readonly seed: beet.bignum;
|
|
41
|
+
readonly settingsAuthority: web3.PublicKey;
|
|
42
|
+
readonly threshold: number;
|
|
43
|
+
readonly timeLock: number;
|
|
44
|
+
readonly transactionIndex: beet.bignum;
|
|
45
|
+
readonly staleTransactionIndex: beet.bignum;
|
|
46
|
+
readonly archivalAuthority: beet.COption<web3.PublicKey>;
|
|
47
|
+
readonly archivableAfter: beet.bignum;
|
|
48
|
+
readonly bump: number;
|
|
49
|
+
readonly signers: SmartAccountSigner[];
|
|
50
|
+
readonly accountUtilization: number;
|
|
51
|
+
readonly policySeed: beet.COption<beet.bignum>;
|
|
52
|
+
readonly reserved2: number;
|
|
53
|
+
private constructor();
|
|
54
|
+
/**
|
|
55
|
+
* Creates a {@link Settings} instance from the provided args.
|
|
56
|
+
*/
|
|
57
|
+
static fromArgs(args: SettingsArgs): Settings;
|
|
58
|
+
/**
|
|
59
|
+
* Deserializes the {@link Settings} from the data of the provided {@link web3.AccountInfo}.
|
|
60
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
61
|
+
*/
|
|
62
|
+
static fromAccountInfo(accountInfo: web3.AccountInfo<Buffer>, offset?: number): [Settings, number];
|
|
63
|
+
/**
|
|
64
|
+
* Retrieves the account info from the provided address and deserializes
|
|
65
|
+
* the {@link Settings} from its data.
|
|
66
|
+
*
|
|
67
|
+
* @throws Error if no account info is found at the address or if deserialization fails
|
|
68
|
+
*/
|
|
69
|
+
static fromAccountAddress(connection: web3.Connection, address: web3.PublicKey, commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig): Promise<Settings>;
|
|
70
|
+
/**
|
|
71
|
+
* Provides a {@link web3.Connection.getProgramAccounts} config builder,
|
|
72
|
+
* to fetch accounts matching filters that can be specified via that builder.
|
|
73
|
+
*
|
|
74
|
+
* @param programId - the program that owns the accounts we are filtering
|
|
75
|
+
*/
|
|
76
|
+
static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<SettingsArgs & {
|
|
77
|
+
accountDiscriminator: number[];
|
|
78
|
+
}>;
|
|
79
|
+
/**
|
|
80
|
+
* Deserializes the {@link Settings} from the provided data Buffer.
|
|
81
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
82
|
+
*/
|
|
83
|
+
static deserialize(buf: Buffer, offset?: number): [Settings, number];
|
|
84
|
+
/**
|
|
85
|
+
* Serializes the {@link Settings} into a Buffer.
|
|
86
|
+
* @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it.
|
|
87
|
+
*/
|
|
88
|
+
serialize(): [Buffer, number];
|
|
89
|
+
/**
|
|
90
|
+
* Returns the byteSize of a {@link Buffer} holding the serialized data of
|
|
91
|
+
* {@link Settings} for the provided args.
|
|
92
|
+
*
|
|
93
|
+
* @param args need to be provided since the byte size for this account
|
|
94
|
+
* depends on them
|
|
95
|
+
*/
|
|
96
|
+
static byteSize(args: SettingsArgs): number;
|
|
97
|
+
/**
|
|
98
|
+
* Fetches the minimum balance needed to exempt an account holding
|
|
99
|
+
* {@link Settings} data from rent
|
|
100
|
+
*
|
|
101
|
+
* @param args need to be provided since the byte size for this account
|
|
102
|
+
* depends on them
|
|
103
|
+
* @param connection used to retrieve the rent exemption information
|
|
104
|
+
*/
|
|
105
|
+
static getMinimumBalanceForRentExemption(args: SettingsArgs, connection: web3.Connection, commitment?: web3.Commitment): Promise<number>;
|
|
106
|
+
/**
|
|
107
|
+
* Returns a readable version of {@link Settings} properties
|
|
108
|
+
* and can be used to convert to JSON and/or logging
|
|
109
|
+
*/
|
|
110
|
+
pretty(): {
|
|
111
|
+
seed: number | {
|
|
112
|
+
toNumber: () => number;
|
|
113
|
+
};
|
|
114
|
+
settingsAuthority: string;
|
|
115
|
+
threshold: number;
|
|
116
|
+
timeLock: number;
|
|
117
|
+
transactionIndex: number | {
|
|
118
|
+
toNumber: () => number;
|
|
119
|
+
};
|
|
120
|
+
staleTransactionIndex: number | {
|
|
121
|
+
toNumber: () => number;
|
|
122
|
+
};
|
|
123
|
+
archivalAuthority: beet.COption<web3.PublicKey>;
|
|
124
|
+
archivableAfter: number | {
|
|
125
|
+
toNumber: () => number;
|
|
126
|
+
};
|
|
127
|
+
bump: number;
|
|
128
|
+
signers: SmartAccountSigner[];
|
|
129
|
+
accountUtilization: number;
|
|
130
|
+
policySeed: beet.COption<beet.bignum>;
|
|
131
|
+
reserved2: number;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* @category Accounts
|
|
136
|
+
* @category generated
|
|
137
|
+
*/
|
|
138
|
+
export declare const settingsBeet: beet.FixableBeetStruct<Settings, SettingsArgs & {
|
|
139
|
+
accountDiscriminator: number[];
|
|
140
|
+
}>;
|