diff --git a/examples/node/package.json b/examples/node/package.json index 7391428..c5cc4cf 100644 --- a/examples/node/package.json +++ b/examples/node/package.json @@ -9,7 +9,8 @@ "@irys/web-upload": "workspace:^", "@irys/web-upload-ethereum": "workspace:^", "@irys/web-upload-ethereum-ethers-v6": "workspace:^", - "@irys/web-upload-ethereum-viem-v2": "workspace:^" + "@irys/web-upload-ethereum-viem-v2": "workspace:^", + "@irys/upload-starknet-node":"workspace:^" }, "version": "1.0.2", "scripts": {}, diff --git a/examples/node/scripts/test-upload.ts b/examples/node/scripts/test-upload.ts index 9969e37..784cd27 100644 --- a/examples/node/scripts/test-upload.ts +++ b/examples/node/scripts/test-upload.ts @@ -14,7 +14,6 @@ import { canUploadUsdcEth } from "./tokens/usdcEth"; import { canUploadUsdcPolygon } from "./tokens/usdcPolygon"; import { canUploadChainlink } from "./tokens/chainlink"; import { canUploadSolana } from "./tokens/solana"; - const runTests = async () => { // Aptos @@ -96,8 +95,16 @@ const runTests = async () => { const usdcPolygonResult = await canUploadUsdcPolygon(); if (usdcPolygonResult) console.log("USDC on Polygon upload test passed."); else console.log("USDC on Polygon upload test failed."); - + + const uploadStarknet = await canUploadStarknet() + if(uploadStarknet)console.log("STRK on Starknet upload test passed."); + else console.log("STRK on Starknet upload test failed."); + }; runTests().catch((err) => console.error("Unexpected error during testing:", err)); + + + + diff --git a/packages/aptos-node/src/token.ts b/packages/aptos-node/src/token.ts index f01eb97..23e7e6d 100644 --- a/packages/aptos-node/src/token.ts +++ b/packages/aptos-node/src/token.ts @@ -88,7 +88,7 @@ export class AptosConfig extends BaseNodeToken { }; } - ownerToAddress(owner: any): string { + async ownerToAddress(owner: any): Promise { const hash = sha3.sha3_256.create(); hash.update(Buffer.from(owner)); hash.update("\x00"); diff --git a/packages/aptos-web/src/token.ts b/packages/aptos-web/src/token.ts index 2fa42b6..f37d5c5 100644 --- a/packages/aptos-web/src/token.ts +++ b/packages/aptos-web/src/token.ts @@ -1,4 +1,8 @@ -import type { Network, PendingTransactionResponse, UserTransactionResponse } from "@aptos-labs/ts-sdk"; +import type { + Network, + PendingTransactionResponse, + UserTransactionResponse, +} from '@aptos-labs/ts-sdk'; import { Aptos, AptosConfig as AptosSDKConfig, @@ -11,13 +15,13 @@ import { SignedTransaction, generateSignedTransaction, generateSigningMessageForTransaction, -} from "@aptos-labs/ts-sdk"; -import type { Signer } from "@irys/bundles"; -import { InjectedAptosSigner, AptosSigner } from "@irys/bundles/web"; -import BigNumber from "bignumber.js"; -import type { TokenConfig, Tx } from "@irys/upload-core"; -import sha3 from "js-sha3"; -import BaseWebToken from "@irys/web-upload/tokens/base"; +} from '@aptos-labs/ts-sdk'; +import type { Signer } from '@irys/bundles'; +import { InjectedAptosSigner, AptosSigner } from '@irys/bundles/web'; +import BigNumber from 'bignumber.js'; +import type { TokenConfig, Tx } from '@irys/upload-core'; +import sha3 from 'js-sha3'; +import BaseWebToken from '@irys/web-upload/tokens/base'; export type SignMessagePayload = { address?: boolean; // Should we include the address of the account in the message @@ -67,7 +71,7 @@ export default class AptosConfig extends BaseWebToken { super(config); this.signingFn = config?.opts?.signingFunction; - this.base = ["octa", 1e8]; + this.base = ['octa', 1e8]; } async getProvider(): Promise { @@ -76,23 +80,25 @@ export default class AptosConfig extends BaseWebToken { async getTx(txId: string): Promise { const client = await this.getProvider(); - const tx = (await client.waitForTransaction({ transactionHash: txId })) as any; + const tx = (await client.waitForTransaction({ + transactionHash: txId, + })) as any; const payload = tx?.payload as any; if (!tx.success) { - throw new Error(tx?.vm_status ?? "Unknown Aptos error"); + throw new Error(tx?.vm_status ?? 'Unknown Aptos error'); } if ( !( - payload?.function === "0x1::coin::transfer" && - payload?.type_arguments[0] === "0x1::aptos_coin::AptosCoin" && - tx?.vm_status === "Executed successfully" + payload?.function === '0x1::coin::transfer' && + payload?.type_arguments[0] === '0x1::aptos_coin::AptosCoin' && + tx?.vm_status === 'Executed successfully' ) ) { throw new Error(`Aptos tx ${txId} failed validation`); } - const isPending = tx.type === "pending_transaction"; + const isPending = tx.type === 'pending_transaction'; return { to: payload.arguments[0], from: tx.sender, @@ -102,10 +108,10 @@ export default class AptosConfig extends BaseWebToken { }; } - ownerToAddress(owner: any): string { + async ownerToAddress(owner: any): Promise { const hash = sha3.sha3_256.create(); hash.update(Buffer.from(owner)); - hash.update("\x00"); + hash.update('\x00'); return `0x${hash.hex()}`; } @@ -116,59 +122,97 @@ export default class AptosConfig extends BaseWebToken { getSigner(): Signer { if (this.signerInstance) return this.signerInstance; if (this.signingFn) { - const signer = new AptosSigner("", "0x" + this._publicKey.toString("hex")); + const signer = new AptosSigner( + '', + '0x' + this._publicKey.toString('hex') + ); signer.sign = this.signingFn; // override signer fn return (this.signerInstance = signer); } - return (this.signerInstance = new InjectedAptosSigner(this.wallet, this._publicKey)); + return (this.signerInstance = new InjectedAptosSigner( + this.wallet, + this._publicKey + )); } - async verify(pub: any, data: Uint8Array, signature: Uint8Array): Promise { + async verify( + pub: any, + data: Uint8Array, + signature: Uint8Array + ): Promise { return await InjectedAptosSigner.verify(pub, data, signature); } async getCurrentHeight(): Promise { - return new BigNumber(((await (await this.getProvider()).getLedgerInfo()) as { block_height: string }).block_height); + return new BigNumber( + ( + (await (await this.getProvider()).getLedgerInfo()) as { + block_height: string; + } + ).block_height + ); } - async getFee(amount: BigNumber.Value, to?: string): Promise<{ gasUnitPrice: number; maxGasAmount: number }> { + async getFee( + amount: BigNumber.Value, + to?: string + ): Promise<{ gasUnitPrice: number; maxGasAmount: number }> { const client = await this.getProvider(); - if (!this.address) throw new Error("Address is undefined - you might be missing a wallet, or have not run Irys.ready()"); + if (!this.address) + throw new Error( + 'Address is undefined - you might be missing a wallet, or have not run Irys.ready()' + ); const transaction = await client.transaction.build.simple({ sender: this.address, data: { - function: "0x1::coin::transfer", - typeArguments: ["0x1::aptos_coin::AptosCoin"], - functionArguments: [to ?? "0x149f7dc9c8e43c14ab46d3a6b62cfe84d67668f764277411f98732bf6718acf9", new BigNumber(amount).toNumber()], + function: '0x1::coin::transfer', + typeArguments: ['0x1::aptos_coin::AptosCoin'], + functionArguments: [ + to ?? + '0x149f7dc9c8e43c14ab46d3a6b62cfe84d67668f764277411f98732bf6718acf9', + new BigNumber(amount).toNumber(), + ], }, }); const accountAuthenticator = new AccountAuthenticatorEd25519( new Ed25519PublicKey(await this.getPublicKey()), - new Ed25519Signature(new Uint8Array(64)), + new Ed25519Signature(new Uint8Array(64)) ); - const transactionAuthenticator = new TransactionAuthenticatorEd25519(accountAuthenticator.public_key, accountAuthenticator.signature); + const transactionAuthenticator = new TransactionAuthenticatorEd25519( + accountAuthenticator.public_key, + accountAuthenticator.signature + ); - const signedSimulation = new SignedTransaction(transaction.rawTransaction, transactionAuthenticator).bcsToBytes(); + const signedSimulation = new SignedTransaction( + transaction.rawTransaction, + transactionAuthenticator + ).bcsToBytes(); const queryParams = { estimate_gas_unit_price: true, estimate_max_gas_amount: true, }; - const { data } = await postAptosFullNode({ + const { data } = await postAptosFullNode< + Uint8Array, + UserTransactionResponse[] + >({ aptosConfig: this.aptosConfig, body: signedSimulation, - path: "transactions/simulate", + path: 'transactions/simulate', params: queryParams, - originMethod: "simulateTransaction", + originMethod: 'simulateTransaction', contentType: MimeType.BCS_SIGNED_TRANSACTION, }); - return { gasUnitPrice: +data[0].gas_unit_price, maxGasAmount: +data[0].max_gas_amount }; + return { + gasUnitPrice: +data[0].gas_unit_price, + maxGasAmount: +data[0].max_gas_amount, + }; // const simulationResult = await client.simulateTransaction(this.accountInstance, rawTransaction, { estimateGasUnitPrice: true, estimateMaxGasAmount: true }); // return new BigNumber(simulationResult?.[0].gas_unit_price).multipliedBy(simulationResult?.[0].gas_used); @@ -177,15 +221,19 @@ export default class AptosConfig extends BaseWebToken { } async sendTx(data: any): Promise { - if (!this.signingFn) return (await this.wallet.signAndSubmitTransaction(data)).hash; + if (!this.signingFn) + return (await this.wallet.signAndSubmitTransaction(data)).hash; // return (await (await (this.getProvider())).submitSignedBCSTransaction(data)).hash; const provider = await this.getProvider(); - const { data: postData } = await postAptosFullNode({ + const { data: postData } = await postAptosFullNode< + Uint8Array, + PendingTransactionResponse + >({ aptosConfig: this.aptosConfig, body: data, - path: "transactions", - originMethod: "submitTransaction", + path: 'transactions', + originMethod: 'submitTransaction', contentType: MimeType.BCS_SIGNED_TRANSACTION, }); @@ -196,13 +244,13 @@ export default class AptosConfig extends BaseWebToken { async createTx( amount: BigNumber.Value, to: string, - fee?: { gasUnitPrice: number; maxGasAmount: number }, + fee?: { gasUnitPrice: number; maxGasAmount: number } ): Promise<{ txId: string | undefined; tx: any }> { const txData = { sender: this.address!, data: { - function: "0x1::coin::transfer", - typeArguments: ["0x1::aptos_coin::AptosCoin"], + function: '0x1::coin::transfer', + typeArguments: ['0x1::aptos_coin::AptosCoin'], functionArguments: [to, new BigNumber(amount).toNumber()], }, options: { @@ -224,10 +272,13 @@ export default class AptosConfig extends BaseWebToken { const senderAuthenticator = new AccountAuthenticatorEd25519( new Ed25519PublicKey(await this.getPublicKey()), - new Ed25519Signature(signerSignature), + new Ed25519Signature(signerSignature) ); - const signedTransaction = generateSignedTransaction({ transaction, senderAuthenticator }); + const signedTransaction = generateSignedTransaction({ + transaction, + senderAuthenticator, + }); return { txId: undefined, tx: signedTransaction }; // const rawTransaction = await client.generateRawTransaction(this.accountInstance.address(), payload); // const bcsTxn = AptosClient.generateBCSTransaction(this.accountInstance, rawTransaction); @@ -239,26 +290,32 @@ export default class AptosConfig extends BaseWebToken { async getPublicKey(): Promise { return (this._publicKey ??= this.signingFn - ? (Buffer.from((this.wallet as unknown as string).slice(2), "hex") as unknown as Buffer) - : Buffer.from(this.wallet.account.publicKey.toString().slice(2), "hex")); + ? (Buffer.from( + (this.wallet as unknown as string).slice(2), + 'hex' + ) as unknown as Buffer) + : Buffer.from(this.wallet.account.publicKey.toString().slice(2), 'hex')); } public async ready(): Promise { // In the Aptos context, this.providerUrl is the Aptos Network enum type we want // to work with. read more https://github.com/aptos-labs/aptos-ts-sdk/blob/main/src/api/aptosConfig.ts#L14 // this.providerUrl is a Network enum type represents the current configured network - this.aptosConfig = new AptosSDKConfig({ network: this.providerUrl, ...this.config?.opts?.aptosSdkConfig }); + this.aptosConfig = new AptosSDKConfig({ + network: this.providerUrl, + ...this.config?.opts?.aptosSdkConfig, + }); this._publicKey = (await this.getPublicKey()) as Buffer; - this._address = this.ownerToAddress(this._publicKey); + this._address = await this.ownerToAddress(this._publicKey); const client = await this.getProvider(); this._address = await client - .lookupOriginalAccountAddress({ authenticationKey: this.address ?? "" }) + .lookupOriginalAccountAddress({ authenticationKey: this.address ?? '' }) .then((hs) => hs.toString()) .catch((_) => this._address); // fallback to original - if (this._address?.length == 66 && this._address.charAt(2) === "0") { + if (this._address?.length == 66 && this._address.charAt(2) === '0') { this._address = this._address.slice(0, 2) + this._address.slice(3); } } diff --git a/packages/ethereum-web/src/ethereum.ts b/packages/ethereum-web/src/ethereum.ts index e9ca755..0f05ffb 100644 --- a/packages/ethereum-web/src/ethereum.ts +++ b/packages/ethereum-web/src/ethereum.ts @@ -42,7 +42,7 @@ export class EthereumConfig extends BaseWebToken { }; } - ownerToAddress(owner: any): string { + ownerToAddress(owner: any): Promise { // return ( // "0x" + // keccak256(Buffer.from(owner.slice(1))) diff --git a/packages/ethereum/src/ethereum.ts b/packages/ethereum/src/ethereum.ts index fb71790..dcc09b2 100644 --- a/packages/ethereum/src/ethereum.ts +++ b/packages/ethereum/src/ethereum.ts @@ -51,7 +51,7 @@ export default class BaseEthereumToken extends BaseNodeToken { }; } - ownerToAddress(owner: any): string { + async ownerToAddress(owner: any): Promise { return "0x" + keccak256(owner.slice(1)).slice(-20).toString("hex"); } diff --git a/packages/solana-node/src/token.ts b/packages/solana-node/src/token.ts index 0a8665c..0240c79 100644 --- a/packages/solana-node/src/token.ts +++ b/packages/solana-node/src/token.ts @@ -68,7 +68,7 @@ export default class SolanaConfig extends BaseNodeToken { return tx; } - ownerToAddress(owner: any): string { + async ownerToAddress(owner: any): Promise { return bs58.encode(owner); } diff --git a/packages/solana-web/src/token.ts b/packages/solana-web/src/token.ts index 6012123..3126344 100644 --- a/packages/solana-web/src/token.ts +++ b/packages/solana-web/src/token.ts @@ -61,7 +61,7 @@ export default class SolanaConfig extends BaseWebToken { return tx; } - ownerToAddress(owner: any): string { + async ownerToAddress(owner: any): Promise { if (typeof owner === "string") { owner = Buffer.from(owner); } diff --git a/packages/starknet-node/README.md b/packages/starknet-node/README.md new file mode 100644 index 0000000..1d3d834 --- /dev/null +++ b/packages/starknet-node/README.md @@ -0,0 +1,9 @@ +# starknet-node + +TODO + +## Installation + +```sh +npm install @irys/upload-starknet-node +``` diff --git a/packages/starknet-node/cjs.tsconfig.json b/packages/starknet-node/cjs.tsconfig.json new file mode 100644 index 0000000..ff4892d --- /dev/null +++ b/packages/starknet-node/cjs.tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../cjs.tsconfig.json", + "include": [ + "src" + ], + "compilerOptions": { + "outDir": "dist/cjs", + "rootDir": "./src", + "declaration": false + } +} \ No newline at end of file diff --git a/packages/starknet-node/package.json b/packages/starknet-node/package.json new file mode 100644 index 0000000..7ae48d3 --- /dev/null +++ b/packages/starknet-node/package.json @@ -0,0 +1,82 @@ +{ + "name": "@irys/upload-starknet-node", + "version": "0.0.0", + "description": "TODO", + "license": "MIT", + "sideEffects": false, + "module": "dist/esm/index.js", + "main": "dist/cjs/index.js", + "types": "dist/types/index.d.ts", + "exports": { + ".": { + "types": "./dist/types/index.d.ts", + "import": "./dist/esm/index.js", + "require": "./dist/cjs/index.js" + }, + "./esm/*": { + "types": "./dist/types/*.d.ts", + "default": "./dist/esm/*.js" + }, + "./cjs/*": { + "types": "./dist/types/*.d.ts", + "default": "./dist/cjs/*.js" + }, + "./*": { + "types": "./dist/types/*.d.ts", + "import": { + "types": "./dist/types/*.d.ts", + "default": "./dist/esm/*.js" + }, + "require": { + "types": "./dist/types/*.d.ts", + "default": "./dist/cjs/*.js" + } + } + }, + "files": [ + "/dist/cjs", + "/dist/esm", + "/dist/types", + "/src" + ], + "scripts": { + "lint": "eslint --ext js,ts,tsx src", + "lint:fix": "eslint --fix --ext js,ts,tsx src", + "clean": "rimraf dist", + "build": "pnpm clean && concurrently \" tsc && sh ../../scripts/fix-pkg.sh esm module && tsc-esm-fix \" \" tsc -p test/tsconfig.json \" \"tsc -p cjs.tsconfig.json && sh ../../scripts/fix-pkg.sh cjs commonjs \"", + "test": "ava" + }, + "dependencies": { + "@irys/bundles": "^0.0.2", + "@irys/upload": "workspace:^", + "@irys/upload-core": "workspace:^", + "bignumber.js": "^9.1.2", + "starknet": "^6.17.0" + }, + "devDependencies": { + "@ava/typescript": "^5.0.0", + "ava": "^6.1.3" + }, + "publishConfig": { + "access": "public" + }, + "author": "Irys maintainers ", + "homepage": "https://irys.xyz", + "repository": { + "url": "https://github.com/irys-xyz/js-sdk.git" + }, + "typedoc": { + "entryPoint": "./src/index.ts", + "readmeFile": "./README.md", + "displayName": "starknet-node" + }, + "ava": { + "typescript": { + "compile": false, + "rewritePaths": { + "src/": "dist/test/src/", + "test/": "dist/test/test/" + } + } + } +} diff --git a/packages/starknet-node/src/abi/argent.abi.json b/packages/starknet-node/src/abi/argent.abi.json new file mode 100644 index 0000000..d550b97 --- /dev/null +++ b/packages/starknet-node/src/abi/argent.abi.json @@ -0,0 +1,19 @@ +[ + { + "name": "argent::account::interface::IArgentUserAccount", + "type": "interface", + "items": [ + { + "name": "get_owner", + "type": "function", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + } +] \ No newline at end of file diff --git a/packages/starknet-node/src/abi/braavos.abi.json b/packages/starknet-node/src/abi/braavos.abi.json new file mode 100644 index 0000000..48ddfb0 --- /dev/null +++ b/packages/starknet-node/src/abi/braavos.abi.json @@ -0,0 +1,17 @@ +[ { + "name": "braavos_account::signers::interface::ISignerManagement", + "type": "interface", + "items": [ + { + "name": "get_public_key", + "type": "function", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] +}] \ No newline at end of file diff --git a/packages/starknet-node/src/abi/erc20.abi.json b/packages/starknet-node/src/abi/erc20.abi.json new file mode 100644 index 0000000..310944b --- /dev/null +++ b/packages/starknet-node/src/abi/erc20.abi.json @@ -0,0 +1,1122 @@ +[ + { + "name": "LockingContract", + "type": "impl", + "interface_name": "src::mintable_lock_interface::ILockingContract" + }, + { + "name": "src::mintable_lock_interface::ILockingContract", + "type": "interface", + "items": [ + { + "name": "set_locking_contract", + "type": "function", + "inputs": [ + { + "name": "locking_contract", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "name": "get_locking_contract", + "type": "function", + "inputs": [], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "view" + } + ] + }, + { + "name": "LockAndDelegate", + "type": "impl", + "interface_name": "src::mintable_lock_interface::ILockAndDelegate" + }, + { + "name": "core::integer::u256", + "type": "struct", + "members": [ + { + "name": "low", + "type": "core::integer::u128" + }, + { + "name": "high", + "type": "core::integer::u128" + } + ] + }, + { + "name": "src::mintable_lock_interface::ILockAndDelegate", + "type": "interface", + "items": [ + { + "name": "lock_and_delegate", + "type": "function", + "inputs": [ + { + "name": "delegatee", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u256" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "name": "lock_and_delegate_by_sig", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "delegatee", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u256" + }, + { + "name": "nonce", + "type": "core::felt252" + }, + { + "name": "expiry", + "type": "core::integer::u64" + }, + { + "name": "signature", + "type": "core::array::Array::" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "name": "MintableToken", + "type": "impl", + "interface_name": "src::mintable_token_interface::IMintableToken" + }, + { + "name": "src::mintable_token_interface::IMintableToken", + "type": "interface", + "items": [ + { + "name": "permissioned_mint", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u256" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "name": "permissioned_burn", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u256" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "name": "MintableTokenCamelImpl", + "type": "impl", + "interface_name": "src::mintable_token_interface::IMintableTokenCamel" + }, + { + "name": "src::mintable_token_interface::IMintableTokenCamel", + "type": "interface", + "items": [ + { + "name": "permissionedMint", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u256" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "name": "permissionedBurn", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u256" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "name": "Replaceable", + "type": "impl", + "interface_name": "src::replaceability_interface::IReplaceable" + }, + { + "name": "core::array::Span::", + "type": "struct", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "name": "src::replaceability_interface::EICData", + "type": "struct", + "members": [ + { + "name": "eic_hash", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "eic_init_data", + "type": "core::array::Span::" + } + ] + }, + { + "name": "core::option::Option::", + "type": "enum", + "variants": [ + { + "name": "Some", + "type": "src::replaceability_interface::EICData" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "name": "core::bool", + "type": "enum", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "name": "src::replaceability_interface::ImplementationData", + "type": "struct", + "members": [ + { + "name": "impl_hash", + "type": "core::starknet::class_hash::ClassHash" + }, + { + "name": "eic_data", + "type": "core::option::Option::" + }, + { + "name": "final", + "type": "core::bool" + } + ] + }, + { + "name": "src::replaceability_interface::IReplaceable", + "type": "interface", + "items": [ + { + "name": "get_upgrade_delay", + "type": "function", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u64" + } + ], + "state_mutability": "view" + }, + { + "name": "get_impl_activation_time", + "type": "function", + "inputs": [ + { + "name": "implementation_data", + "type": "src::replaceability_interface::ImplementationData" + } + ], + "outputs": [ + { + "type": "core::integer::u64" + } + ], + "state_mutability": "view" + }, + { + "name": "add_new_implementation", + "type": "function", + "inputs": [ + { + "name": "implementation_data", + "type": "src::replaceability_interface::ImplementationData" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "name": "remove_implementation", + "type": "function", + "inputs": [ + { + "name": "implementation_data", + "type": "src::replaceability_interface::ImplementationData" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "name": "replace_to", + "type": "function", + "inputs": [ + { + "name": "implementation_data", + "type": "src::replaceability_interface::ImplementationData" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "name": "AccessControlImplExternal", + "type": "impl", + "interface_name": "src::access_control_interface::IAccessControl" + }, + { + "name": "src::access_control_interface::IAccessControl", + "type": "interface", + "items": [ + { + "name": "has_role", + "type": "function", + "inputs": [ + { + "name": "role", + "type": "core::felt252" + }, + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "name": "get_role_admin", + "type": "function", + "inputs": [ + { + "name": "role", + "type": "core::felt252" + } + ], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "name": "RolesImpl", + "type": "impl", + "interface_name": "src::roles_interface::IMinimalRoles" + }, + { + "name": "src::roles_interface::IMinimalRoles", + "type": "interface", + "items": [ + { + "name": "is_governance_admin", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "name": "is_upgrade_governor", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "name": "register_governance_admin", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "name": "remove_governance_admin", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "name": "register_upgrade_governor", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "name": "remove_upgrade_governor", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "name": "renounce", + "type": "function", + "inputs": [ + { + "name": "role", + "type": "core::felt252" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "name": "ERC20Impl", + "type": "impl", + "interface_name": "openzeppelin::token::erc20::interface::IERC20" + }, + { + "name": "openzeppelin::token::erc20::interface::IERC20", + "type": "interface", + "items": [ + { + "name": "name", + "type": "function", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "name": "symbol", + "type": "function", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "name": "decimals", + "type": "function", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "name": "total_supply", + "type": "function", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "view" + }, + { + "name": "balance_of", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "view" + }, + { + "name": "allowance", + "type": "function", + "inputs": [ + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "spender", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "view" + }, + { + "name": "transfer", + "type": "function", + "inputs": [ + { + "name": "recipient", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + }, + { + "name": "transfer_from", + "type": "function", + "inputs": [ + { + "name": "sender", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "recipient", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + }, + { + "name": "approve", + "type": "function", + "inputs": [ + { + "name": "spender", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + } + ] + }, + { + "name": "ERC20CamelOnlyImpl", + "type": "impl", + "interface_name": "openzeppelin::token::erc20::interface::IERC20CamelOnly" + }, + { + "name": "openzeppelin::token::erc20::interface::IERC20CamelOnly", + "type": "interface", + "items": [ + { + "name": "totalSupply", + "type": "function", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "view" + }, + { + "name": "balanceOf", + "type": "function", + "inputs": [ + { + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "view" + }, + { + "name": "transferFrom", + "type": "function", + "inputs": [ + { + "name": "sender", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "recipient", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + } + ] + }, + { + "name": "constructor", + "type": "constructor", + "inputs": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "symbol", + "type": "core::felt252" + }, + { + "name": "decimals", + "type": "core::integer::u8" + }, + { + "name": "initial_supply", + "type": "core::integer::u256" + }, + { + "name": "recipient", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "permitted_minter", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "provisional_governance_admin", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "upgrade_delay", + "type": "core::integer::u64" + } + ] + }, + { + "name": "increase_allowance", + "type": "function", + "inputs": [ + { + "name": "spender", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "added_value", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + }, + { + "name": "decrease_allowance", + "type": "function", + "inputs": [ + { + "name": "spender", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "subtracted_value", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + }, + { + "name": "increaseAllowance", + "type": "function", + "inputs": [ + { + "name": "spender", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "addedValue", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + }, + { + "name": "decreaseAllowance", + "type": "function", + "inputs": [ + { + "name": "spender", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "subtractedValue", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + }, + { + "kind": "struct", + "name": "src::strk::erc20_lockable::ERC20Lockable::Transfer", + "type": "event", + "members": [ + { + "kind": "data", + "name": "from", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "kind": "data", + "name": "to", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "kind": "data", + "name": "value", + "type": "core::integer::u256" + } + ] + }, + { + "kind": "struct", + "name": "src::strk::erc20_lockable::ERC20Lockable::Approval", + "type": "event", + "members": [ + { + "kind": "data", + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "kind": "data", + "name": "spender", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "kind": "data", + "name": "value", + "type": "core::integer::u256" + } + ] + }, + { + "kind": "struct", + "name": "src::replaceability_interface::ImplementationAdded", + "type": "event", + "members": [ + { + "kind": "data", + "name": "implementation_data", + "type": "src::replaceability_interface::ImplementationData" + } + ] + }, + { + "kind": "struct", + "name": "src::replaceability_interface::ImplementationRemoved", + "type": "event", + "members": [ + { + "kind": "data", + "name": "implementation_data", + "type": "src::replaceability_interface::ImplementationData" + } + ] + }, + { + "kind": "struct", + "name": "src::replaceability_interface::ImplementationReplaced", + "type": "event", + "members": [ + { + "kind": "data", + "name": "implementation_data", + "type": "src::replaceability_interface::ImplementationData" + } + ] + }, + { + "kind": "struct", + "name": "src::replaceability_interface::ImplementationFinalized", + "type": "event", + "members": [ + { + "kind": "data", + "name": "impl_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ] + }, + { + "kind": "struct", + "name": "src::access_control_interface::RoleGranted", + "type": "event", + "members": [ + { + "kind": "data", + "name": "role", + "type": "core::felt252" + }, + { + "kind": "data", + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "kind": "data", + "name": "sender", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "kind": "struct", + "name": "src::access_control_interface::RoleRevoked", + "type": "event", + "members": [ + { + "kind": "data", + "name": "role", + "type": "core::felt252" + }, + { + "kind": "data", + "name": "account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "kind": "data", + "name": "sender", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "kind": "struct", + "name": "src::access_control_interface::RoleAdminChanged", + "type": "event", + "members": [ + { + "kind": "data", + "name": "role", + "type": "core::felt252" + }, + { + "kind": "data", + "name": "previous_admin_role", + "type": "core::felt252" + }, + { + "kind": "data", + "name": "new_admin_role", + "type": "core::felt252" + } + ] + }, + { + "kind": "struct", + "name": "src::roles_interface::GovernanceAdminAdded", + "type": "event", + "members": [ + { + "kind": "data", + "name": "added_account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "kind": "data", + "name": "added_by", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "kind": "struct", + "name": "src::roles_interface::GovernanceAdminRemoved", + "type": "event", + "members": [ + { + "kind": "data", + "name": "removed_account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "kind": "data", + "name": "removed_by", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "kind": "struct", + "name": "src::roles_interface::UpgradeGovernorAdded", + "type": "event", + "members": [ + { + "kind": "data", + "name": "added_account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "kind": "data", + "name": "added_by", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "kind": "struct", + "name": "src::roles_interface::UpgradeGovernorRemoved", + "type": "event", + "members": [ + { + "kind": "data", + "name": "removed_account", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "kind": "data", + "name": "removed_by", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "kind": "enum", + "name": "src::strk::erc20_lockable::ERC20Lockable::Event", + "type": "event", + "variants": [ + { + "kind": "nested", + "name": "Transfer", + "type": "src::strk::erc20_lockable::ERC20Lockable::Transfer" + }, + { + "kind": "nested", + "name": "Approval", + "type": "src::strk::erc20_lockable::ERC20Lockable::Approval" + }, + { + "kind": "nested", + "name": "ImplementationAdded", + "type": "src::replaceability_interface::ImplementationAdded" + }, + { + "kind": "nested", + "name": "ImplementationRemoved", + "type": "src::replaceability_interface::ImplementationRemoved" + }, + { + "kind": "nested", + "name": "ImplementationReplaced", + "type": "src::replaceability_interface::ImplementationReplaced" + }, + { + "kind": "nested", + "name": "ImplementationFinalized", + "type": "src::replaceability_interface::ImplementationFinalized" + }, + { + "kind": "nested", + "name": "RoleGranted", + "type": "src::access_control_interface::RoleGranted" + }, + { + "kind": "nested", + "name": "RoleRevoked", + "type": "src::access_control_interface::RoleRevoked" + }, + { + "kind": "nested", + "name": "RoleAdminChanged", + "type": "src::access_control_interface::RoleAdminChanged" + }, + { + "kind": "nested", + "name": "GovernanceAdminAdded", + "type": "src::roles_interface::GovernanceAdminAdded" + }, + { + "kind": "nested", + "name": "GovernanceAdminRemoved", + "type": "src::roles_interface::GovernanceAdminRemoved" + }, + { + "kind": "nested", + "name": "UpgradeGovernorAdded", + "type": "src::roles_interface::UpgradeGovernorAdded" + }, + { + "kind": "nested", + "name": "UpgradeGovernorRemoved", + "type": "src::roles_interface::UpgradeGovernorRemoved" + } + ] + } + ] \ No newline at end of file diff --git a/packages/starknet-node/src/client.ts b/packages/starknet-node/src/client.ts new file mode 100644 index 0000000..075b9b7 --- /dev/null +++ b/packages/starknet-node/src/client.ts @@ -0,0 +1,47 @@ +import { BaseNodeToken } from "@irys/upload/tokens/base"; +import { Constructable, type TokenConfigTrimmed } from "@irys/upload/builder"; +import BaseSTRK20Token from "./token"; + + +const STARKNET_PROVIDER_URL = "https://starknet-mainnet.public.blastapi.io"; +const CONTRACT_ADDRESSES = { + ETH: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", + STRK: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", +}; + +// set stark token as default +export class StarknetToken extends BaseSTRK20Token { + constructor(config: TokenConfigTrimmed) { + super({ + name: "starknet", + ticker: "STRK", + ...config, + contractAddress: config.opts?.contractAddress ?? CONTRACT_ADDRESSES.STRK, + privateKey: config.opts?.privateKey ?? "", + address: config.opts?.address ?? "", + providerUrl: config.providerUrl ?? STARKNET_PROVIDER_URL + }); + } +} + +function getBoundERC20(name: string, ticker: string, contractAddress: string): Constructable<[TokenConfigTrimmed], BaseSTRK20Token> { + return class extends BaseSTRK20Token { + constructor(config: TokenConfigTrimmed) { + super({ + name, + ticker, + ...config, + providerUrl: config.providerUrl ?? STARKNET_PROVIDER_URL, + contractAddress: config.opts?.contractAddress ?? contractAddress, + privateKey: config.opts?.privateKey ?? "", + address: config.opts?.address ?? "" + }); + } + }; +} + +// config to use starknetETH +export const StarknetEth = getBoundERC20("eth", "ETH", CONTRACT_ADDRESSES.ETH); +export const Starknet: Constructable<[TokenConfigTrimmed], BaseNodeToken> = StarknetToken + +export default Starknet; diff --git a/packages/starknet-node/src/index.ts b/packages/starknet-node/src/index.ts new file mode 100644 index 0000000..e455606 --- /dev/null +++ b/packages/starknet-node/src/index.ts @@ -0,0 +1,5 @@ +export * from './token'; +export * from "./client" +import { Starknet } from './client'; +export {Starknet}; +export default Starknet; diff --git a/packages/starknet-node/src/irys.ts b/packages/starknet-node/src/irys.ts new file mode 100644 index 0000000..5a2c4b1 --- /dev/null +++ b/packages/starknet-node/src/irys.ts @@ -0,0 +1,37 @@ +import BaseNodeIrys from "@irys/upload/base"; +import BaseStarknetToken from "./token"; +import type { IrysConfig } from "@irys/upload-core"; + + +type TokenOptions = { + privateKey?: string; + address?: string; + }; + + // Update the NodeIrysConfig type to include TokenOptions for tokenOpts + interface NodeIrysConfig { + url: string; + key: string; + config?: IrysConfig + tokenOpts:TokenOptions + } +export default class StarknetIrys extends BaseNodeIrys { + constructor({ url, key, config,tokenOpts }: NodeIrysConfig) { + super({ + url, + config, + getTokenConfig: (irys) => + new BaseStarknetToken({ + irys, + name: "starknet", + ticker: "STRK", + providerUrl: config?.providerUrl ?? "", + wallet: key, + opts: config?.tokenOpts, + privateKey: tokenOpts?.privateKey ?? "", + address: tokenOpts?.address ?? "", + contractAddress: config?.contractAddress ?? "" + }), + }); + } +} diff --git a/packages/starknet-node/src/supportedWallets/walletConfig.ts b/packages/starknet-node/src/supportedWallets/walletConfig.ts new file mode 100644 index 0000000..e98b1f5 --- /dev/null +++ b/packages/starknet-node/src/supportedWallets/walletConfig.ts @@ -0,0 +1,19 @@ +import argentAbi from '../abi/argent.abi.json'; +import braavosAbi from '../abi/braavos.abi.json'; + +export const ID = [ + { + id: 1, + name: 'Argent', + abi: argentAbi, + selector: 'get_owner', + version: '1.0.0', + }, + { + id: 2, + name: 'Braavos', + abi: braavosAbi, + selector: 'get_public_key', + version: '1.0.0', + }, +]; diff --git a/packages/starknet-node/src/token.ts b/packages/starknet-node/src/token.ts new file mode 100644 index 0000000..7c624ac --- /dev/null +++ b/packages/starknet-node/src/token.ts @@ -0,0 +1,283 @@ +import type { TokenConfig, Tx } from '@irys/upload-core'; +import { BaseNodeToken } from '@irys/upload/tokens/base'; +import { Contract, RpcProvider, Provider, Result } from 'starknet'; +import { StarknetSigner, Signer } from '@irys/bundles'; +import BigNumber from 'bignumber.js'; +import { num, Account, uint256 } from 'starknet'; +import strkerc20token from '../src/abi/erc20.abi.json'; +import { ID } from './supportedWallets/walletConfig'; +const starknetSigner = StarknetSigner; + +export interface STRKTokenConfig extends TokenConfig { + contractAddress: string; + privateKey: string; + address: string; +} + +export default class BaseSTRK20Token extends BaseNodeToken { + protected contractInstance!: Contract; + protected contractAddress: string; + protected declare providerInstance: Provider; + protected privateKey: string; + protected signer: StarknetSigner; + protected account: Account; + constructor(config: STRKTokenConfig) { + super(config); + this.contractAddress = config.contractAddress; + this.privateKey = config.privateKey; + this._address = config.address; + this.providerInstance = new RpcProvider({ nodeUrl: this.providerUrl }); + this.account = new Account( + this.providerInstance, + this._address, + this.privateKey + ); + this.signer = new StarknetSigner( + this.providerInstance, + this._address, + this.privateKey + ); + } + + async ready(): Promise { + try { + await this.signer.init(); + } catch (error) { + throw error; + } + } + + // Set the base token for gas payments based on the token address provided in the setup. + // Starknet supports two tokens for gas payments: ETH and STRK, both implemented as ERC20 tokens. + // Since these tokens have the same contract address on both mainnet and testnet, + // we use the provided address directly to determine the base token for gas. + // @notice: STRK AND ETH TOKEN HAVE THE SAME ADDRESS ON MAINNET AND TESTNET + // STARK TOKEN ON MAINNET : https://starkscan.co/token/0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d + // ETH TOKEN ON MAINNET: https://sepolia.starkscan.co/token/0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7 + async getContract(): Promise { + if (!this.contractInstance) { + this.contractInstance = new Contract( + strkerc20token, + this.contractAddress, + this.providerInstance + ); + const decimals = Math.pow(10, await this.contractInstance.decimals()); + this.base = + this.contractAddress === + '0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d' + ? ['fri', decimals] + : this.contractAddress === + '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7' + ? ['wei', decimals] + : ['', 0]; + } + return this.contractInstance; + } + protected async getProvider(): Promise { + if (!this.providerInstance) { + this.providerInstance = new RpcProvider({ nodeUrl: this.providerUrl }); + } + return this.providerInstance; + } + + async getTx(txId: string): Promise { + try { + const receipt = await this.providerInstance.getTransactionReceipt(txId); + const traces = await this.providerInstance.getTransactionTrace(txId); + + if (!receipt || !traces) { + throw new Error('Transaction does not exist or is still pending.'); + } + + const receiptResponse = (receipt as unknown as Transaction).value; + const tracesResponse = (traces as FeeTransferInvocation) + .fee_transfer_invocation; + + const amount = receiptResponse?.actual_fee.amount; + + return { + from: tracesResponse?.caller_address as string, + to: tracesResponse?.contract_address as string, + blockHeight: new BigNumber(receiptResponse?.block_number as number), + amount: new BigNumber(amount as string), + pending: !receiptResponse?.block_number, + confirmed: !!(receiptResponse?.finality_status === 'ACCEPTED_ON_L1'), + }; + } catch (error) { + throw error; + } + } + + async ownerToAddress(owner: any): Promise { + // Public key and address lengths + const publicKeyLength = 33; + const addressLength = 32; + + // Get the returned public key and convert to a buffer + const returnedPubKey = await this.getAccountPublicKey(); + const returnedPubKeyBuffer = Buffer.from(returnedPubKey.toString()); + + // Get the injected public key from the signer + const InjectedPublicKey = this.signer.publicKey; + + // Extracting the public key and address from the InjectedPublicKey + const extractedPublicKeyBuffer = InjectedPublicKey.subarray( + 0, + publicKeyLength + ); + const extractedAddressBuffer = InjectedPublicKey.subarray( + publicKeyLength, + publicKeyLength + addressLength + ); + + // Convert extracted buffers to hex + const extractedAddressHex = extractedAddressBuffer.toString('hex'); + + // Check if the returned public key matches the extracted public key + if (returnedPubKeyBuffer.equals(extractedPublicKeyBuffer)) { + return extractedAddressHex; + } else { + throw Error( + 'Returned public key buffer is not equal extracted public key buffer' + ); + } + } + + async getAccountPublicKey(): Promise { + if (!this._address) { + throw new Error('Address is not defined'); + } + + for (const config of ID) { + try { + const contractInstance = new Contract( + config.abi, + this._address, + this.providerInstance + ); + const publicKey = await contractInstance.call(config.selector); + if (publicKey) { + return publicKey; + } + } catch (error) { + throw error; + } + } + + throw new Error( + `Unable to retrieve the public key for address ${this._address}` + ); + } + + async sign(data: Uint8Array): Promise { + return this.signer.sign(data); + } + + getSigner(): Signer { + return this.signer; + } + + verify(pub: any, data: Uint8Array, signature: Uint8Array): Promise { + return starknetSigner.verify(pub, data, signature); + } + + async getCurrentHeight(): Promise { + const response = await this.providerInstance.getBlockNumber(); + return new BigNumber(response, 16); + } + + async getFee( + amount: BigNumber.Value, + to?: string, + _multiplier?: BigNumber.Value | undefined + ): Promise { + try { + const amountBigNumber = new BigNumber(amount); + const _amount = uint256.bnToUint256(amountBigNumber.toString()); + + const suggestedMaxFee = await this.account.estimateInvokeFee({ + contractAddress: this.contractAddress, + entrypoint: 'transfer', + calldata: [to || '', _amount.high, _amount.low], + }); + + const result = suggestedMaxFee.suggestedMaxFee; + const result_to_hex = num.toHex(result); + return new BigNumber(result_to_hex); + } catch (error) { + throw error + } + } + + async createTx( + amount: BigNumber.Value, + to: string, + _fee?: string | object | undefined + ): Promise<{ txId: string | undefined; tx: any }> { + try { + const amountBigNumber = new BigNumber(amount); + const _amount = uint256.bnToUint256(amountBigNumber.toString()); + + const calldata = [to, _amount.low, _amount.high]; + const maxFeeEstimate = await this.account.estimateFee({ + contractAddress: this.contractAddress, + entrypoint: 'transfer', + calldata, + }); + + const { transaction_hash: txId } = await this.account.execute( + { + contractAddress: this.contractAddress, + entrypoint: 'transfer', + calldata, + }, + { maxFee: maxFeeEstimate.suggestedMaxFee } + ); + + return { txId, tx: txId }; + } catch (error) { + throw error; + } + } + + async sendTx(data: any): Promise { + if (!this._address) { + throw new Error('Address is not defined'); + } + try { + // Execute the transaction using the account's invoke method + const response = await this.account.execute(data); + // Wait for the transaction to be confirmed + await this.providerInstance.waitForTransaction(response.transaction_hash); + return response.transaction_hash; + } catch (error) { + throw error; + } + } + + getPublicKey(): string | Buffer { + return this.signer.publicKey; + } +} + +interface FeeTransferInvocation { + fee_transfer_invocation?: { + calldata: string[]; + caller_address: string; + contract_address: string; + entry_point_selector: string; + entry_point_type: string; + }; +} + +interface Transaction { + value?: { + actual_fee: { + amount: string; + unit: 'WEI'; + }; + block_number: number; + execution_status: 'SUCCEEDED' | 'FAILED'; + finality_status: 'ACCEPTED_ON_L1' | 'REJECTED'; + }; +} diff --git a/packages/starknet-node/test/modules/cjs.test.cjs b/packages/starknet-node/test/modules/cjs.test.cjs new file mode 100644 index 0000000..215ffde --- /dev/null +++ b/packages/starknet-node/test/modules/cjs.test.cjs @@ -0,0 +1,10 @@ +/* eslint-disable import/no-extraneous-dependencies */ +const test = require('ava'); + +const exported = require('../../dist/cjs/index.js'); + +test('it successfully exports commonjs exports', (t) => { + const exportedKeys = Object.keys(exported); + t.true(exportedKeys.length > 0); +}); + diff --git a/packages/starknet-node/test/modules/esm.test.mjs b/packages/starknet-node/test/modules/esm.test.mjs new file mode 100644 index 0000000..cf2e7a9 --- /dev/null +++ b/packages/starknet-node/test/modules/esm.test.mjs @@ -0,0 +1,10 @@ +/* eslint-disable import/extensions */ +/* eslint-disable import/no-extraneous-dependencies */ +import test from 'ava'; +import * as exported from '../../dist/esm/index.js'; + +test('it successfully exports esm exports', (t) => { + const exportedKeys = Object.keys(exported); + t.true(exportedKeys.length > 0); +}); + diff --git a/packages/starknet-node/test/someFeature.test.ts b/packages/starknet-node/test/someFeature.test.ts new file mode 100644 index 0000000..24d4274 --- /dev/null +++ b/packages/starknet-node/test/someFeature.test.ts @@ -0,0 +1,6 @@ +import test from 'ava'; +import { StarknetToken } from '../src/client'; + +test('example test', async (t) => { + t.is(typeof StarknetToken, 'function'); +}); diff --git a/packages/starknet-node/test/tsconfig.json b/packages/starknet-node/test/tsconfig.json new file mode 100644 index 0000000..2d667da --- /dev/null +++ b/packages/starknet-node/test/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../cjs.tsconfig.json", + "include": [ + "../src", + "../test" + ], + "compilerOptions": { + "module": "Node16", + "rootDir": "../", + "outDir": "../dist/test", + "declarationDir": null, + "moduleResolution": "Node16", + "declaration": false, + "emitDeclarationOnly": false + } +} diff --git a/packages/starknet-node/tsconfig.json b/packages/starknet-node/tsconfig.json new file mode 100644 index 0000000..e1259f3 --- /dev/null +++ b/packages/starknet-node/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../esm.tsconfig.json", + "include": [ + "src", + ], + "compilerOptions": { + "outDir": "dist/esm", + "declarationDir": "dist/types", + "rootDir": "./src" + } +} \ No newline at end of file diff --git a/packages/upload-core/src/types.ts b/packages/upload-core/src/types.ts index b5e245c..bf5d729 100644 --- a/packages/upload-core/src/types.ts +++ b/packages/upload-core/src/types.ts @@ -83,7 +83,7 @@ export type Token = { getTx(txId: string): Promise; - ownerToAddress(owner: any): string; + ownerToAddress(owner: any): Promise; price(): Promise; diff --git a/packages/upload-core/src/withdrawal.ts b/packages/upload-core/src/withdrawal.ts index d3d80e4..9ededf6 100644 --- a/packages/upload-core/src/withdrawal.ts +++ b/packages/upload-core/src/withdrawal.ts @@ -43,7 +43,7 @@ export async function withdrawBalance(utils: Utils, api: Api, amount: BigNumber. const dh2 = await deepHash([stringToBuffer(data.currency), stringToBuffer(data.amount.toString()), stringToBuffer(data.nonce.toString())]); const isValid2 = await c.verify(cpk, dh2, csig); - const isValid3 = c.ownerToAddress(c.name == "arweave" ? base64url.decode(data.publicKey) : base64url.toBuffer(data.publicKey)) === c.address; + const isValid3 = await c.ownerToAddress(c.name == "arweave" ? base64url.decode(data.publicKey) : base64url.toBuffer(data.publicKey)) === c.address; if (!(isValid || isValid2 || isValid3)) { throw new Error(`Internal withdrawal validation failed - please report this!\nDebug Info:${JSON.stringify(data)}`); diff --git a/packages/upload-node/src/tokens/base.ts b/packages/upload-node/src/tokens/base.ts index f2a9f84..f9a7263 100644 --- a/packages/upload-node/src/tokens/base.ts +++ b/packages/upload-node/src/tokens/base.ts @@ -22,7 +22,8 @@ export abstract class BaseNodeToken implements NodeToken { constructor(config: TokenConfig) { Object.assign(this, config); - this._address = this.wallet ? this.ownerToAddress(this.getPublicKey()) : undefined; + this.initializeAddress() + // this._address = this.wallet ? this.ownerToAddress(this.getPublicKey()) : undefined; } // common methods @@ -31,11 +32,17 @@ export abstract class BaseNodeToken implements NodeToken { return this._address; } + private async initializeAddress() { + if (this.wallet) { + this._address = await this.ownerToAddress(this.getPublicKey()); + } + } + async price(): Promise { return getRedstonePrice(this.ticker); } abstract getTx(_txId: string): Promise; - abstract ownerToAddress(_owner: any): string; + abstract ownerToAddress(_owner: any): Promise; abstract sign(_data: Uint8Array): Promise; abstract getSigner(): Signer; abstract verify(_pub: any, _data: Uint8Array, _signature: Uint8Array): Promise; diff --git a/packages/upload-web/src/tokens/base.ts b/packages/upload-web/src/tokens/base.ts index efd5d7d..1445bf4 100644 --- a/packages/upload-web/src/tokens/base.ts +++ b/packages/upload-web/src/tokens/base.ts @@ -33,15 +33,20 @@ export abstract class BaseWebToken implements WebToken { return this._address; } + public async ready(): Promise { - this._address = this.wallet ? this.ownerToAddress(await this.getPublicKey()) : undefined; - } + if (this.wallet) { + this._address = await this.ownerToAddress(await this.getPublicKey()); + } else { + this._address = undefined; + } +} async price(): Promise { return getRedstonePrice(this.ticker); } abstract getTx(_txId: string): Promise; - abstract ownerToAddress(_owner: any): string; + abstract ownerToAddress(_owner: any): Promise; abstract sign(_data: Uint8Array): Promise; abstract getSigner(): Signer; abstract verify(_pub: any, _data: Uint8Array, _signature: Uint8Array): Promise; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3a8b089..658cab4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -126,6 +126,9 @@ importers: '@irys/upload-solana': specifier: workspace:^ version: link:../../packages/solana-node + '@irys/upload-starknet-node': + specifier: workspace:^ + version: link:../../packages/starknet-node '@irys/web-upload': specifier: workspace:^ version: link:../../packages/upload-web @@ -149,7 +152,7 @@ importers: version: link:../../../packages/ethereum-web ethers: specifier: ^5.7.2 - version: 5.7.2 + version: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) next: specifier: 14.2.7 version: 14.2.7(@babel/core@7.25.2)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -631,6 +634,31 @@ importers: specifier: ^6.1.3 version: 6.1.3(@ava/typescript@5.0.0) + packages/starknet-node: + dependencies: + '@irys/bundles': + specifier: ^0.0.2 + version: 0.0.2(arweave@1.15.1)(bufferutil@4.0.8)(utf-8-validate@5.0.10) + '@irys/upload': + specifier: workspace:^ + version: link:../upload-node + '@irys/upload-core': + specifier: workspace:^ + version: link:../upload-core + bignumber.js: + specifier: ^9.1.2 + version: 9.1.2 + starknet: + specifier: ^6.17.0 + version: 6.17.0 + devDependencies: + '@ava/typescript': + specifier: ^5.0.0 + version: 5.0.0 + ava: + specifier: ^6.1.3 + version: 6.1.3(@ava/typescript@5.0.0) + packages/upload-core: dependencies: '@irys/bundles': @@ -1597,6 +1625,9 @@ packages: '@irys/bundles@0.0.1': resolution: {integrity: sha512-yeQNzElERksFbfbNxJQsMkhtkI3+tNqIMZ/Wwxh76NVBmCnCP5huefOv7ET0MOO7TEQL+TqvKSqmFklYSvTyHw==} + '@irys/bundles@0.0.2': + resolution: {integrity: sha512-reLAQFYQ6zFvu1QS38fGyIHYWa5LNnoxWQLAtXnQBHw4ULlquGXKijuA2fz7TqkoYYbMMD2zhb5VwHuUX5FiQg==} + '@irys/query@0.0.9': resolution: {integrity: sha512-uBIy8qeOQupUSBzR+1KU02JJXFp5Ue9l810PIbBF/ylUB8RTreUFkyyABZ7J3FUaOIXFYrT7WVFSJSzXM7P+8w==} engines: {node: '>=16.10.0'} @@ -1706,6 +1737,9 @@ packages: '@noble/curves@1.2.0': resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} + '@noble/curves@1.3.0': + resolution: {integrity: sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA==} + '@noble/curves@1.4.0': resolution: {integrity: sha512-p+4cb332SFCrReJkCYe8Xzm0OWi4Jji5jVdIZRL/PmacmDkFNw6MrrV+gGpiPxLHbV+zKFRywUWbaseT+tZRXg==} @@ -1723,6 +1757,10 @@ packages: resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} engines: {node: '>= 16'} + '@noble/hashes@1.3.3': + resolution: {integrity: sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==} + engines: {node: '>= 16'} + '@noble/hashes@1.4.0': resolution: {integrity: sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==} engines: {node: '>= 16'} @@ -1958,6 +1996,9 @@ packages: '@scure/bip39@1.4.0': resolution: {integrity: sha512-BEEm6p8IueV/ZTfQLp/0vhw4NPnT9oWf5+28nvmeUICjP99f4vr2d+qc7AVGDDtwRep6ifR43Yed9ERVmiITzw==} + '@scure/starknet@1.0.0': + resolution: {integrity: sha512-o5J57zY0f+2IL/mq8+AYJJ4Xpc1fOtDhr+mFQKbHnYFmm3WQrC+8zj2HEgxak1a+x86mhmBC1Kq305KUpVf0wg==} + '@shikijs/core@1.16.1': resolution: {integrity: sha512-aI0hBtw+a6KsJp2jcD4YuQqKpeCbURMZbhHVozDknJpm+KJqeMRkEnfBC8BaKE/5XC+uofPgCLsa/TkTk0Ba0w==} @@ -2082,6 +2123,9 @@ packages: '@solana/web3.js@1.95.3': resolution: {integrity: sha512-O6rPUN0w2fkNqx/Z3QJMB9L225Ex10PRDH8bTaIUPZXMPV0QP8ZpPvjQnXK+upUczlRgzHzd6SjKIha1p+I6og==} + '@starknet-io/types-js@0.7.7': + resolution: {integrity: sha512-WLrpK7LIaIb8Ymxu6KF/6JkGW1sso988DweWu7p5QY/3y7waBIiPvzh27D9bX5KIJNRDyOoOVoHVEKYUYWZ/RQ==} + '@supercharge/promise-pool@3.2.0': resolution: {integrity: sha512-pj0cAALblTZBPtMltWOlZTQSLT07jIaFNeM8TWoJD1cQMgDB9mcMlVMoetiB35OzNJpqQ2b+QEtwiR9f20mADg==} engines: {node: '>=8'} @@ -2347,6 +2391,10 @@ packages: abbrev@1.1.1: resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} + abi-wan-kanabi@2.2.3: + resolution: {integrity: sha512-JlqiAl9CPvTm5kKG0QXmVCWNWoC/XyRMOeT77cQlbxXWllgjf6SqUmaNqFon72C2o5OSZids+5FvLdsw6dvWaw==} + hasBin: true + abitype@1.0.5: resolution: {integrity: sha512-YzDhti7cjlfaBhHutMaboYB21Ha3rXR9QTkNJFzYC4kC8YclaiwPBBBJY8ejFdu2wnJeZCVZSMlQJ7fi8S6hsw==} peerDependencies: @@ -2442,6 +2490,9 @@ packages: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} + ansicolors@0.3.2: + resolution: {integrity: sha512-QXu7BPrP29VllRxH8GwB7x5iX5qWKAAMLqKQGWTeLWVlNHNOpVMJ91dsxQAIWXpjuW5wqvxu3Jd/nRjrJ+0pqg==} + any-promise@1.3.0: resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} @@ -2729,6 +2780,10 @@ packages: caniuse-lite@1.0.30001655: resolution: {integrity: sha512-jRGVy3iSGO5Uutn2owlb5gR6qsGngTw9ZTb4ali9f3glshcNmJ2noam4Mo9zia5P9Dk3jNNydy7vQjuE5dQmfg==} + cardinal@2.1.1: + resolution: {integrity: sha512-JSr5eOgoEymtYHBjNWyjrMqet9Am2miJhlfKNdqLp6zoeAh0KN5dRAcxlecj5mAJrmQomgiOBj35xHLrFjqBpw==} + hasBin: true + cbor@9.0.2: resolution: {integrity: sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==} engines: {node: '>=16'} @@ -3361,6 +3416,9 @@ packages: fastq@1.17.1: resolution: {integrity: sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==} + fetch-cookie@3.0.1: + resolution: {integrity: sha512-ZGXe8Y5Z/1FWqQ9q/CrJhkUD73DyBU9VF0hBQmEO/wPHe4A9PKTjplFDLeFX8aOsYypZUcX5Ji/eByn3VCVO3Q==} + figures@3.2.0: resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} engines: {node: '>=8'} @@ -3434,6 +3492,10 @@ packages: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} engines: {node: '>= 6'} + fs-extra@10.1.0: + resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} + engines: {node: '>=12'} + fs-extra@11.2.0: resolution: {integrity: sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==} engines: {node: '>=14.14'} @@ -3869,6 +3931,9 @@ packages: isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + isomorphic-fetch@3.0.0: + resolution: {integrity: sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==} + isomorphic-ws@4.0.1: resolution: {integrity: sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==} peerDependencies: @@ -4061,6 +4126,9 @@ packages: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true + lossless-json@4.0.2: + resolution: {integrity: sha512-+z0EaLi2UcWi8MZRxA5iTb6m4Ys4E80uftGY+yG5KNFJb5EceQXOhdW/pWJZ8m97s26u7yZZAYMcKWNztSZssA==} + lowercase-keys@2.0.0: resolution: {integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==} engines: {node: '>=8'} @@ -4403,6 +4471,9 @@ packages: package-json-from-dist@1.0.0: resolution: {integrity: sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==} + pako@2.1.0: + resolution: {integrity: sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==} + parent-module@1.0.1: resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} engines: {node: '>=6'} @@ -4591,6 +4662,9 @@ packages: pseudomap@1.0.2: resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} + psl@1.9.0: + resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} + pump@3.0.0: resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} @@ -4602,6 +4676,9 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} + querystringify@2.2.0: + resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==} + queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -4647,6 +4724,9 @@ packages: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} + redeyed@2.1.1: + resolution: {integrity: sha512-FNpGGo1DycYAdnrKFxCMmKYgo/mILAqtRYbkdQD8Ep/Hk2PQ5+aEAEx+IU713RTDmuBaH0c8P5ZozurNu5ObRQ==} + reflect.getprototypeof@1.0.6: resolution: {integrity: sha512-fmfw4XgoDke3kdI6h4xcUz1dG8uaiv5q9gcEwLS4Pnth2kxT+GZ7YehS1JTMGBQmtV7Y4GFGbs2re2NqhdozUg==} engines: {node: '>= 0.4'} @@ -4686,6 +4766,9 @@ packages: require-relative@0.8.7: resolution: {integrity: sha512-AKGr4qvHiryxRb19m3PsLRGuKVAbJLUD7E6eOaHkfKhwc+vSgVOCY5xNvm9EkolBKTOf0GrQAZKLimOCz81Khg==} + requires-port@1.0.0: + resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} + resolve-alpn@1.2.1: resolution: {integrity: sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==} @@ -4810,6 +4893,9 @@ packages: set-blocking@2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + set-cookie-parser@2.7.1: + resolution: {integrity: sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==} + set-function-length@1.2.2: resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} engines: {node: '>= 0.4'} @@ -4890,6 +4976,9 @@ packages: resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} engines: {node: '>=10'} + starknet@6.17.0: + resolution: {integrity: sha512-ZzqurYL8+Y0pnIXXvxnMc+8we4jhwH/qFG5tOkaAgWSPyTR44qbBjHSOMNO1eRAmkVg9IEdiBVaG5vTpiF8kTQ==} + stop-iteration-iterator@1.0.0: resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==} engines: {node: '>= 0.4'} @@ -5073,6 +5162,10 @@ packages: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} + tough-cookie@4.1.4: + resolution: {integrity: sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==} + engines: {node: '>=6'} + tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} @@ -5089,6 +5182,9 @@ packages: ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + ts-mixer@6.0.4: + resolution: {integrity: sha512-ufKpbmrugz5Aou4wcr5Wc1UUFWOLhq+Fm6qa6P0w0K5Qw2yhaUoiWszhCVuNQyNwrlGiscHOmqYoAox1PtvgjA==} + ts-node@10.9.2: resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} hasBin: true @@ -5238,6 +5334,10 @@ packages: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} + universalify@0.2.0: + resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==} + engines: {node: '>= 4.0.0'} + universalify@2.0.1: resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} engines: {node: '>= 10.0.0'} @@ -5251,6 +5351,9 @@ packages: uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + url-parse@1.5.10: + resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==} + utf-8-validate@5.0.10: resolution: {integrity: sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==} engines: {node: '>=6.14.2'} @@ -5295,6 +5398,9 @@ packages: resolution: {integrity: sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==} engines: {node: '>=6'} + whatwg-fetch@3.6.20: + resolution: {integrity: sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg==} + whatwg-url@5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} @@ -6831,6 +6937,34 @@ snapshots: - encoding - utf-8-validate + '@irys/bundles@0.0.2(arweave@1.15.1)(bufferutil@4.0.8)(utf-8-validate@5.0.10)': + dependencies: + '@ethersproject/bytes': 5.7.0 + '@ethersproject/hash': 5.7.0 + '@ethersproject/providers': 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) + '@ethersproject/signing-key': 5.7.0 + '@ethersproject/transactions': 5.7.0 + '@ethersproject/wallet': 5.7.0 + '@irys/arweave': 0.0.2 + '@noble/ed25519': 1.7.3 + base64url: 3.0.1 + bs58: 4.0.1 + keccak: 3.0.4 + secp256k1: 5.0.0 + starknet: 6.17.0 + optionalDependencies: + '@randlabs/myalgo-connect': 1.4.2 + algosdk: 1.24.1 + arweave-stream-tx: 1.2.2(arweave@1.15.1) + multistream: 4.1.0 + tmp-promise: 3.0.3 + transitivePeerDependencies: + - arweave + - bufferutil + - debug + - encoding + - utf-8-validate + '@irys/query@0.0.9': dependencies: async-retry: 1.3.3 @@ -6946,6 +7080,10 @@ snapshots: dependencies: '@noble/hashes': 1.3.2 + '@noble/curves@1.3.0': + dependencies: + '@noble/hashes': 1.3.3 + '@noble/curves@1.4.0': dependencies: '@noble/hashes': 1.4.0 @@ -6960,6 +7098,8 @@ snapshots: '@noble/hashes@1.3.2': {} + '@noble/hashes@1.3.3': {} + '@noble/hashes@1.4.0': {} '@noble/hashes@1.5.0': {} @@ -7152,6 +7292,11 @@ snapshots: '@noble/hashes': 1.5.0 '@scure/base': 1.1.8 + '@scure/starknet@1.0.0': + dependencies: + '@noble/curves': 1.3.0 + '@noble/hashes': 1.3.3 + '@shikijs/core@1.16.1': dependencies: '@shikijs/vscode-textmate': 9.2.0 @@ -7347,6 +7492,8 @@ snapshots: - encoding - utf-8-validate + '@starknet-io/types-js@0.7.7': {} + '@supercharge/promise-pool@3.2.0': {} '@swc/counter@0.1.3': {} @@ -7685,6 +7832,13 @@ snapshots: abbrev@1.1.1: {} + abi-wan-kanabi@2.2.3: + dependencies: + ansicolors: 0.3.2 + cardinal: 2.1.1 + fs-extra: 10.1.0 + yargs: 17.7.2 + abitype@1.0.5(typescript@5.5.4): optionalDependencies: typescript: 5.5.4 @@ -7769,6 +7923,8 @@ snapshots: ansi-styles@6.2.1: {} + ansicolors@0.3.2: {} + any-promise@1.3.0: {} anymatch@3.1.3: @@ -8139,6 +8295,11 @@ snapshots: caniuse-lite@1.0.30001655: {} + cardinal@2.1.1: + dependencies: + ansicolors: 0.3.2 + redeyed: 2.1.1 + cbor@9.0.2: dependencies: nofilter: 3.1.0 @@ -8659,8 +8820,8 @@ snapshots: '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.5.4) eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-import: 2.30.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0)(eslint@8.57.0) + eslint-plugin-import: 2.30.0(@typescript-eslint/parser@8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4))(eslint@8.57.0) eslint-plugin-jsx-a11y: 6.10.0(eslint@8.57.0) eslint-plugin-react: 7.35.2(eslint@8.57.0) eslint-plugin-react-hooks: 4.6.2(eslint@8.57.0) @@ -8679,37 +8840,47 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0): + eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0)(eslint@8.57.0): dependencies: '@nolyfill/is-core-module': 1.0.39 debug: 4.3.6 enhanced-resolve: 5.17.1 eslint: 8.57.0 - eslint-module-utils: 2.9.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.9.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0)(eslint@8.57.0))(eslint@8.57.0) fast-glob: 3.3.2 get-tsconfig: 4.8.0 is-bun-module: 1.1.0 is-glob: 4.0.3 optionalDependencies: - eslint-plugin-import: 2.30.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-plugin-import: 2.30.0(@typescript-eslint/parser@8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4))(eslint@8.57.0) transitivePeerDependencies: - '@typescript-eslint/parser' - eslint-import-resolver-node - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.9.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): + eslint-module-utils@2.9.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0)(eslint@8.57.0))(eslint@8.57.0): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.5.4) eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0) + eslint-import-resolver-typescript: 3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0)(eslint@8.57.0) transitivePeerDependencies: - supports-color - eslint-plugin-import@2.30.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): + eslint-module-utils@2.9.0(@typescript-eslint/parser@8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint@8.57.0): + dependencies: + debug: 3.2.7 + optionalDependencies: + '@typescript-eslint/parser': 8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) + eslint: 8.57.0 + eslint-import-resolver-node: 0.3.9 + transitivePeerDependencies: + - supports-color + + eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4))(eslint@8.57.0): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.8 @@ -8720,7 +8891,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.9.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.30.0(@typescript-eslint/parser@8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.9.0(@typescript-eslint/parser@8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint@8.57.0) hasown: 2.0.2 is-core-module: 2.15.1 is-glob: 4.0.3 @@ -8731,7 +8902,7 @@ snapshots: semver: 6.3.1 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/parser': 8.4.0(eslint@9.9.1(jiti@1.21.6))(typescript@5.5.4) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -8916,7 +9087,7 @@ snapshots: esutils@2.0.3: {} - ethers@5.7.2: + ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10): dependencies: '@ethersproject/abi': 5.7.0 '@ethersproject/abstract-provider': 5.7.0 @@ -9033,6 +9204,11 @@ snapshots: dependencies: reusify: 1.0.4 + fetch-cookie@3.0.1: + dependencies: + set-cookie-parser: 2.7.1 + tough-cookie: 4.1.4 + figures@3.2.0: dependencies: escape-string-regexp: 1.0.5 @@ -9109,6 +9285,12 @@ snapshots: combined-stream: 1.0.8 mime-types: 2.1.35 + fs-extra@10.1.0: + dependencies: + graceful-fs: 4.2.11 + jsonfile: 6.1.0 + universalify: 2.0.1 + fs-extra@11.2.0: dependencies: graceful-fs: 4.2.11 @@ -9566,6 +9748,13 @@ snapshots: isexe@2.0.0: {} + isomorphic-fetch@3.0.0: + dependencies: + node-fetch: 2.7.0 + whatwg-fetch: 3.6.20 + transitivePeerDependencies: + - encoding + isomorphic-ws@4.0.1(ws@7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10)): dependencies: ws: 7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10) @@ -9763,6 +9952,8 @@ snapshots: dependencies: js-tokens: 4.0.0 + lossless-json@4.0.2: {} + lowercase-keys@2.0.0: {} lru-cache@10.4.3: {} @@ -10086,6 +10277,8 @@ snapshots: package-json-from-dist@1.0.0: {} + pako@2.1.0: {} + parent-module@1.0.1: dependencies: callsites: 3.1.0 @@ -10251,6 +10444,8 @@ snapshots: pseudomap@1.0.2: {} + psl@1.9.0: {} + pump@3.0.0: dependencies: end-of-stream: 1.4.4 @@ -10260,6 +10455,8 @@ snapshots: punycode@2.3.1: {} + querystringify@2.2.0: {} + queue-microtask@1.2.3: {} quick-lru@5.1.1: {} @@ -10307,6 +10504,10 @@ snapshots: dependencies: picomatch: 2.3.1 + redeyed@2.1.1: + dependencies: + esprima: 4.0.1 + reflect.getprototypeof@1.0.6: dependencies: call-bind: 1.0.7 @@ -10355,6 +10556,8 @@ snapshots: require-relative@0.8.7: {} + requires-port@1.0.0: {} + resolve-alpn@1.2.1: {} resolve-cwd@3.0.0: @@ -10501,6 +10704,8 @@ snapshots: set-blocking@2.0.0: {} + set-cookie-parser@2.7.1: {} + set-function-length@1.2.2: dependencies: define-data-property: 1.1.4 @@ -10581,6 +10786,22 @@ snapshots: dependencies: escape-string-regexp: 2.0.0 + starknet@6.17.0: + dependencies: + '@noble/curves': 1.3.0 + '@noble/hashes': 1.3.2 + '@scure/base': 1.1.8 + '@scure/starknet': 1.0.0 + abi-wan-kanabi: 2.2.3 + fetch-cookie: 3.0.1 + isomorphic-fetch: 3.0.0 + lossless-json: 4.0.2 + pako: 2.1.0 + starknet-types-07: '@starknet-io/types-js@0.7.7' + ts-mixer: 6.0.4 + transitivePeerDependencies: + - encoding + stop-iteration-iterator@1.0.0: dependencies: internal-slot: 1.0.7 @@ -10801,6 +11022,13 @@ snapshots: dependencies: is-number: 7.0.0 + tough-cookie@4.1.4: + dependencies: + psl: 1.9.0 + punycode: 2.3.1 + universalify: 0.2.0 + url-parse: 1.5.10 + tr46@0.0.3: {} tree-kill@1.2.2: {} @@ -10811,6 +11039,8 @@ snapshots: ts-interface-checker@0.1.13: {} + ts-mixer@6.0.4: {} + ts-node@10.9.2(@types/node@20.16.4)(typescript@5.5.4): dependencies: '@cspotcode/source-map-support': 0.8.1 @@ -10983,6 +11213,8 @@ snapshots: universalify@0.1.2: {} + universalify@0.2.0: {} + universalify@2.0.1: {} update-browserslist-db@1.1.0(browserslist@4.23.3): @@ -10995,6 +11227,11 @@ snapshots: dependencies: punycode: 2.3.1 + url-parse@1.5.10: + dependencies: + querystringify: 2.2.0 + requires-port: 1.0.0 + utf-8-validate@5.0.10: dependencies: node-gyp-build: 4.8.2 @@ -11053,6 +11290,8 @@ snapshots: well-known-symbols@2.0.0: {} + whatwg-fetch@3.6.20: {} + whatwg-url@5.0.0: dependencies: tr46: 0.0.3