This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func _convertToBytes<T>(_ value: T, withCapacity capacity: Int) -> [UInt8] { | |
var mutableValue = value | |
return withUnsafePointer(to: &mutableValue) { | |
return $0.withMemoryRebound(to: UInt8.self, capacity: capacity) { | |
return Array(UnsafeBufferPointer(start: $0, count: capacity)) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func _convertToBytes<T>(_ value: T, withCapacity capacity: Int) -> [UInt8] { | |
var mutableValue = value | |
return withUnsafePointer(to: &mutableValue) { | |
return $0.withMemoryRebound(to: UInt8.self, capacity: capacity) { | |
return Array(UnsafeBufferPointer(start: $0, count: capacity)) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ParticleNetwork } from '@particle-network/auth'; | |
import { ParticleProvider } from '@particle-network/provider'; | |
import { AlchemyProvider } from "@alchemy/aa-alchemy"; | |
import { LightSmartContractAccount } from "@alchemy/aa-accounts"; | |
import { polygonMumbai } from "viem/chains"; | |
import { createWalletClient, custom } from "viem"; | |
import { WalletClientSigner, SmartAccountSigner } from "@alchemy/aa-core"; | |
const particle = new ParticleNetwork({ | |
projectId: process.env.REACT_APP_PROJECT_ID as string, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from 'react'; | |
import { ParticleNetwork } from '@particle-network/auth'; | |
import { ParticleProvider } from '@particle-network/provider'; | |
import { EthereumGoerli } from '@particle-network/chains'; | |
import { AAWrapProvider, SmartAccount, SendTransactionMode } from '@particle-network/aa'; | |
import { ethers } from 'ethers'; | |
const config = { | |
projectId: process.env.REACT_APP_PROJECT_ID, | |
clientKey: process.env.REACT_APP_CLIENT_KEY, |