Skip to content

ChainsigMessage Policy

ChainSigMessage Policy allows vault operators to sign messages for Vault Managed Accounts. This capability is primarily valuable for signing messages on NEAR Intent to execute swaps, though it may serve additional purposes in the future.

For now, the only supported sign_method is NearIntentsSwap. More methods may be added later.

#[near(serializers=[json, borsh])]
pub struct ChainSigMessageConfig {
    pub derivation_path: String,
    pub sign_method: ChainSigSignMethod,
}

Below is an example of a ChainSigMessage Policy:

{
  id: "sign_near_intents_message",
  description:
    "Policy for signing NEAR Intents swap messages using chain signatures",
  required_role: "strategist",
  required_vote_count: 1,
  policy_type: "ChainSigMessage",
  policy_details: {
    ChainSigMessage: {
      derivation_path: constant.CHAIN_SIG_ACCOUNT_1,
      sign_method: "NearIntentsSwap",
    },
  },
  activation_time: "0",
  proposal_expiry_time_nanosec: "86400000000000",
  required_pending_actions: [],
}