Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion examples/send-btc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { connect } from 'near-api-js'
import { getTransactionLastResult } from '@near-js/utils'
import { Action } from '@near-js/transactions'
import { contracts, chainAdapters } from 'chainsig.js'
import { createAction } from '@near-wallet-selector/wallet-utils'

import dotenv from 'dotenv'
import { KeyPairString } from '@near-js/crypto'
Expand Down Expand Up @@ -84,7 +85,7 @@ async function main() {
const transactions = walletSelectorTransactions.map((tx) => {
return {
receiverId: tx.receiverId,
actions: tx.actions,
actions: tx.actions.map((a) => createAction(a)),
} satisfies { receiverId: string; actions: Action[] }
})

Expand Down
4 changes: 2 additions & 2 deletions examples/send-eth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Action } from '@near-js/transactions'
import { contracts, chainAdapters } from 'chainsig.js'
import { createPublicClient, http } from 'viem'
import { sepolia } from 'viem/chains'

import { createAction } from '@near-wallet-selector/wallet-utils'

import dotenv from 'dotenv'
import { KeyPairString } from '@near-js/crypto'
Expand Down Expand Up @@ -87,7 +87,7 @@ async function main() {
const transactions = walletSelectorTransactions.map((tx) => {
return {
receiverId: tx.receiverId,
actions: tx.actions,
actions: tx.actions.map((a) => createAction(a)),
} satisfies { receiverId: string; actions: Action[] }
})

Expand Down
3 changes: 2 additions & 1 deletion examples/send-sol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Action } from '@near-js/transactions'
import { contracts, chainAdapters } from 'chainsig.js'
import { createPublicClient, http } from 'viem'
import { sepolia } from 'viem/chains'
import { createAction } from '@near-wallet-selector/wallet-utils'


import { Connection as SolanaConnection } from '@solana/web3.js'
Expand Down Expand Up @@ -85,7 +86,7 @@ async function main() {
const transactions = walletSelectorTransactions.map((tx) => {
return {
receiverId: tx.receiverId,
actions: tx.actions,
actions: tx.actions.map((a) => createAction(a)),
} satisfies { receiverId: string; actions: Action[] }
})

Expand Down
4 changes: 1 addition & 3 deletions examples/send-sui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,9 @@ const signature = await contract.sign({
const results = []

for (const tx of walletSelectorTransactions) {
const actions = tx.actions

const result = await account.signAndSendTransaction({
receiverId: tx.receiverId,
actions,
actions: tx.actions,
})

// @ts-ignore - Type mismatch between @near-js package versions
Expand Down
3 changes: 2 additions & 1 deletion examples/send-xrp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { connect } from 'near-api-js'
import { getTransactionLastResult } from '@near-js/utils'
import { Action } from '@near-js/transactions'
import { contracts, chainAdapters } from 'chainsig.js'
import { createAction } from '@near-wallet-selector/wallet-utils'


import dotenv from 'dotenv'
Expand Down Expand Up @@ -86,7 +87,7 @@ async function main() {
const transactions = walletSelectorTransactions.map((tx) => {
return {
receiverId: tx.receiverId,
actions: tx.actions,
actions: tx.actions.map((a) => createAction(a)),
} satisfies { receiverId: string; actions: Action[] }
})

Expand Down