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