diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..8836dd5 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,7 @@ +{ - نام: برچسب زنی + موارد استفاده: actions/labeler@v5.0.0 + + "image": "mcr.microsoft.com/devcontainers/universal:2", + "features": { + } +} 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 }}" 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(); 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 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