Skip to content

Commit

Permalink
Merge branch 'main' into events-table
Browse files Browse the repository at this point in the history
  • Loading branch information
“Giems” committed Mar 20, 2024
2 parents a02e4e4 + d6247f1 commit ca507dd
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
4 changes: 2 additions & 2 deletions sdk/packages/polkadot/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nightlylabs/nightly-connect-polkadot",
"version": "0.0.15",
"version": "0.0.16",
"type": "module",
"exports": {
".": {
Expand Down Expand Up @@ -55,4 +55,4 @@
"eventemitter3": "^5.0.1",
"uuid": "^9.0.0"
}
}
}
5 changes: 4 additions & 1 deletion sdk/packages/polkadot/src/Signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ export class Signer implements SignerInterface {
}
signPayload = async (payload: SignerPayloadJSON): Promise<SignerResult> => {
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
Expand Down
4 changes: 2 additions & 2 deletions sdk/packages/polkadot/src/e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion sdk/packages/polkadot/src/http-e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions sdk/packages/selector-polkadot/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nightlylabs/wallet-selector-polkadot",
"version": "0.2.3",
"version": "0.2.4",
"description": "",
"type": "module",
"exports": {
Expand All @@ -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",
Expand All @@ -41,4 +41,4 @@
"tslib": "^2.5.3",
"typescript": "^5.1.3"
}
}
}
11 changes: 8 additions & 3 deletions sdk/packages/selector-polkadot/src/utils.ts
Original file line number Diff line number Diff line change
@@ -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'
}
}
}

0 comments on commit ca507dd

Please sign in to comment.