diff --git a/sdk/packages/polkadot/package.json b/sdk/packages/polkadot/package.json index 82d0bc67..2ab1de15 100644 --- a/sdk/packages/polkadot/package.json +++ b/sdk/packages/polkadot/package.json @@ -1,6 +1,6 @@ { "name": "@nightlylabs/nightly-connect-polkadot", - "version": "0.0.15", + "version": "0.0.16", "type": "module", "exports": { ".": { @@ -55,4 +55,4 @@ "eventemitter3": "^5.0.1", "uuid": "^9.0.0" } -} +} \ No newline at end of file diff --git a/sdk/packages/polkadot/src/Signer.ts b/sdk/packages/polkadot/src/Signer.ts index d6dff4a5..f9798614 100644 --- a/sdk/packages/polkadot/src/Signer.ts +++ b/sdk/packages/polkadot/src/Signer.ts @@ -21,7 +21,10 @@ export class Signer implements SignerInterface { } signPayload = async (payload: SignerPayloadJSON): Promise => { const transactionToSign: TransactionToSign = { - transaction: JSON.stringify(payload) + transaction: JSON.stringify(payload), + metadata: JSON.stringify({ + network: this.base.initializeData.network + }) } const signedTxs = await this.base.signTransactions([transactionToSign]) const result = JSON.parse(signedTxs[0].transaction) as SignerResult diff --git a/sdk/packages/polkadot/src/e2e.test.ts b/sdk/packages/polkadot/src/e2e.test.ts index a96e5445..e1f1a102 100644 --- a/sdk/packages/polkadot/src/e2e.test.ts +++ b/sdk/packages/polkadot/src/e2e.test.ts @@ -63,7 +63,7 @@ describe('Base Client tests', () => { }) test('#on("signTransactions")', async () => { - const payload = polkadotApi.tx.balances.transfer(RECEIVER, 50000000) + const payload = polkadotApi.tx.balances.transferKeepAlive(RECEIVER, 50000000) let payloadToSign: string | Uint8Array = '' @@ -108,7 +108,7 @@ describe('Base Client tests', () => { }) test('#getPendingRequests()', async () => { client.removeListener('signTransactions') - const payload = polkadotApi.tx.balances.transfer(RECEIVER, 50000000) + const payload = polkadotApi.tx.balances.transferKeepAlive(RECEIVER, 50000000) payload.signAsync(RECEIVER, { signer: app.signer }) payload.signAsync(RECEIVER, { signer: app.signer }) await smartDelay(500) diff --git a/sdk/packages/polkadot/src/http-e2e.test.ts b/sdk/packages/polkadot/src/http-e2e.test.ts index db99d763..acef1b57 100644 --- a/sdk/packages/polkadot/src/http-e2e.test.ts +++ b/sdk/packages/polkadot/src/http-e2e.test.ts @@ -61,7 +61,7 @@ describe('Base Client tests', () => { await client.connect(msg) }) test('#resolveSignTransaction()', async () => { - const payload = polkadotApi.tx.balances.transfer(RECEIVER, 50000000) + const payload = polkadotApi.tx.balances.transferKeepAlive(RECEIVER, 50000000) const promiseSignTransaction = payload.signAsync(RECEIVER, { signer: app.signer }) await smartDelay(1000) diff --git a/sdk/packages/selector-polkadot/package.json b/sdk/packages/selector-polkadot/package.json index 5c0061e4..a1296e95 100644 --- a/sdk/packages/selector-polkadot/package.json +++ b/sdk/packages/selector-polkadot/package.json @@ -1,6 +1,6 @@ { "name": "@nightlylabs/wallet-selector-polkadot", - "version": "0.2.3", + "version": "0.2.4", "description": "", "type": "module", "exports": { @@ -24,7 +24,7 @@ "author": "", "license": "ISC", "dependencies": { - "@nightlylabs/nightly-connect-polkadot": "^0.0.15", + "@nightlylabs/nightly-connect-polkadot": "^0.0.16", "@nightlylabs/wallet-selector-base": "^0.4.0", "@polkadot/api": "10.10.1", "@polkadot/extension-inject": "0.46.5", @@ -41,4 +41,4 @@ "tslib": "^2.5.3", "typescript": "^5.1.3" } -} +} \ No newline at end of file diff --git a/sdk/packages/selector-polkadot/src/utils.ts b/sdk/packages/selector-polkadot/src/utils.ts index 5d1a4ec1..d07444e2 100644 --- a/sdk/packages/selector-polkadot/src/utils.ts +++ b/sdk/packages/selector-polkadot/src/utils.ts @@ -1,16 +1,21 @@ import { NetworkData } from '@nightlylabs/wallet-selector-base' -export type SupportedNetworks = 'Polkadot' | 'AlephZero' +export type SupportedNetworks = 'Polkadot' | 'AlephZero' | 'Vara' export const networkToData = (network: SupportedNetworks): NetworkData => { switch (network) { case 'Polkadot': return { name: network, - icon: 'https://registry.nightly.app/networks/polkadot.png' // TODO add polka icon + icon: 'https://registry.nightly.app/networks/polkadot.png' } case 'AlephZero': return { name: network, - icon: 'https://registry.nightly.app/networks/alephzero.png' // TODO add polka icon + icon: 'https://registry.nightly.app/networks/alephzero.png' + } + case 'Vara': + return { + name: network, + icon: 'https://registry.nightly.app/networks/vara.png' } } }