|
| 1 | +[**@algorandfoundation/algorand-typescript-testing**](../../README.md) |
| 2 | + |
| 3 | +*** |
| 4 | + |
| 5 | +[@algorandfoundation/algorand-typescript-testing](../../README.md) / [index](../README.md) / ApplicationSpy |
| 6 | + |
| 7 | +# Class: ApplicationSpy\<TContract\> |
| 8 | + |
| 9 | +Defined in: [src/application-spy.ts:32](https://github.com/algorandfoundation/algorand-typescript-testing/blob/main/src/application-spy.ts#L32) |
| 10 | + |
| 11 | +## Type Parameters |
| 12 | + |
| 13 | +### TContract |
| 14 | + |
| 15 | +`TContract` *extends* `Contract` = `Contract` |
| 16 | + |
| 17 | +## Constructors |
| 18 | + |
| 19 | +### Constructor |
| 20 | + |
| 21 | +> **new ApplicationSpy**\<`TContract`\>(`contract`?): `ApplicationSpy`\<`TContract`\> |
| 22 | +
|
| 23 | +Defined in: [src/application-spy.ts:44](https://github.com/algorandfoundation/algorand-typescript-testing/blob/main/src/application-spy.ts#L44) |
| 24 | + |
| 25 | +#### Parameters |
| 26 | + |
| 27 | +##### contract? |
| 28 | + |
| 29 | +`TContract` | `ConstructorFor`\<`TContract`\> |
| 30 | + |
| 31 | +#### Returns |
| 32 | + |
| 33 | +`ApplicationSpy`\<`TContract`\> |
| 34 | + |
| 35 | +## Properties |
| 36 | + |
| 37 | +### contract? |
| 38 | + |
| 39 | +> `optional` **contract**: `TContract` \| `ConstructorFor`\<`TContract`\> |
| 40 | +
|
| 41 | +Defined in: [src/application-spy.ts:42](https://github.com/algorandfoundation/algorand-typescript-testing/blob/main/src/application-spy.ts#L42) |
| 42 | + |
| 43 | +*** |
| 44 | + |
| 45 | +### on |
| 46 | + |
| 47 | +> `readonly` **on**: `_TypedApplicationSpyCallBacks`\<`TContract`\> |
| 48 | +
|
| 49 | +Defined in: [src/application-spy.ts:39](https://github.com/algorandfoundation/algorand-typescript-testing/blob/main/src/application-spy.ts#L39) |
| 50 | + |
| 51 | +The `on` property is a proxy that allows you to register callbacks for specific method signatures. |
| 52 | +It dynamically creates methods based on the contract's methods. |
| 53 | + |
| 54 | +## Methods |
| 55 | + |
| 56 | +### notify() |
| 57 | + |
| 58 | +> **notify**(`itxn`): `void` |
| 59 | +
|
| 60 | +Defined in: [src/application-spy.ts:50](https://github.com/algorandfoundation/algorand-typescript-testing/blob/main/src/application-spy.ts#L50) |
| 61 | + |
| 62 | +#### Parameters |
| 63 | + |
| 64 | +##### itxn |
| 65 | + |
| 66 | +`ApplicationCallInnerTxnContext` |
| 67 | + |
| 68 | +#### Returns |
| 69 | + |
| 70 | +`void` |
| 71 | + |
| 72 | +*** |
| 73 | + |
| 74 | +### onAbiCall() |
| 75 | + |
| 76 | +> **onAbiCall**(`methodSignature`, `callback`): `void` |
| 77 | +
|
| 78 | +Defined in: [src/application-spy.ts:69](https://github.com/algorandfoundation/algorand-typescript-testing/blob/main/src/application-spy.ts#L69) |
| 79 | + |
| 80 | +Registers a callback for a specific method signature. |
| 81 | + |
| 82 | +#### Parameters |
| 83 | + |
| 84 | +##### methodSignature |
| 85 | + |
| 86 | +`bytes` |
| 87 | + |
| 88 | +##### callback |
| 89 | + |
| 90 | +`AppSpyCb` |
| 91 | + |
| 92 | +#### Returns |
| 93 | + |
| 94 | +`void` |
| 95 | + |
| 96 | +*** |
| 97 | + |
| 98 | +### onBareCall() |
| 99 | + |
| 100 | +> **onBareCall**(`callback`): `void` |
| 101 | +
|
| 102 | +Defined in: [src/application-spy.ts:60](https://github.com/algorandfoundation/algorand-typescript-testing/blob/main/src/application-spy.ts#L60) |
| 103 | + |
| 104 | +Registers a callback for a bare call (no arguments). |
| 105 | + |
| 106 | +#### Parameters |
| 107 | + |
| 108 | +##### callback |
| 109 | + |
| 110 | +`AppSpyCb` |
| 111 | + |
| 112 | +The callback to be executed when a bare call is detected. |
| 113 | + |
| 114 | +#### Returns |
| 115 | + |
| 116 | +`void` |
0 commit comments