# Create Config Transaction

Config Transactions are a little more complicated than the other ones, as there are multiple configuration arguments that you can supply to such a transaction.

Here are list of action types you can execute with Config Transactions, and their arguments:

* **AddMember**&#x20;
  * *new\_member* (**Member**): Key & corresponding permissions for the member you want to add.
* **RemoveMember**&#x20;
  * *old\_member* (**PublicKey**): Key of the member that you want to remove
* **ChangeThreshold**&#x20;
  * *new\_threshold* (**number**): New approval threshold that you want to enforce
* **SetTimeLock**&#x20;
  * *new\_time\_lock* (**number**): Change the `time_lock` of the multisig.&#x20;
* **AddSpendingLimit**
  * *create\_key* (**PublicKey**): Key that is used to seed the SpendingLimit PDA.&#x20;
  * *vault\_index* (**number**): The index of the vault that the spending limit is for.
  * *mint* (**PublicKey**): The token mint the spending limit is for.
  * *amount* (**number**): The amount of tokens that can be spent in a period. This is respective of the mint's decimals. (i.e USDC has 6 decimals, so 1 USDC would be 1\_000\_000)
  * *members* (**PublicKey\[]**): Members of the multisig that can use the spending limit. In case a member is removed from the multisig, the spending limit will remain existent, but unusable until deleted.
  * *destinations* (**PublicKey\[]**): The destination addresses the spending limit is allowed to sent funds to. If empty, funds can be sent to any address.
* **RemoveSpendingLimit**
  * *spending\_limit* (**Pubkey**): Account for the spending limit you want to remove.
* **SetRentCollector**&#x20;
  * *new\_rent\_collector* (**PublicKey | null**): Set the `rent_collector` config parameter of the multisig.

## Example (Change Threshold)

<pre class="language-typescript"><code class="lang-typescript"><strong>import * as multisig from "@sqds/multisig";
</strong><strong>import { Connection, PublicKey } from "@solana/web3.js";
</strong>
async function main(member: PublicKey) {
    // Cluster Connection
    // Required argument if you use the .rpc method
    const connection = new Connection("&#x3C;your rpc url>");
    
    // If you've saved your createKey, you can define it as a static PublicKey
    const createKey = new PublicKey("&#x3C;your createkey>")
    
    // Derive the multisig PDA
    const [multisigPda] = multisig.getMultisigPda({
        createKey,
    });
    // or
    // const multisigPda = new PublicKey("&#x3C;your multisig key>");
    
    // Derive the PDA of the Squads Vault
    const [vaultPda] = multisig.getVaultPda({
        multisigPda,
        index: 0,
    });
    
    // Get deserialized multisig account info
    const multisigInfo = await multisig.accounts.Multisig.fromAccountAddress(
      connection,
      multisigPda
    );

    // Get the updated transaction index
    const currentTransactionIndex = Number(multisigInfo.transactionIndex);
    const newTransactionIndex = BigInt(currentTransactionIndex + 1);
    
    // Create a config transaction, of type changeThreshold
    const ix = await multisig.instructions.configTransactionCreate({
        feePayer: member,
        multisigPda: controlledMultisigPda,
        // Replace with current index if needed
        transactionIndex: newTransactionIndex,
        // Member must have at least "Proposer" permissions
        creator: member,
        actions: [{
            // Type of action
            __kind: "ChangeThreshold",
            newThreshold: 3
        }],
    }),
}
</code></pre>

### Notes

* This is instruction is used for changing config in most multisigs (ones with no configAuthority)
* Exectuing certain config transactions will invalidate other Active transactions (both config and vault type). This behavior is present with AddMember, RemoveMember, ChangeThreshold, and SetTimeLock
* Multiple actions can be specified between instructions
* For more information, see the [Config Transaction](https://docs.squads.so/main/development/accounts/transactions#config-transactions) section and [reference](https://docs.squads.so/main/development/reference/accounts#config-transaction).
