@azguardwallet/types 0.2.1 → 0.3.0

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/action.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { AuthwitContent } from "./authwit-content";
2
2
  /** Action kind */
3
- export type ActionKind = "add_capsule" | "add_private_authwit" | "add_public_authwit" | "call" | "call_ext";
3
+ export type ActionKind = "add_capsule" | "add_private_authwit" | "add_public_authwit" | "call" | "encoded_call";
4
4
  /** A request to perform some action */
5
- export type Action = AddCapsuleAction | AddPrivateAuthwitAction | AddPublicAuthwitAction | CallAction | CallExtAction;
5
+ export type Action = AddCapsuleAction | AddPrivateAuthwitAction | AddPublicAuthwitAction | CallAction | EncodedCallAction;
6
6
  /** A request to add a capsule to PXE */
7
7
  export type AddCapsuleAction = {
8
8
  /** Action kind */
@@ -20,6 +20,11 @@ export type AddPrivateAuthwitAction = {
20
20
  kind: "add_private_authwit";
21
21
  /** Original content from which a message hash will be comupted */
22
22
  content: AuthwitContent;
23
+ /**
24
+ * Authwitness to add (Fr[]).
25
+ * If not specified, the wallet will create it.
26
+ */
27
+ authwit?: string[];
23
28
  };
24
29
  /** A request to call the AuthRegistry contract to authorize message hash computed from the given content */
25
30
  export type AddPublicAuthwitAction = {
@@ -40,9 +45,9 @@ export type CallAction = {
40
45
  args: any[];
41
46
  };
42
47
  /** A request to call a contract with encoded args (matches FunctionCall from aztec.js) */
43
- export type CallExtAction = {
48
+ export type EncodedCallAction = {
44
49
  /** Action kind */
45
- kind: "call_ext";
50
+ kind: "encoded_call";
46
51
  /** Name of the function */
47
52
  name: string;
48
53
  /** Address of the contract (AztecAddress) */
@@ -1,5 +1,5 @@
1
1
  /** Content to add authwitness for. */
2
- export type AuthwitContent = CallAuthwitContent | IntentAuthwitContent | MessageHashAuthwitContent;
2
+ export type AuthwitContent = CallAuthwitContent | EncodedCallAuthwitContent | IntentAuthwitContent | MessageHashAuthwitContent;
3
3
  /** Contract call to be authorized */
4
4
  export type CallAuthwitContent = {
5
5
  /** Authwit content kind */
@@ -13,6 +13,27 @@ export type CallAuthwitContent = {
13
13
  /** Arguments (unencoded) */
14
14
  args: any[];
15
15
  };
16
+ /** Encoded contract call to be authorized */
17
+ export type EncodedCallAuthwitContent = {
18
+ /** Authwit content kind */
19
+ kind: "encoded_call";
20
+ /** Address of the caller (AztecAddress) */
21
+ caller: string;
22
+ /** Name of the function */
23
+ name: string;
24
+ /** Address of the contract (AztecAddress) */
25
+ to: string;
26
+ /** Selector of the function (FunctionSelector) */
27
+ selector: string;
28
+ /** Type of the function (FunctionType) */
29
+ type: string;
30
+ /** Whether this call can makes modifications to state or not */
31
+ isStatic: boolean;
32
+ /** Encoded arguments (Fr[]) */
33
+ args: string[];
34
+ /** Return types for decoding (AbiType[]) */
35
+ returnTypes: unknown[];
36
+ };
16
37
  /** Arbitrary intent to be authorized */
17
38
  export type IntentAuthwitContent = {
18
39
  /** Authwit content kind */
@@ -2,22 +2,31 @@ import { Action } from "./action";
2
2
  import { Result } from "./result";
3
3
  import { CaipAccount, CaipChain } from "./dapp-session";
4
4
  /** Operation kind */
5
- export type OperationKind = "add_note" | "register_contract" | "register_sender" | "send_transaction" | "simulate_transaction" | "simulate_unconstrained";
5
+ export type OperationKind = "add_note" | "get_complete_address" | "register_contract" | "register_sender" | "send_transaction" | "simulate_transaction" | "simulate_unconstrained";
6
6
  /** A request to perform some operation */
7
- export type Operation = AddNoteOperation | RegisterContractOperation | RegisterSenderOperation | SendTransactionOperation | SimulateTransactionOperation | SimulateUnconstrainedOperation;
7
+ export type Operation = AddNoteOperation | GetCompleteAddressOperation | RegisterContractOperation | RegisterSenderOperation | SendTransactionOperation | SimulateTransactionOperation | SimulateUnconstrainedOperation;
8
8
  /** Operation result */
9
- export type OperationResult = AddNoteResult | RegisterContractResult | RegisterSenderResult | SendTransactionResult | SimulateTransactionResult | SimulateUnconstrainedResult;
9
+ export type OperationResult = AddNoteResult | GetCompleteAddressResult | RegisterContractResult | RegisterSenderResult | SendTransactionResult | SimulateTransactionResult | SimulateUnconstrainedResult;
10
10
  /** A request to add a note to PXE */
11
11
  export type AddNoteOperation = {
12
12
  /** Operation kind */
13
13
  kind: "add_note";
14
14
  /** Account to add the note for */
15
15
  account: CaipAccount;
16
- /** Extended note, converted to string */
17
- note: string;
16
+ /** Note to add (ExtendedNote) */
17
+ note: unknown;
18
18
  };
19
19
  /** A result of the "add_note" operation */
20
20
  export type AddNoteResult = Result<void>;
21
+ /** A request to get complete address of the specified account */
22
+ export type GetCompleteAddressOperation = {
23
+ /** Operation kind */
24
+ kind: "get_complete_address";
25
+ /** Account to get complete address of */
26
+ account: CaipAccount;
27
+ };
28
+ /** A result of the "get_complete_address" operation (CompleteAddress) */
29
+ export type GetCompleteAddressResult = Result<unknown>;
21
30
  /** A request to register contract in PXE */
22
31
  export type RegisterContractOperation = {
23
32
  /** Operation kind */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azguardwallet/types",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Typings for Azguard Wallet inpage RPC client",
5
5
  "author": "Azguard Wallet",
6
6
  "homepage": "https://github.com/AzguardWallet/azguard-wallet-types",