Invalidates delegated stake transaction either by `hash`, `cert name` or `cert public key hash` and returns locked [[Token Delegated (m-token)|m-tokens]] to the wallet. ## Request Structure `JSON object:` ```JSON { "method": "srv_stake", "subcommand": ["invalidate"], "arguments": { "net": "net_name", "tx": "transaction_hash", "w": "wallet_name", "fee": "value", "siging_pkey_hash": "pkey_hash", "signing_pkey_type": "pkey_type", "poa_cert": "cert_name" }, "id": "1" } ``` `Common parameters:` **`net (network_name)`** - name of the Cellframe Network. The list of networks can be found in the `<Config_dir> \ etc \ network` folder or received using - [[Node Command - NET LIST]] With wallet: **`tx`** - hash of the delegation transaction **`w`** - the name of the wallet to return funds **`fee`** - commission sum With PoA cert: **`siging_pkey_hash`** - public key hash of the signer **`signing_pkey_type`** - type of the public key of a signer **`poa_cert`** - root node certificate ### Curl Example With wallet (there will be created a transaction): `Request:` ```actionscript curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '{ "method": "srv_stake", "subcommand": ["invalidate"], "arguments": { "net": "foobar", "tx": "0x908DAC21FD62DD1CE8DA2A4F41DE2550A05A6EE6C85ED582C231E2CB976AD776", "w": "foobar_master_1", "fee": "5.0e+18" }, "id": "1" }' ``` `Response 1:` ```json { "type": 2, "result": "Transaction 0x908DAC21FD62DD1CE8DA2A4F41DE2550A05A6EE6C85ED582C231E2CB976AD776 has active delegated key 0x332EE135EB8D38045AFECD0E261AC1EE6CFCA6A3B171A3E67259709253AA4303, need to revoke it first", "id": 1 } ``` `Response 2:` ```json { "type": 2, "result": "All m-tokens successfully returned to owner. Returning tx hash 0xD5E031714476D78C0CD59E5250BC9C7D4C7FDBFC2CAADF49154D021A822AB3B6.", "id": 1 } ``` With certificate (there will be created a decree): `Request:` ```actionscript curl --unix-socket /opt/cellframe-node/var/run/node_cli -X POST http://localhost/connect -d '{ "method": "srv_stake", "subcommand": ["invalidate"], "arguments": { "net": "foobar", "tx": "0x332EE135EB8D38045AFECD0E261AC1EE6CFCA6A3B171A3E67259709253AA4303", "signing_pkey_type": "sig_dil", "poa_cert": "foobar.root.pvt.0" }, "id": "1" }' ``` `Response:` ```json { "type": 2, "result": "Specified delegated key invalidated. Created key invalidation decree 0x4D7A33DE3D98F78E7A7D287C57225D0CB7AA067F3A39D454BC3AFF494585DA78.Try to execute this command with -w to return m-tokens to owner", "id": 1 } ```