@cubist-labs/cubesigner-sdk 0.4.229 → 0.4.236

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/src/org.ts CHANGED
@@ -292,6 +292,12 @@ export class Org {
292
292
  return (data.policy ?? []) as unknown as OrgPolicy[];
293
293
  }
294
294
 
295
+ /** @returns the sign policy for the org. */
296
+ async signPolicy(): Promise<RolePolicy> {
297
+ const data = await this.fetch();
298
+ return (data.sign_policy ?? []) as unknown as RolePolicy;
299
+ }
300
+
295
301
  /**
296
302
  * Set the policy for the org.
297
303
  *
@@ -302,6 +308,18 @@ export class Org {
302
308
  await this.update({ policy: p });
303
309
  }
304
310
 
311
+ /**
312
+ * Set the sign policy for the org.
313
+ *
314
+ * This is a global sign policy that applies to every sign operation (every key, every role) in the org.
315
+ * It is analogous to how role policies apply to all sign requests performed by the corresponding role sessions.
316
+ *
317
+ * @param policy The new policy for the org.
318
+ */
319
+ async setSignPolicy(policy: RolePolicy) {
320
+ await this.update({ sign_policy: policy });
321
+ }
322
+
305
323
  /**
306
324
  * Retrieve the organization's extended properties (uncommon features not used by most users).
307
325
  *
package/src/role.ts CHANGED
@@ -29,6 +29,9 @@ import type { RoleAttestationClaims, RoleAttestationQuery } from "./schema_types
29
29
 
30
30
  type NameOrAddressOrNull = string | null;
31
31
 
32
+ /** Only allow the following operations */
33
+ export type OperationAllowlist = { OperationAllowlist: OperationKind[] };
34
+
32
35
  /**
33
36
  * Restrict the receiver for EVM transactions.
34
37
  *
@@ -310,6 +313,13 @@ export type BtcSegwitValueLimitWindow = {
310
313
  */
311
314
  export type SourceIpAllowlist = { SourceIpAllowlist: string[] };
312
315
 
316
+ /**
317
+ * Disallow signing until the specified Unix timestamp (in seconds since epoch).
318
+ *
319
+ * @example { TimeLock: 1750000000 }
320
+ */
321
+ export type TimeLock = { TimeLock: number };
322
+
313
323
  export type HttpRequestComparer = "Eq" | { EvmTx: EvmTxCmp } | { SolanaTx: SolanaTxCmp };
314
324
 
315
325
  /**
@@ -476,6 +486,7 @@ export type NamedPolicyReference = {
476
486
 
477
487
  /** Key policies that restrict the requests that the signing endpoints accept */
478
488
  export type KeyDenyPolicy =
489
+ | OperationAllowlist
479
490
  | TxReceiver
480
491
  | TxDeposit
481
492
  | TxValueLimit
@@ -487,6 +498,7 @@ export type KeyDenyPolicy =
487
498
  | SuiTxReceivers
488
499
  | BtcTxReceivers
489
500
  | SourceIpAllowlist
501
+ | TimeLock
490
502
  | SolanaInstructionPolicy
491
503
  | BtcSegwitValueLimit
492
504
  | RequireMfa