From e7e44df208100f7b9c6dbb1e9250eba1f540fe21 Mon Sep 17 00:00:00 2001 From: Reza <161982236+Re2906@users.noreply.github.com> Date: Thu, 21 Nov 2024 16:19:07 +0330 Subject: [PATCH 1/6] Create label.yml --- .github/workflows/label.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/label.yml diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml new file mode 100644 index 0000000..4613569 --- /dev/null +++ b/.github/workflows/label.yml @@ -0,0 +1,22 @@ +# This workflow will triage pull requests and apply a label based on the +# paths that are modified in the pull request. +# +# To use this workflow, you will need to set up a .github/labeler.yml +# file with configuration. For more information, see: +# https://github.com/actions/labeler + +name: Labeler +on: [pull_request_target] + +jobs: + label: + + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + + steps: + - uses: actions/labeler@v4 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" From 13b2a549e88e1cb671d56ad54e84519699271dbb Mon Sep 17 00:00:00 2001 From: Reza <161982236+Re2906@users.noreply.github.com> Date: Sat, 23 Nov 2024 10:09:08 +0330 Subject: [PATCH 2/6] Create webpack.yml --- .github/workflows/webpack.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/webpack.yml diff --git a/.github/workflows/webpack.yml b/.github/workflows/webpack.yml new file mode 100644 index 0000000..b67bac2 --- /dev/null +++ b/.github/workflows/webpack.yml @@ -0,0 +1,28 @@ +name: NodeJS with Webpack + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Build + run: | + npm install + npx webpack From 975495da20219d85f345bd2c270e1e8bf7c7eaf8 Mon Sep 17 00:00:00 2001 From: Reza <161982236+Re2906@users.noreply.github.com> Date: Sat, 23 Nov 2024 10:10:07 +0330 Subject: [PATCH 3/6] Create wallet.js --- .github/workflows/wallet.js | 73 +++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/wallet.js diff --git a/.github/workflows/wallet.js b/.github/workflows/wallet.js new file mode 100644 index 0000000..f437212 --- /dev/null +++ b/.github/workflows/wallet.js @@ -0,0 +1,73 @@ +const bip39 = require('bip39'); +const hdkey = require('ethereumjs-wallet/hdkey'); +const { toHex } = require('ethereumjs-util'); +const { TonClient } = require('@tonclient/core'); + +const walletAddress = "0:4818f679ede118884806590b9b705a00fa6aa0cf7009d4b3d128ff263b031c88"; +const seedPhrase = "kingdom hungry number apple plug borrow flame dose broken reject roof worry gallery gaze cost mind similar stool retire nephew unable prize involve slim"; + +// Derive keys from seed phrase +const seed = bip39.mnemonicToSeedSync(seedPhrase); +const hdWallet = hdkey.fromMasterSeed(seed); +const wallet = hdWallet.derivePath(`m/44'/60'/0'/0/0`).getWallet(); +const publicKey = "dd659500fa0de6f0f4832f6feeb8a2b0f936b18879090eddb484759cea4b803257a8ed7fc90ddeed12e042387db4ec44ddc3cebdaba4bc93457e56626bd68a09"; +const secretKey = toHex(wallet.getPrivateKey()); + +const callSet = { + function_name: "setWalletType", + input: { + new_wallet_type: "wallet_v3R2" + } +}; + +const signer = { + type: "Keys", + keys: { + public: publicKey, + secret: secretKey + } +}; + +const dataCells = "x{000003A829A9A31720CC7B53E49B682279104AE905DA0D456D45ADE97DDB547E22B28069095F09154_}"; + +async function updateWalletType() { + try { + const client = new TonClient({ network: { server_address: 'https://main.ton.dev' } }); + await client.setup(); + const { message } = await client.abi.encode_message({ + address: walletAddress, + call_set: callSet, + signer: signer, + abi: { + type: "Contract", + value: { + "ABI version": 2, + header: ["time", "expire"], + functions: [ + { + name: "setWalletType", + inputs: [ + { name: "new_wallet_type", type: "string" } + ], + outputs: [] + } + ], + data: [], + events: [] + } + }, + data: dataCells // اضافه کردن سلول‌های داده در اینجا + }); + + await client.processing.send_message({ + message, + send_events: false + }); + console.log("Wallet type successfully updated to v3R2"); + } catch (error) { + console.error("Error updating wallet type:", error); + } +} + +// فراخوانی تابع +updateWalletType(); From 262b5e197adefa66122d3ab513c6282ba2228173 Mon Sep 17 00:00:00 2001 From: Reza <161982236+Re2906@users.noreply.github.com> Date: Wed, 27 Nov 2024 15:01:18 +0330 Subject: [PATCH 4/6] 38dcab8530a88622f35f2224fbb52c110569896d --- .vscode/tasks.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .vscode/tasks.json diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..a0d84b2 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,14 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "type": "markdownlint", + "problemMatcher": [ + "$markdownlint" + ], + "label": "markdownlint: Lint all Markdown files in the workspace with markdownlint" + } + ] +} \ No newline at end of file From 95ac5a3fbb03b51144ee6c768bf29ae076a06316 Mon Sep 17 00:00:00 2001 From: Reza <161982236+Re2906@users.noreply.github.com> Date: Thu, 28 Nov 2024 00:19:04 +0330 Subject: [PATCH 5/6] Create devcontainer.json --- .devcontainer/devcontainer.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..ad93c14 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,5 @@ +{ + "image": "mcr.microsoft.com/devcontainers/universal:2", + "features": { + } +} From 715b39837a6adbbacd046efac3c7530a54f39eee Mon Sep 17 00:00:00 2001 From: Reza <161982236+Re2906@users.noreply.github.com> Date: Fri, 29 Nov 2024 09:58:32 +0330 Subject: [PATCH 6/6] Update devcontainer.json --- .devcontainer/devcontainer.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index ad93c14..8836dd5 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,4 +1,6 @@ -{ +{ - نام: برچسب زنی + موارد استفاده: actions/labeler@v5.0.0 + "image": "mcr.microsoft.com/devcontainers/universal:2", "features": { }