Skip to content

Commit

Permalink
Add "Sign single app opt-in with rekey" txn
Browse files Browse the repository at this point in the history
  • Loading branch information
yasincaliskan committed Sep 25, 2023
1 parent 5286d75 commit ed64b13
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/core/home/sign-txn/util/signTxnUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,29 @@ const singleAppOptIn: Scenario = async (
};
};

const singleAppOptInWithAppRekey: Scenario = async (
chain: ChainType
): Promise<ScenarioReturnType> => {
const suggestedParams = await apiGetTxnParams(chain);

const appIndex = getAppIndex(chain);

const txn = algosdk.makeApplicationOptInTxnFromObject({
from: testAccounts[1].addr,
appIndex,
note: new Uint8Array(Buffer.from("example note value")),
appArgs: [Uint8Array.from([0]), Uint8Array.from([0, 1])],
rekeyTo: testAccounts[2].addr,
suggestedParams
});

const txnsToSign = [{txn}];

return {
transaction: [txnsToSign]
};
};

const singleAppCall: Scenario = async (
chain: ChainType,
address: string
Expand Down Expand Up @@ -2927,6 +2950,10 @@ export const scenarios: Array<{name: string; scenario: Scenario}> = [
{
name: "60. 512 Transactions",
scenario: fiveHundredTxns
},
{
name: "61. Sign single app opt-in with rekey",
scenario: singleAppOptInWithAppRekey
}
];

Expand Down

0 comments on commit ed64b13

Please sign in to comment.