Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Commit

Permalink
fix: transfer method polkadot js update (#211)
Browse files Browse the repository at this point in the history
Transfer method got deprecated, updated with transferAllowDeath
paritytech/substrate#12951

Fix #206
  • Loading branch information
Lykhoyda authored Nov 21, 2023
1 parent 42eed20 commit 20cb7bf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: '16.x'
- run: corepack enable
- run: yarn install --immutable
Expand Down Expand Up @@ -49,7 +48,6 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: '16.x'
- run: corepack enable
- name: Install
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "git+https://github.com/chainsafe/metamask-snap-polkadot.git"
},
"source": {
"shasum": "GwKusydp1vpDXY7B98s0zjVphX1d16ZnkGG3xfPqXHM=",
"shasum": "lF1WLH7ZVBdvrdv92FHQwCfqmlkMSgPTu1KdpboLwv4=",
"location": {
"npm": {
"filePath": "dist/bundle.js",
Expand Down
6 changes: 5 additions & 1 deletion packages/snap/src/rpc/generateTransactionPayload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ export async function generateTransactionPayload(
}),
nonce
};

// define transaction method
const transaction: SubmittableExtrinsic<'promise'> = api.tx.balances.transfer(to, amount);
const transaction: SubmittableExtrinsic<'promise'> = api.tx.balances.transferKeepAlive(
to,
amount
);

// create SignerPayload
const signerPayload = api.createType('SignerPayload', {
Expand Down
2 changes: 1 addition & 1 deletion packages/snap/src/rpc/send.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function send(

const amount = extrinsic.args[1].toJSON();
const paymentInfo = await api.tx.balances
.transfer(destination, String(amount))
.transferKeepAlive(destination, String(amount))
.paymentInfo(sender);

const txHash = await api.rpc.author.submitExtrinsic(extrinsic);
Expand Down

0 comments on commit 20cb7bf

Please sign in to comment.