@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,210 @@
|
|
|
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 { smartAccountSignerBeet, } from '../types/SmartAccountSigner';
|
|
11
|
+
export const settingsDiscriminator = [223, 179, 163, 190, 177, 224, 67, 173];
|
|
12
|
+
/**
|
|
13
|
+
* Holds the data for the {@link Settings} Account and provides de/serialization
|
|
14
|
+
* functionality for that data
|
|
15
|
+
*
|
|
16
|
+
* @category Accounts
|
|
17
|
+
* @category generated
|
|
18
|
+
*/
|
|
19
|
+
export class Settings {
|
|
20
|
+
seed;
|
|
21
|
+
settingsAuthority;
|
|
22
|
+
threshold;
|
|
23
|
+
timeLock;
|
|
24
|
+
transactionIndex;
|
|
25
|
+
staleTransactionIndex;
|
|
26
|
+
archivalAuthority;
|
|
27
|
+
archivableAfter;
|
|
28
|
+
bump;
|
|
29
|
+
signers;
|
|
30
|
+
accountUtilization;
|
|
31
|
+
policySeed;
|
|
32
|
+
reserved2;
|
|
33
|
+
constructor(seed, settingsAuthority, threshold, timeLock, transactionIndex, staleTransactionIndex, archivalAuthority, archivableAfter, bump, signers, accountUtilization, policySeed, reserved2) {
|
|
34
|
+
this.seed = seed;
|
|
35
|
+
this.settingsAuthority = settingsAuthority;
|
|
36
|
+
this.threshold = threshold;
|
|
37
|
+
this.timeLock = timeLock;
|
|
38
|
+
this.transactionIndex = transactionIndex;
|
|
39
|
+
this.staleTransactionIndex = staleTransactionIndex;
|
|
40
|
+
this.archivalAuthority = archivalAuthority;
|
|
41
|
+
this.archivableAfter = archivableAfter;
|
|
42
|
+
this.bump = bump;
|
|
43
|
+
this.signers = signers;
|
|
44
|
+
this.accountUtilization = accountUtilization;
|
|
45
|
+
this.policySeed = policySeed;
|
|
46
|
+
this.reserved2 = reserved2;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Creates a {@link Settings} instance from the provided args.
|
|
50
|
+
*/
|
|
51
|
+
static fromArgs(args) {
|
|
52
|
+
return new Settings(args.seed, args.settingsAuthority, args.threshold, args.timeLock, args.transactionIndex, args.staleTransactionIndex, args.archivalAuthority, args.archivableAfter, args.bump, args.signers, args.accountUtilization, args.policySeed, args.reserved2);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Deserializes the {@link Settings} from the data of the provided {@link web3.AccountInfo}.
|
|
56
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
57
|
+
*/
|
|
58
|
+
static fromAccountInfo(accountInfo, offset = 0) {
|
|
59
|
+
return Settings.deserialize(accountInfo.data, offset);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Retrieves the account info from the provided address and deserializes
|
|
63
|
+
* the {@link Settings} from its data.
|
|
64
|
+
*
|
|
65
|
+
* @throws Error if no account info is found at the address or if deserialization fails
|
|
66
|
+
*/
|
|
67
|
+
static async fromAccountAddress(connection, address, commitmentOrConfig) {
|
|
68
|
+
const accountInfo = await connection.getAccountInfo(address, commitmentOrConfig);
|
|
69
|
+
if (accountInfo == null) {
|
|
70
|
+
throw new Error(`Unable to find Settings account at ${address}`);
|
|
71
|
+
}
|
|
72
|
+
return Settings.fromAccountInfo(accountInfo, 0)[0];
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Provides a {@link web3.Connection.getProgramAccounts} config builder,
|
|
76
|
+
* to fetch accounts matching filters that can be specified via that builder.
|
|
77
|
+
*
|
|
78
|
+
* @param programId - the program that owns the accounts we are filtering
|
|
79
|
+
*/
|
|
80
|
+
static gpaBuilder(programId = new web3.PublicKey('SMRTzfY6DfH5ik3TKiyLFfXexV8uSG3d2UksSCYdunG')) {
|
|
81
|
+
return beetSolana.GpaBuilder.fromStruct(programId, settingsBeet);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Deserializes the {@link Settings} from the provided data Buffer.
|
|
85
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
86
|
+
*/
|
|
87
|
+
static deserialize(buf, offset = 0) {
|
|
88
|
+
return settingsBeet.deserialize(buf, offset);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Serializes the {@link Settings} into a Buffer.
|
|
92
|
+
* @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it.
|
|
93
|
+
*/
|
|
94
|
+
serialize() {
|
|
95
|
+
return settingsBeet.serialize({
|
|
96
|
+
accountDiscriminator: settingsDiscriminator,
|
|
97
|
+
...this,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Returns the byteSize of a {@link Buffer} holding the serialized data of
|
|
102
|
+
* {@link Settings} for the provided args.
|
|
103
|
+
*
|
|
104
|
+
* @param args need to be provided since the byte size for this account
|
|
105
|
+
* depends on them
|
|
106
|
+
*/
|
|
107
|
+
static byteSize(args) {
|
|
108
|
+
const instance = Settings.fromArgs(args);
|
|
109
|
+
return settingsBeet.toFixedFromValue({
|
|
110
|
+
accountDiscriminator: settingsDiscriminator,
|
|
111
|
+
...instance,
|
|
112
|
+
}).byteSize;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Fetches the minimum balance needed to exempt an account holding
|
|
116
|
+
* {@link Settings} data from rent
|
|
117
|
+
*
|
|
118
|
+
* @param args need to be provided since the byte size for this account
|
|
119
|
+
* depends on them
|
|
120
|
+
* @param connection used to retrieve the rent exemption information
|
|
121
|
+
*/
|
|
122
|
+
static async getMinimumBalanceForRentExemption(args, connection, commitment) {
|
|
123
|
+
return connection.getMinimumBalanceForRentExemption(Settings.byteSize(args), commitment);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Returns a readable version of {@link Settings} properties
|
|
127
|
+
* and can be used to convert to JSON and/or logging
|
|
128
|
+
*/
|
|
129
|
+
pretty() {
|
|
130
|
+
return {
|
|
131
|
+
seed: (() => {
|
|
132
|
+
const x = this.seed;
|
|
133
|
+
if (typeof x.toNumber === 'function') {
|
|
134
|
+
try {
|
|
135
|
+
return x.toNumber();
|
|
136
|
+
}
|
|
137
|
+
catch (_) {
|
|
138
|
+
return x;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return x;
|
|
142
|
+
})(),
|
|
143
|
+
settingsAuthority: this.settingsAuthority.toBase58(),
|
|
144
|
+
threshold: this.threshold,
|
|
145
|
+
timeLock: this.timeLock,
|
|
146
|
+
transactionIndex: (() => {
|
|
147
|
+
const x = this.transactionIndex;
|
|
148
|
+
if (typeof x.toNumber === 'function') {
|
|
149
|
+
try {
|
|
150
|
+
return x.toNumber();
|
|
151
|
+
}
|
|
152
|
+
catch (_) {
|
|
153
|
+
return x;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return x;
|
|
157
|
+
})(),
|
|
158
|
+
staleTransactionIndex: (() => {
|
|
159
|
+
const x = this.staleTransactionIndex;
|
|
160
|
+
if (typeof x.toNumber === 'function') {
|
|
161
|
+
try {
|
|
162
|
+
return x.toNumber();
|
|
163
|
+
}
|
|
164
|
+
catch (_) {
|
|
165
|
+
return x;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return x;
|
|
169
|
+
})(),
|
|
170
|
+
archivalAuthority: this.archivalAuthority,
|
|
171
|
+
archivableAfter: (() => {
|
|
172
|
+
const x = this.archivableAfter;
|
|
173
|
+
if (typeof x.toNumber === 'function') {
|
|
174
|
+
try {
|
|
175
|
+
return x.toNumber();
|
|
176
|
+
}
|
|
177
|
+
catch (_) {
|
|
178
|
+
return x;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return x;
|
|
182
|
+
})(),
|
|
183
|
+
bump: this.bump,
|
|
184
|
+
signers: this.signers,
|
|
185
|
+
accountUtilization: this.accountUtilization,
|
|
186
|
+
policySeed: this.policySeed,
|
|
187
|
+
reserved2: this.reserved2,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* @category Accounts
|
|
193
|
+
* @category generated
|
|
194
|
+
*/
|
|
195
|
+
export const settingsBeet = new beet.FixableBeetStruct([
|
|
196
|
+
['accountDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)],
|
|
197
|
+
['seed', beet.u128],
|
|
198
|
+
['settingsAuthority', beetSolana.publicKey],
|
|
199
|
+
['threshold', beet.u16],
|
|
200
|
+
['timeLock', beet.u32],
|
|
201
|
+
['transactionIndex', beet.u64],
|
|
202
|
+
['staleTransactionIndex', beet.u64],
|
|
203
|
+
['archivalAuthority', beet.coption(beetSolana.publicKey)],
|
|
204
|
+
['archivableAfter', beet.u64],
|
|
205
|
+
['bump', beet.u8],
|
|
206
|
+
['signers', beet.array(smartAccountSignerBeet)],
|
|
207
|
+
['accountUtilization', beet.u8],
|
|
208
|
+
['policySeed', beet.coption(beet.u64)],
|
|
209
|
+
['reserved2', beet.u8],
|
|
210
|
+
], Settings.fromArgs, 'Settings');
|
|
@@ -0,0 +1,113 @@
|
|
|
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 { SettingsAction } from '../types/SettingsAction';
|
|
11
|
+
/**
|
|
12
|
+
* Arguments used to create {@link SettingsTransaction}
|
|
13
|
+
* @category Accounts
|
|
14
|
+
* @category generated
|
|
15
|
+
*/
|
|
16
|
+
export type SettingsTransactionArgs = {
|
|
17
|
+
settings: web3.PublicKey;
|
|
18
|
+
creator: web3.PublicKey;
|
|
19
|
+
rentCollector: web3.PublicKey;
|
|
20
|
+
index: beet.bignum;
|
|
21
|
+
bump: number;
|
|
22
|
+
actions: SettingsAction[];
|
|
23
|
+
};
|
|
24
|
+
export declare const settingsTransactionDiscriminator: number[];
|
|
25
|
+
/**
|
|
26
|
+
* Holds the data for the {@link SettingsTransaction} Account and provides de/serialization
|
|
27
|
+
* functionality for that data
|
|
28
|
+
*
|
|
29
|
+
* @category Accounts
|
|
30
|
+
* @category generated
|
|
31
|
+
*/
|
|
32
|
+
export declare class SettingsTransaction implements SettingsTransactionArgs {
|
|
33
|
+
readonly settings: web3.PublicKey;
|
|
34
|
+
readonly creator: web3.PublicKey;
|
|
35
|
+
readonly rentCollector: web3.PublicKey;
|
|
36
|
+
readonly index: beet.bignum;
|
|
37
|
+
readonly bump: number;
|
|
38
|
+
readonly actions: SettingsAction[];
|
|
39
|
+
private constructor();
|
|
40
|
+
/**
|
|
41
|
+
* Creates a {@link SettingsTransaction} instance from the provided args.
|
|
42
|
+
*/
|
|
43
|
+
static fromArgs(args: SettingsTransactionArgs): SettingsTransaction;
|
|
44
|
+
/**
|
|
45
|
+
* Deserializes the {@link SettingsTransaction} 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: web3.AccountInfo<Buffer>, offset?: number): [SettingsTransaction, number];
|
|
49
|
+
/**
|
|
50
|
+
* Retrieves the account info from the provided address and deserializes
|
|
51
|
+
* the {@link SettingsTransaction} from its data.
|
|
52
|
+
*
|
|
53
|
+
* @throws Error if no account info is found at the address or if deserialization fails
|
|
54
|
+
*/
|
|
55
|
+
static fromAccountAddress(connection: web3.Connection, address: web3.PublicKey, commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig): Promise<SettingsTransaction>;
|
|
56
|
+
/**
|
|
57
|
+
* Provides a {@link web3.Connection.getProgramAccounts} config builder,
|
|
58
|
+
* to fetch accounts matching filters that can be specified via that builder.
|
|
59
|
+
*
|
|
60
|
+
* @param programId - the program that owns the accounts we are filtering
|
|
61
|
+
*/
|
|
62
|
+
static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<SettingsTransactionArgs & {
|
|
63
|
+
accountDiscriminator: number[];
|
|
64
|
+
}>;
|
|
65
|
+
/**
|
|
66
|
+
* Deserializes the {@link SettingsTransaction} from the provided data Buffer.
|
|
67
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
68
|
+
*/
|
|
69
|
+
static deserialize(buf: Buffer, offset?: number): [SettingsTransaction, number];
|
|
70
|
+
/**
|
|
71
|
+
* Serializes the {@link SettingsTransaction} into a Buffer.
|
|
72
|
+
* @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it.
|
|
73
|
+
*/
|
|
74
|
+
serialize(): [Buffer, number];
|
|
75
|
+
/**
|
|
76
|
+
* Returns the byteSize of a {@link Buffer} holding the serialized data of
|
|
77
|
+
* {@link SettingsTransaction} for the provided args.
|
|
78
|
+
*
|
|
79
|
+
* @param args need to be provided since the byte size for this account
|
|
80
|
+
* depends on them
|
|
81
|
+
*/
|
|
82
|
+
static byteSize(args: SettingsTransactionArgs): number;
|
|
83
|
+
/**
|
|
84
|
+
* Fetches the minimum balance needed to exempt an account holding
|
|
85
|
+
* {@link SettingsTransaction} data from rent
|
|
86
|
+
*
|
|
87
|
+
* @param args need to be provided since the byte size for this account
|
|
88
|
+
* depends on them
|
|
89
|
+
* @param connection used to retrieve the rent exemption information
|
|
90
|
+
*/
|
|
91
|
+
static getMinimumBalanceForRentExemption(args: SettingsTransactionArgs, connection: web3.Connection, commitment?: web3.Commitment): Promise<number>;
|
|
92
|
+
/**
|
|
93
|
+
* Returns a readable version of {@link SettingsTransaction} properties
|
|
94
|
+
* and can be used to convert to JSON and/or logging
|
|
95
|
+
*/
|
|
96
|
+
pretty(): {
|
|
97
|
+
settings: string;
|
|
98
|
+
creator: string;
|
|
99
|
+
rentCollector: string;
|
|
100
|
+
index: number | {
|
|
101
|
+
toNumber: () => number;
|
|
102
|
+
};
|
|
103
|
+
bump: number;
|
|
104
|
+
actions: SettingsAction[];
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* @category Accounts
|
|
109
|
+
* @category generated
|
|
110
|
+
*/
|
|
111
|
+
export declare const settingsTransactionBeet: beet.FixableBeetStruct<SettingsTransaction, SettingsTransactionArgs & {
|
|
112
|
+
accountDiscriminator: number[];
|
|
113
|
+
}>;
|
|
@@ -0,0 +1,151 @@
|
|
|
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 { settingsActionBeet } from '../types/SettingsAction';
|
|
11
|
+
export const settingsTransactionDiscriminator = [
|
|
12
|
+
199, 151, 72, 87, 77, 124, 16, 0,
|
|
13
|
+
];
|
|
14
|
+
/**
|
|
15
|
+
* Holds the data for the {@link SettingsTransaction} Account and provides de/serialization
|
|
16
|
+
* functionality for that data
|
|
17
|
+
*
|
|
18
|
+
* @category Accounts
|
|
19
|
+
* @category generated
|
|
20
|
+
*/
|
|
21
|
+
export class SettingsTransaction {
|
|
22
|
+
settings;
|
|
23
|
+
creator;
|
|
24
|
+
rentCollector;
|
|
25
|
+
index;
|
|
26
|
+
bump;
|
|
27
|
+
actions;
|
|
28
|
+
constructor(settings, creator, rentCollector, index, bump, actions) {
|
|
29
|
+
this.settings = settings;
|
|
30
|
+
this.creator = creator;
|
|
31
|
+
this.rentCollector = rentCollector;
|
|
32
|
+
this.index = index;
|
|
33
|
+
this.bump = bump;
|
|
34
|
+
this.actions = actions;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Creates a {@link SettingsTransaction} instance from the provided args.
|
|
38
|
+
*/
|
|
39
|
+
static fromArgs(args) {
|
|
40
|
+
return new SettingsTransaction(args.settings, args.creator, args.rentCollector, args.index, args.bump, args.actions);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Deserializes the {@link SettingsTransaction} from the data of the provided {@link web3.AccountInfo}.
|
|
44
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
45
|
+
*/
|
|
46
|
+
static fromAccountInfo(accountInfo, offset = 0) {
|
|
47
|
+
return SettingsTransaction.deserialize(accountInfo.data, offset);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Retrieves the account info from the provided address and deserializes
|
|
51
|
+
* the {@link SettingsTransaction} from its data.
|
|
52
|
+
*
|
|
53
|
+
* @throws Error if no account info is found at the address or if deserialization fails
|
|
54
|
+
*/
|
|
55
|
+
static async fromAccountAddress(connection, address, commitmentOrConfig) {
|
|
56
|
+
const accountInfo = await connection.getAccountInfo(address, commitmentOrConfig);
|
|
57
|
+
if (accountInfo == null) {
|
|
58
|
+
throw new Error(`Unable to find SettingsTransaction account at ${address}`);
|
|
59
|
+
}
|
|
60
|
+
return SettingsTransaction.fromAccountInfo(accountInfo, 0)[0];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Provides a {@link web3.Connection.getProgramAccounts} config builder,
|
|
64
|
+
* to fetch accounts matching filters that can be specified via that builder.
|
|
65
|
+
*
|
|
66
|
+
* @param programId - the program that owns the accounts we are filtering
|
|
67
|
+
*/
|
|
68
|
+
static gpaBuilder(programId = new web3.PublicKey('SMRTzfY6DfH5ik3TKiyLFfXexV8uSG3d2UksSCYdunG')) {
|
|
69
|
+
return beetSolana.GpaBuilder.fromStruct(programId, settingsTransactionBeet);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Deserializes the {@link SettingsTransaction} from the provided data Buffer.
|
|
73
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
74
|
+
*/
|
|
75
|
+
static deserialize(buf, offset = 0) {
|
|
76
|
+
return settingsTransactionBeet.deserialize(buf, offset);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Serializes the {@link SettingsTransaction} into a Buffer.
|
|
80
|
+
* @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it.
|
|
81
|
+
*/
|
|
82
|
+
serialize() {
|
|
83
|
+
return settingsTransactionBeet.serialize({
|
|
84
|
+
accountDiscriminator: settingsTransactionDiscriminator,
|
|
85
|
+
...this,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Returns the byteSize of a {@link Buffer} holding the serialized data of
|
|
90
|
+
* {@link SettingsTransaction} for the provided args.
|
|
91
|
+
*
|
|
92
|
+
* @param args need to be provided since the byte size for this account
|
|
93
|
+
* depends on them
|
|
94
|
+
*/
|
|
95
|
+
static byteSize(args) {
|
|
96
|
+
const instance = SettingsTransaction.fromArgs(args);
|
|
97
|
+
return settingsTransactionBeet.toFixedFromValue({
|
|
98
|
+
accountDiscriminator: settingsTransactionDiscriminator,
|
|
99
|
+
...instance,
|
|
100
|
+
}).byteSize;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Fetches the minimum balance needed to exempt an account holding
|
|
104
|
+
* {@link SettingsTransaction} data from rent
|
|
105
|
+
*
|
|
106
|
+
* @param args need to be provided since the byte size for this account
|
|
107
|
+
* depends on them
|
|
108
|
+
* @param connection used to retrieve the rent exemption information
|
|
109
|
+
*/
|
|
110
|
+
static async getMinimumBalanceForRentExemption(args, connection, commitment) {
|
|
111
|
+
return connection.getMinimumBalanceForRentExemption(SettingsTransaction.byteSize(args), commitment);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Returns a readable version of {@link SettingsTransaction} properties
|
|
115
|
+
* and can be used to convert to JSON and/or logging
|
|
116
|
+
*/
|
|
117
|
+
pretty() {
|
|
118
|
+
return {
|
|
119
|
+
settings: this.settings.toBase58(),
|
|
120
|
+
creator: this.creator.toBase58(),
|
|
121
|
+
rentCollector: this.rentCollector.toBase58(),
|
|
122
|
+
index: (() => {
|
|
123
|
+
const x = this.index;
|
|
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
|
+
bump: this.bump,
|
|
135
|
+
actions: this.actions,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* @category Accounts
|
|
141
|
+
* @category generated
|
|
142
|
+
*/
|
|
143
|
+
export const settingsTransactionBeet = new beet.FixableBeetStruct([
|
|
144
|
+
['accountDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)],
|
|
145
|
+
['settings', beetSolana.publicKey],
|
|
146
|
+
['creator', beetSolana.publicKey],
|
|
147
|
+
['rentCollector', beetSolana.publicKey],
|
|
148
|
+
['index', beet.u64],
|
|
149
|
+
['bump', beet.u8],
|
|
150
|
+
['actions', beet.array(settingsActionBeet)],
|
|
151
|
+
], SettingsTransaction.fromArgs, 'SettingsTransaction');
|
|
@@ -0,0 +1,137 @@
|
|
|
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 { Period } from '../types/Period';
|
|
11
|
+
/**
|
|
12
|
+
* Arguments used to create {@link SpendingLimit}
|
|
13
|
+
* @category Accounts
|
|
14
|
+
* @category generated
|
|
15
|
+
*/
|
|
16
|
+
export type SpendingLimitArgs = {
|
|
17
|
+
settings: web3.PublicKey;
|
|
18
|
+
seed: web3.PublicKey;
|
|
19
|
+
accountIndex: number;
|
|
20
|
+
mint: web3.PublicKey;
|
|
21
|
+
amount: beet.bignum;
|
|
22
|
+
period: Period;
|
|
23
|
+
remainingAmount: beet.bignum;
|
|
24
|
+
lastReset: beet.bignum;
|
|
25
|
+
bump: number;
|
|
26
|
+
signers: web3.PublicKey[];
|
|
27
|
+
destinations: web3.PublicKey[];
|
|
28
|
+
expiration: beet.bignum;
|
|
29
|
+
};
|
|
30
|
+
export declare const spendingLimitDiscriminator: number[];
|
|
31
|
+
/**
|
|
32
|
+
* Holds the data for the {@link SpendingLimit} Account and provides de/serialization
|
|
33
|
+
* functionality for that data
|
|
34
|
+
*
|
|
35
|
+
* @category Accounts
|
|
36
|
+
* @category generated
|
|
37
|
+
*/
|
|
38
|
+
export declare class SpendingLimit implements SpendingLimitArgs {
|
|
39
|
+
readonly settings: web3.PublicKey;
|
|
40
|
+
readonly seed: web3.PublicKey;
|
|
41
|
+
readonly accountIndex: number;
|
|
42
|
+
readonly mint: web3.PublicKey;
|
|
43
|
+
readonly amount: beet.bignum;
|
|
44
|
+
readonly period: Period;
|
|
45
|
+
readonly remainingAmount: beet.bignum;
|
|
46
|
+
readonly lastReset: beet.bignum;
|
|
47
|
+
readonly bump: number;
|
|
48
|
+
readonly signers: web3.PublicKey[];
|
|
49
|
+
readonly destinations: web3.PublicKey[];
|
|
50
|
+
readonly expiration: beet.bignum;
|
|
51
|
+
private constructor();
|
|
52
|
+
/**
|
|
53
|
+
* Creates a {@link SpendingLimit} instance from the provided args.
|
|
54
|
+
*/
|
|
55
|
+
static fromArgs(args: SpendingLimitArgs): SpendingLimit;
|
|
56
|
+
/**
|
|
57
|
+
* Deserializes the {@link SpendingLimit} from the data of the provided {@link web3.AccountInfo}.
|
|
58
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
59
|
+
*/
|
|
60
|
+
static fromAccountInfo(accountInfo: web3.AccountInfo<Buffer>, offset?: number): [SpendingLimit, number];
|
|
61
|
+
/**
|
|
62
|
+
* Retrieves the account info from the provided address and deserializes
|
|
63
|
+
* the {@link SpendingLimit} from its data.
|
|
64
|
+
*
|
|
65
|
+
* @throws Error if no account info is found at the address or if deserialization fails
|
|
66
|
+
*/
|
|
67
|
+
static fromAccountAddress(connection: web3.Connection, address: web3.PublicKey, commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig): Promise<SpendingLimit>;
|
|
68
|
+
/**
|
|
69
|
+
* Provides a {@link web3.Connection.getProgramAccounts} config builder,
|
|
70
|
+
* to fetch accounts matching filters that can be specified via that builder.
|
|
71
|
+
*
|
|
72
|
+
* @param programId - the program that owns the accounts we are filtering
|
|
73
|
+
*/
|
|
74
|
+
static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<SpendingLimitArgs & {
|
|
75
|
+
accountDiscriminator: number[];
|
|
76
|
+
}>;
|
|
77
|
+
/**
|
|
78
|
+
* Deserializes the {@link SpendingLimit} from the provided data Buffer.
|
|
79
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
80
|
+
*/
|
|
81
|
+
static deserialize(buf: Buffer, offset?: number): [SpendingLimit, number];
|
|
82
|
+
/**
|
|
83
|
+
* Serializes the {@link SpendingLimit} into a Buffer.
|
|
84
|
+
* @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it.
|
|
85
|
+
*/
|
|
86
|
+
serialize(): [Buffer, number];
|
|
87
|
+
/**
|
|
88
|
+
* Returns the byteSize of a {@link Buffer} holding the serialized data of
|
|
89
|
+
* {@link SpendingLimit} for the provided args.
|
|
90
|
+
*
|
|
91
|
+
* @param args need to be provided since the byte size for this account
|
|
92
|
+
* depends on them
|
|
93
|
+
*/
|
|
94
|
+
static byteSize(args: SpendingLimitArgs): number;
|
|
95
|
+
/**
|
|
96
|
+
* Fetches the minimum balance needed to exempt an account holding
|
|
97
|
+
* {@link SpendingLimit} data from rent
|
|
98
|
+
*
|
|
99
|
+
* @param args need to be provided since the byte size for this account
|
|
100
|
+
* depends on them
|
|
101
|
+
* @param connection used to retrieve the rent exemption information
|
|
102
|
+
*/
|
|
103
|
+
static getMinimumBalanceForRentExemption(args: SpendingLimitArgs, connection: web3.Connection, commitment?: web3.Commitment): Promise<number>;
|
|
104
|
+
/**
|
|
105
|
+
* Returns a readable version of {@link SpendingLimit} properties
|
|
106
|
+
* and can be used to convert to JSON and/or logging
|
|
107
|
+
*/
|
|
108
|
+
pretty(): {
|
|
109
|
+
settings: string;
|
|
110
|
+
seed: string;
|
|
111
|
+
accountIndex: number;
|
|
112
|
+
mint: string;
|
|
113
|
+
amount: number | {
|
|
114
|
+
toNumber: () => number;
|
|
115
|
+
};
|
|
116
|
+
period: string;
|
|
117
|
+
remainingAmount: number | {
|
|
118
|
+
toNumber: () => number;
|
|
119
|
+
};
|
|
120
|
+
lastReset: number | {
|
|
121
|
+
toNumber: () => number;
|
|
122
|
+
};
|
|
123
|
+
bump: number;
|
|
124
|
+
signers: web3.PublicKey[];
|
|
125
|
+
destinations: web3.PublicKey[];
|
|
126
|
+
expiration: number | {
|
|
127
|
+
toNumber: () => number;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* @category Accounts
|
|
133
|
+
* @category generated
|
|
134
|
+
*/
|
|
135
|
+
export declare const spendingLimitBeet: beet.FixableBeetStruct<SpendingLimit, SpendingLimitArgs & {
|
|
136
|
+
accountDiscriminator: number[];
|
|
137
|
+
}>;
|