Skip to content

Commit

Permalink
Remove "nonParticipating" flag for offline keyreg txn
Browse files Browse the repository at this point in the history
  • Loading branch information
yasincaliskan committed Oct 24, 2023
1 parent e58bb73 commit 96e6fa4
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 56 deletions.
48 changes: 33 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@testing-library/react": "^12.1.4",
"@testing-library/user-event": "^13.5.0",
"@types/react-modal": "^3.13.1",
"algosdk": "^1.23.2",
"algosdk": "2.7.0",
"notiboy-js-sdk": "^1.1.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
Expand Down
1 change: 0 additions & 1 deletion src/core/home/sign-txn/create/button/CreateTxnButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ function CreateTxnButton({
} else {
txn = algosdk.makeKeyRegistrationTxnWithSuggestedParamsFromObject({
from: address,
nonParticipation: true,
rekeyTo: isValidAddress(rekeyTo) ? rekeyTo : undefined,
suggestedParams
});
Expand Down
77 changes: 38 additions & 39 deletions src/core/home/sign-txn/util/signTxnUtils.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable */
import algosdk, {SuggestedParams} from "algosdk";
import {apiGetTxnParams, ChainType, clientForChain} from "../../../utils/algod/algod";
import Notiboy from "notiboy-js-sdk";
import {apiGetTxnParams, ChainType} from "../../../utils/algod/algod";

const testAccounts = [
algosdk.mnemonicToSecretKey(
Expand Down Expand Up @@ -2637,35 +2636,35 @@ const singleZoneTransferTxn: Scenario = async (
};
};

const notiboyGlobalOptIn: Scenario = async (
chain: ChainType,
address: string
): Promise<ScenarioReturnType> => {
const indexer = new algosdk.Indexer("", "https://mainnet-idx.algonode.cloud", "");
const notiboy = new Notiboy(clientForChain(chain), indexer);
const userGlobalOptin = await notiboy.userContractOptin(address);
const transactions: IScenarioTxn[][] = [];
userGlobalOptin.map((txn) => {
transactions.push([{txn}]);
});

return {
transaction: transactions
};
};

const notiboyChannelOptIn: Scenario = async (
chain: ChainType,
address: string
): Promise<ScenarioReturnType> => {
const indexer = new algosdk.Indexer("", "https://mainnet-idx.algonode.cloud", "");
const notiboy = new Notiboy(clientForChain(chain), indexer);
const channelOptinTxn = await notiboy.userChannelOptin(address, 1025363595);

return {
transaction: [[{txn: channelOptinTxn}]]
};
};
// const notiboyGlobalOptIn: Scenario = async (
// chain: ChainType,
// address: string
// ): Promise<ScenarioReturnType> => {
// const indexer = new algosdk.Indexer("", "https://mainnet-idx.algonode.cloud", "");
// const notiboy = new Notiboy(clientForChain(chain), indexer);
// const userGlobalOptin = await notiboy.userContractOptin(address);
// const transactions: IScenarioTxn[][] = [];
// userGlobalOptin.map((txn) => {
// transactions.push([{txn}]);
// });

// return {
// transaction: transactions
// };
// };

// const notiboyChannelOptIn: Scenario = async (
// chain: ChainType,
// address: string
// ): Promise<ScenarioReturnType> => {
// const indexer = new algosdk.Indexer("", "https://mainnet-idx.algonode.cloud", "");
// const notiboy = new Notiboy(clientForChain(chain), indexer);
// const channelOptinTxn = await notiboy.userChannelOptin(address, 1025363595);

// return {
// transaction: [[{txn: channelOptinTxn}]]
// };
// };

export const mainnetScenarios: Array<{name: string; scenario: Scenario}> = [
{
Expand Down Expand Up @@ -2700,14 +2699,14 @@ export const mainnetScenarios: Array<{name: string; scenario: Scenario}> = [
name: "8. Zone Transfer",
scenario: singleZoneTransferTxn
},
{
name: "9. Notiboy Global Optin",
scenario: notiboyGlobalOptIn
},
{
name: "10. Notiboy Channel Optin",
scenario: notiboyChannelOptIn
}
// {
// name: "9. Notiboy Global Optin",
// scenario: notiboyGlobalOptIn
// },
// {
// name: "10. Notiboy Channel Optin",
// scenario: notiboyChannelOptIn
// }
];

export const scenarios: Array<{name: string; scenario: Scenario}> = [
Expand Down

0 comments on commit 96e6fa4

Please sign in to comment.