@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,61 @@
|
|
|
1
|
+
import { bignum } from "@metaplex-foundation/beet";
|
|
2
|
+
import { AccountMeta, AddressLookupTableAccount, Connection, MessageV0, PublicKey, TransactionInstruction, TransactionMessage, VersionedTransaction } from "@solana/web3.js";
|
|
3
|
+
import { SmartAccountTransactionMessage } from "./generated";
|
|
4
|
+
export declare function toUtfBytes(str: string): Uint8Array;
|
|
5
|
+
export declare function toU8Bytes(num: number): Uint8Array;
|
|
6
|
+
export declare function toU32Bytes(num: number): Uint8Array;
|
|
7
|
+
export declare function toU64Bytes(num: bigint): Uint8Array;
|
|
8
|
+
export declare function toU128Bytes(num: bigint): Uint8Array;
|
|
9
|
+
export declare function toBigInt(number: bignum): bigint;
|
|
10
|
+
export declare function getAvailableMemoSize(txWithoutMemo: VersionedTransaction): number;
|
|
11
|
+
export declare function isStaticWritableIndex(message: SmartAccountTransactionMessage, index: number): boolean;
|
|
12
|
+
export declare function isSignerIndex(message: SmartAccountTransactionMessage, index: number): boolean;
|
|
13
|
+
/** We use custom serialization for `transaction_message` that ensures as small byte size as possible. */
|
|
14
|
+
export declare function transactionMessageToMultisigTransactionMessageBytes({ message, addressLookupTableAccounts, smartAccountPda, }: {
|
|
15
|
+
message: TransactionMessage;
|
|
16
|
+
addressLookupTableAccounts?: AddressLookupTableAccount[];
|
|
17
|
+
smartAccountPda: PublicKey;
|
|
18
|
+
}): {
|
|
19
|
+
transactionMessageBytes: Uint8Array;
|
|
20
|
+
compiledMessage: MessageV0;
|
|
21
|
+
};
|
|
22
|
+
export declare function instructionsToSynchronousTransactionDetails({ vaultPda, members, transaction_instructions, }: {
|
|
23
|
+
vaultPda: PublicKey;
|
|
24
|
+
members: PublicKey[];
|
|
25
|
+
transaction_instructions: TransactionInstruction[];
|
|
26
|
+
}): {
|
|
27
|
+
instructions: Uint8Array;
|
|
28
|
+
accounts: AccountMeta[];
|
|
29
|
+
};
|
|
30
|
+
export declare function instructionsToSynchronousTransactionDetailsV2({ vaultPda, members, transaction_instructions, }: {
|
|
31
|
+
vaultPda: PublicKey;
|
|
32
|
+
members: PublicKey[];
|
|
33
|
+
transaction_instructions: TransactionInstruction[];
|
|
34
|
+
}): {
|
|
35
|
+
instructions: Uint8Array;
|
|
36
|
+
accounts: AccountMeta[];
|
|
37
|
+
};
|
|
38
|
+
export declare function instructionsToSynchronousTransactionDetailsV2WithHooks({ vaultPda, members, preHookAccounts, postHookAccounts, transaction_instructions, }: {
|
|
39
|
+
vaultPda: PublicKey;
|
|
40
|
+
members: PublicKey[];
|
|
41
|
+
preHookAccounts: AccountMeta[];
|
|
42
|
+
postHookAccounts: AccountMeta[];
|
|
43
|
+
transaction_instructions: TransactionInstruction[];
|
|
44
|
+
}): {
|
|
45
|
+
instructions: Uint8Array;
|
|
46
|
+
accounts: AccountMeta[];
|
|
47
|
+
};
|
|
48
|
+
/** Populate remaining accounts required for execution of the transaction. */
|
|
49
|
+
export declare function accountsForTransactionExecute({ connection, transactionPda, smartAccountPda, message, ephemeralSignerBumps, programId, }: {
|
|
50
|
+
connection: Connection;
|
|
51
|
+
message: SmartAccountTransactionMessage;
|
|
52
|
+
ephemeralSignerBumps: number[];
|
|
53
|
+
smartAccountPda: PublicKey;
|
|
54
|
+
transactionPda: PublicKey;
|
|
55
|
+
programId?: PublicKey;
|
|
56
|
+
}): Promise<{
|
|
57
|
+
/** Account metas used in the `message`. */
|
|
58
|
+
accountMetas: AccountMeta[];
|
|
59
|
+
/** Address lookup table accounts used in the `message`. */
|
|
60
|
+
lookupTableAccounts: AddressLookupTableAccount[];
|
|
61
|
+
}>;
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { u32, u64, u8, u128 } from "@metaplex-foundation/beet";
|
|
2
|
+
import { Buffer } from "buffer";
|
|
3
|
+
import invariant from "invariant";
|
|
4
|
+
import { MissingLookupTableAccountError } from "./errors";
|
|
5
|
+
import { getEphemeralSignerPda } from "./pda";
|
|
6
|
+
import { transactionMessageBeet } from "./types";
|
|
7
|
+
import { compileToSynchronousMessageAndAccounts } from "./utils/compileToSynchronousMessage";
|
|
8
|
+
import { compileToWrappedMessageV0 } from "./utils/compileToWrappedMessageV0";
|
|
9
|
+
import { compileToSynchronousMessageAndAccountsV2, compileToSynchronousMessageAndAccountsV2WithHooks, } from "./utils/compileToSynchronousMessageV2";
|
|
10
|
+
export function toUtfBytes(str) {
|
|
11
|
+
return new TextEncoder().encode(str);
|
|
12
|
+
}
|
|
13
|
+
export function toU8Bytes(num) {
|
|
14
|
+
const bytes = Buffer.alloc(1);
|
|
15
|
+
u8.write(bytes, 0, num);
|
|
16
|
+
return bytes;
|
|
17
|
+
}
|
|
18
|
+
export function toU32Bytes(num) {
|
|
19
|
+
const bytes = Buffer.alloc(4);
|
|
20
|
+
u32.write(bytes, 0, num);
|
|
21
|
+
return bytes;
|
|
22
|
+
}
|
|
23
|
+
export function toU64Bytes(num) {
|
|
24
|
+
const bytes = Buffer.alloc(8);
|
|
25
|
+
u64.write(bytes, 0, num);
|
|
26
|
+
return bytes;
|
|
27
|
+
}
|
|
28
|
+
export function toU128Bytes(num) {
|
|
29
|
+
const bytes = Buffer.alloc(16);
|
|
30
|
+
u128.write(bytes, 0, num);
|
|
31
|
+
return bytes;
|
|
32
|
+
}
|
|
33
|
+
export function toBigInt(number) {
|
|
34
|
+
return BigInt(number.toString());
|
|
35
|
+
}
|
|
36
|
+
const MAX_TX_SIZE_BYTES = 1232;
|
|
37
|
+
const STRING_LEN_SIZE = 4;
|
|
38
|
+
export function getAvailableMemoSize(txWithoutMemo) {
|
|
39
|
+
const txSize = txWithoutMemo.serialize().length;
|
|
40
|
+
return (MAX_TX_SIZE_BYTES -
|
|
41
|
+
txSize -
|
|
42
|
+
STRING_LEN_SIZE -
|
|
43
|
+
// Sometimes long memo can trigger switching from 1 to 2 bytes length encoding in Compact-u16,
|
|
44
|
+
// so we reserve 1 extra byte to make sure.
|
|
45
|
+
1);
|
|
46
|
+
}
|
|
47
|
+
export function isStaticWritableIndex(message, index) {
|
|
48
|
+
const numAccountKeys = message.accountKeys.length;
|
|
49
|
+
const { numSigners, numWritableSigners, numWritableNonSigners } = message;
|
|
50
|
+
if (index >= numAccountKeys) {
|
|
51
|
+
// `index` is not a part of static `accountKeys`.
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
if (index < numWritableSigners) {
|
|
55
|
+
// `index` is within the range of writable signer keys.
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
if (index >= numSigners) {
|
|
59
|
+
// `index` is within the range of non-signer keys.
|
|
60
|
+
const indexIntoNonSigners = index - numSigners;
|
|
61
|
+
// Whether `index` is within the range of writable non-signer keys.
|
|
62
|
+
return indexIntoNonSigners < numWritableNonSigners;
|
|
63
|
+
}
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
export function isSignerIndex(message, index) {
|
|
67
|
+
return index < message.numSigners;
|
|
68
|
+
}
|
|
69
|
+
/** We use custom serialization for `transaction_message` that ensures as small byte size as possible. */
|
|
70
|
+
export function transactionMessageToMultisigTransactionMessageBytes({ message, addressLookupTableAccounts, smartAccountPda, }) {
|
|
71
|
+
// // Make sure authority is marked as non-signer in all instructions,
|
|
72
|
+
// // otherwise the message will be serialized in incorrect format.
|
|
73
|
+
// message.instructions.forEach((instruction) => {
|
|
74
|
+
// instruction.keys.forEach((key) => {
|
|
75
|
+
// if (key.pubkey.equals(vaultPda)) {
|
|
76
|
+
// key.isSigner = false;
|
|
77
|
+
// }
|
|
78
|
+
// });
|
|
79
|
+
// });
|
|
80
|
+
// Use custom implementation of `message.compileToV0Message` that allows instruction programIds
|
|
81
|
+
// to also be loaded from `addressLookupTableAccounts`.
|
|
82
|
+
const compiledMessage = compileToWrappedMessageV0({
|
|
83
|
+
payerKey: message.payerKey,
|
|
84
|
+
recentBlockhash: message.recentBlockhash,
|
|
85
|
+
instructions: message.instructions,
|
|
86
|
+
addressLookupTableAccounts,
|
|
87
|
+
});
|
|
88
|
+
// const compiledMessage = message.compileToV0Message(
|
|
89
|
+
// addressLookupTableAccounts
|
|
90
|
+
// );
|
|
91
|
+
// We use custom serialization for `transaction_message` that ensures as small byte size as possible.
|
|
92
|
+
const [transactionMessageBytes] = transactionMessageBeet.serialize({
|
|
93
|
+
numSigners: compiledMessage.header.numRequiredSignatures,
|
|
94
|
+
numWritableSigners: compiledMessage.header.numRequiredSignatures -
|
|
95
|
+
compiledMessage.header.numReadonlySignedAccounts,
|
|
96
|
+
numWritableNonSigners: compiledMessage.staticAccountKeys.length -
|
|
97
|
+
compiledMessage.header.numRequiredSignatures -
|
|
98
|
+
compiledMessage.header.numReadonlyUnsignedAccounts,
|
|
99
|
+
accountKeys: compiledMessage.staticAccountKeys,
|
|
100
|
+
instructions: compiledMessage.compiledInstructions.map((ix) => {
|
|
101
|
+
return {
|
|
102
|
+
programIdIndex: ix.programIdIndex,
|
|
103
|
+
accountIndexes: ix.accountKeyIndexes,
|
|
104
|
+
data: Array.from(ix.data),
|
|
105
|
+
};
|
|
106
|
+
}),
|
|
107
|
+
addressTableLookups: compiledMessage.addressTableLookups,
|
|
108
|
+
});
|
|
109
|
+
return {
|
|
110
|
+
transactionMessageBytes,
|
|
111
|
+
compiledMessage,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
export function instructionsToSynchronousTransactionDetails({ vaultPda, members, transaction_instructions, }) {
|
|
115
|
+
const { instructions, accounts } = compileToSynchronousMessageAndAccounts({
|
|
116
|
+
vaultPda,
|
|
117
|
+
members,
|
|
118
|
+
instructions: transaction_instructions,
|
|
119
|
+
});
|
|
120
|
+
return {
|
|
121
|
+
instructions,
|
|
122
|
+
accounts,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
export function instructionsToSynchronousTransactionDetailsV2({ vaultPda, members, transaction_instructions, }) {
|
|
126
|
+
const { instructions, accounts } = compileToSynchronousMessageAndAccountsV2({
|
|
127
|
+
vaultPda,
|
|
128
|
+
members,
|
|
129
|
+
instructions: transaction_instructions,
|
|
130
|
+
});
|
|
131
|
+
return {
|
|
132
|
+
instructions,
|
|
133
|
+
accounts,
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
export function instructionsToSynchronousTransactionDetailsV2WithHooks({ vaultPda, members, preHookAccounts, postHookAccounts, transaction_instructions, }) {
|
|
137
|
+
const { instructions, accounts } = compileToSynchronousMessageAndAccountsV2WithHooks({
|
|
138
|
+
vaultPda,
|
|
139
|
+
members,
|
|
140
|
+
preHookAccounts,
|
|
141
|
+
postHookAccounts,
|
|
142
|
+
instructions: transaction_instructions,
|
|
143
|
+
});
|
|
144
|
+
return {
|
|
145
|
+
instructions,
|
|
146
|
+
accounts,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
/** Populate remaining accounts required for execution of the transaction. */
|
|
150
|
+
export async function accountsForTransactionExecute({ connection, transactionPda, smartAccountPda, message, ephemeralSignerBumps, programId, }) {
|
|
151
|
+
const ephemeralSignerPdas = ephemeralSignerBumps.map((_, additionalSignerIndex) => {
|
|
152
|
+
return getEphemeralSignerPda({
|
|
153
|
+
transactionPda,
|
|
154
|
+
ephemeralSignerIndex: additionalSignerIndex,
|
|
155
|
+
programId,
|
|
156
|
+
})[0];
|
|
157
|
+
});
|
|
158
|
+
const addressLookupTableKeySet = new Map();
|
|
159
|
+
for (const { accountKey } of message.addressTableLookups) {
|
|
160
|
+
addressLookupTableKeySet.set(accountKey.toBase58(), accountKey);
|
|
161
|
+
}
|
|
162
|
+
const addressLookupTableKeys = [...addressLookupTableKeySet.values()];
|
|
163
|
+
const addressLookupTableAccounts = new Map(await Promise.all(addressLookupTableKeys.map(async (key) => {
|
|
164
|
+
const { value } = await connection.getAddressLookupTable(key);
|
|
165
|
+
if (!value) {
|
|
166
|
+
throw new MissingLookupTableAccountError(key.toBase58());
|
|
167
|
+
}
|
|
168
|
+
return [key.toBase58(), value];
|
|
169
|
+
})));
|
|
170
|
+
// Populate account metas required for execution of the transaction.
|
|
171
|
+
const accountMetas = [];
|
|
172
|
+
// First add the lookup table accounts used by the transaction. They are needed for on-chain validation.
|
|
173
|
+
accountMetas.push(...addressLookupTableKeys.map((key) => {
|
|
174
|
+
return { pubkey: key, isSigner: false, isWritable: false };
|
|
175
|
+
}));
|
|
176
|
+
// Then add static account keys included into the message.
|
|
177
|
+
for (const [accountIndex, accountKey] of message.accountKeys.entries()) {
|
|
178
|
+
accountMetas.push({
|
|
179
|
+
pubkey: accountKey,
|
|
180
|
+
isWritable: isStaticWritableIndex(message, accountIndex),
|
|
181
|
+
// NOTE: vaultPda and ephemeralSignerPdas cannot be marked as signers,
|
|
182
|
+
// because they are PDAs and hence won't have their signatures on the transaction.
|
|
183
|
+
isSigner: isSignerIndex(message, accountIndex) &&
|
|
184
|
+
!accountKey.equals(smartAccountPda) &&
|
|
185
|
+
!ephemeralSignerPdas.find((k) => accountKey.equals(k)),
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
// Then add accounts that will be loaded with address lookup tables.
|
|
189
|
+
for (const lookup of message.addressTableLookups) {
|
|
190
|
+
const lookupTableAccount = addressLookupTableAccounts.get(lookup.accountKey.toBase58());
|
|
191
|
+
invariant(lookupTableAccount, new MissingLookupTableAccountError(lookup.accountKey.toBase58()).message);
|
|
192
|
+
for (const accountIndex of lookup.writableIndexes) {
|
|
193
|
+
const pubkey = lookupTableAccount.state.addresses[accountIndex];
|
|
194
|
+
invariant(pubkey, new MissingLookupTableAccountError(lookup.accountKey.toBase58(), `does not contain address at index ${accountIndex}.`).message);
|
|
195
|
+
accountMetas.push({
|
|
196
|
+
pubkey,
|
|
197
|
+
isWritable: true,
|
|
198
|
+
// Accounts in address lookup tables can not be signers.
|
|
199
|
+
isSigner: false,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
for (const accountIndex of lookup.readonlyIndexes) {
|
|
203
|
+
const pubkey = lookupTableAccount.state.addresses[accountIndex];
|
|
204
|
+
invariant(pubkey, new MissingLookupTableAccountError(lookup.accountKey.toBase58(), `does not contain address at index ${accountIndex}.`).message);
|
|
205
|
+
accountMetas.push({
|
|
206
|
+
pubkey,
|
|
207
|
+
isWritable: false,
|
|
208
|
+
// Accounts in address lookup tables can not be signers.
|
|
209
|
+
isSigner: false,
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return {
|
|
214
|
+
accountMetas,
|
|
215
|
+
lookupTableAccounts: [...addressLookupTableAccounts.values()],
|
|
216
|
+
};
|
|
217
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@loyal-labs/loyal-smart-accounts-core",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Core artifacts and low-level builders for the Loyal smart accounts SDK",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"./loyal": {
|
|
15
|
+
"import": "./dist/loyal.js",
|
|
16
|
+
"types": "./dist/loyal.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./internal": {
|
|
19
|
+
"import": "./dist/internal.js",
|
|
20
|
+
"types": "./dist/internal.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./package.json": "./package.json"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"upstream"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"typecheck": "tsc --noEmit",
|
|
30
|
+
"build": "bun run clean && tsc -p tsconfig.build.json",
|
|
31
|
+
"prepublishOnly": "bun run build",
|
|
32
|
+
"clean": "rm -rf dist",
|
|
33
|
+
"test": "bun test"
|
|
34
|
+
},
|
|
35
|
+
"author": "Loyal",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/loyal-labs/loyal-app.git",
|
|
40
|
+
"directory": "sdk/loyal-smart-accounts-core"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@solana/web3.js": "^1.98.0"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@loyal-labs/solana-rpc": "^0.1.1",
|
|
47
|
+
"@metaplex-foundation/beet": "0.7.1",
|
|
48
|
+
"@metaplex-foundation/beet-solana": "0.4.0",
|
|
49
|
+
"@metaplex-foundation/cusper": "^0.0.2",
|
|
50
|
+
"@solana/spl-token": "^0.4.13",
|
|
51
|
+
"assert": "^2.1.0",
|
|
52
|
+
"bn.js": "^5.2.2",
|
|
53
|
+
"buffer": "^6.0.3",
|
|
54
|
+
"invariant": "^2.2.4"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@types/bn.js": "^5.1.6",
|
|
58
|
+
"@types/bun": "latest",
|
|
59
|
+
"@types/invariant": "^2.2.37",
|
|
60
|
+
"@types/node": "^24.0.15",
|
|
61
|
+
"typescript": "^5.7.3"
|
|
62
|
+
},
|
|
63
|
+
"peerDependenciesMeta": {
|
|
64
|
+
"@solana/web3.js": {
|
|
65
|
+
"optional": false
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"publishConfig": {
|
|
69
|
+
"access": "public"
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"repoUrl": "https://github.com/Squads-Protocol/smart-account-program",
|
|
3
|
+
"commitSha": "80bf1f7ad28fd1176c364879776982730b8e9c80",
|
|
4
|
+
"fetchedAt": "2026-03-20",
|
|
5
|
+
"sourceIdlPath": "sdk/smart-account/idl/squads_smart_account_program.json",
|
|
6
|
+
"sourceProgramLibPath": "programs/squads_smart_account_program/src/lib.rs",
|
|
7
|
+
"sourceSolitaConfigPath": "sdk/smart-account/.solitarc.js",
|
|
8
|
+
"normalizedIdlPath": "upstream/normalized/squads_smart_account_program.json",
|
|
9
|
+
"generatedFromNormalizedIdl": true,
|
|
10
|
+
"generator": "@metaplex-foundation/solita@0.20.0",
|
|
11
|
+
"programId": "SMRTzfY6DfH5ik3TKiyLFfXexV8uSG3d2UksSCYdunG",
|
|
12
|
+
"upstreamPackageName": "@sqds/smart-account",
|
|
13
|
+
"upstreamPackageVersion": "2.1.2"
|
|
14
|
+
}
|