New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@coinbase/coinbase-sdk

Package Overview
Dependencies
Maintainers
0
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coinbase/coinbase-sdk - npm Package Compare versions

Comparing version 0.14.1 to 0.15.0

33

dist/coinbase/address/wallet_address.d.ts

@@ -7,3 +7,3 @@ import { ethers } from "ethers";

import { ContractInvocation } from "../contract_invocation";
import { Amount, CreateTransferOptions, CreateTradeOptions, CreateContractInvocationOptions, StakeOptionsMode, CreateERC20Options, CreateERC721Options, CreateERC1155Options, PaginationOptions, PaginationResponse, CreateFundOptions, CreateQuoteOptions } from "../types";
import { Amount, CreateTransferOptions, CreateTradeOptions, CreateContractInvocationOptions, StakeOptionsMode, CreateERC20Options, CreateERC721Options, CreateERC1155Options, PaginationOptions, PaginationResponse, CreateFundOptions, CreateQuoteOptions, CreateCustomContractOptions } from "../types";
import { StakingOperation } from "../staking_operation";

@@ -143,3 +143,3 @@ import { PayloadSignature } from "../payload_signature";

*/
deployToken({ name, symbol, totalSupply }: CreateERC20Options): Promise<SmartContract>;
deployToken({ name, symbol, totalSupply, }: CreateERC20Options): Promise<SmartContract>;
/**

@@ -166,2 +166,14 @@ * Deploys an ERC721 token contract.

/**
* Deploys a custom contract.
*
* @param options - The options for creating the custom contract.
* @param options.solidityVersion - The version of the solidity compiler, must be 0.8.+, such as "0.8.28+commit.7893614a". See https://binaries.soliditylang.org/bin/list.json
* @param options.solidityInputJson - The input json for the solidity compiler. See https://docs.soliditylang.org/en/latest/using-the-compiler.html#input-description for more details.
* @param options.contractName - The name of the contract class to be deployed.
* @param options.constructorArgs - The arguments for the constructor.
* @returns A Promise that resolves to the deployed SmartContract object.
* @throws {APIError} If the API request to create a smart contract fails.
*/
deployContract({ solidityVersion, solidityInputJson, contractName, constructorArgs, }: CreateCustomContractOptions): Promise<SmartContract>;
/**
* Creates an ERC20 token contract.

@@ -200,2 +212,15 @@ *

/**
* Creates a custom contract.
*
* @private
* @param {CreateCustomContractOptions} options - The options for creating the custom contract.
* @param {string} options.solidityVersion - The version of the solidity compiler, must be 0.8.+, such as "0.8.28+commit.7893614a". See https://binaries.soliditylang.org/bin/list.json
* @param {string} options.solidityInputJson - The input json for the solidity compiler. See https://docs.soliditylang.org/en/latest/using-the-compiler.html#input-description for more details.
* @param {string} options.contractName - The name of the contract class.
* @param {Record<string, any>} options.constructorArgs - The arguments for the constructor.
* @returns {Promise<SmartContract>} A Promise that resolves to the created SmartContract.
* @throws {APIError} If the API request to compile or subsequently create a smart contract fails.
*/
private createCustomContract;
/**
* Creates a contract invocation with the given data.

@@ -312,3 +337,3 @@ *

*/
fund({ amount, assetId, }: CreateFundOptions): Promise<FundOperation>;
fund({ amount, assetId }: CreateFundOptions): Promise<FundOperation>;
/**

@@ -322,3 +347,3 @@ * Get a quote for funding the address from your Coinbase platform account.

*/
quoteFund({ amount, assetId, }: CreateQuoteOptions): Promise<FundQuote>;
quoteFund({ amount, assetId }: CreateQuoteOptions): Promise<FundQuote>;
/**

@@ -325,0 +350,0 @@ * Returns all the fund operations associated with the address.

@@ -278,3 +278,3 @@ "use strict";

*/
async deployToken({ name, symbol, totalSupply }) {
async deployToken({ name, symbol, totalSupply, }) {
if (!coinbase_1.Coinbase.useServerSigner && !this.key) {

@@ -334,2 +334,30 @@ throw new Error("Cannot deploy ERC20 without private key loaded");

/**
* Deploys a custom contract.
*
* @param options - The options for creating the custom contract.
* @param options.solidityVersion - The version of the solidity compiler, must be 0.8.+, such as "0.8.28+commit.7893614a". See https://binaries.soliditylang.org/bin/list.json
* @param options.solidityInputJson - The input json for the solidity compiler. See https://docs.soliditylang.org/en/latest/using-the-compiler.html#input-description for more details.
* @param options.contractName - The name of the contract class to be deployed.
* @param options.constructorArgs - The arguments for the constructor.
* @returns A Promise that resolves to the deployed SmartContract object.
* @throws {APIError} If the API request to create a smart contract fails.
*/
async deployContract({ solidityVersion, solidityInputJson, contractName, constructorArgs, }) {
if (!coinbase_1.Coinbase.useServerSigner && !this.key) {
throw new Error("Cannot deploy custom contract without private key loaded");
}
const smartContract = await this.createCustomContract({
solidityVersion,
solidityInputJson,
contractName,
constructorArgs,
});
if (coinbase_1.Coinbase.useServerSigner) {
return smartContract;
}
await smartContract.sign(this.getSigner());
await smartContract.broadcast();
return smartContract;
}
/**
* Creates an ERC20 token contract.

@@ -345,3 +373,3 @@ *

*/
async createERC20({ name, symbol, totalSupply }) {
async createERC20({ name, symbol, totalSupply, }) {
const resp = await coinbase_1.Coinbase.apiClients.smartContract.createSmartContract(this.getWalletId(), this.getId(), {

@@ -367,3 +395,3 @@ type: client_1.SmartContractType.Erc20,

*/
async createERC721({ name, symbol, baseURI }) {
async createERC721({ name, symbol, baseURI, }) {
const resp = await coinbase_1.Coinbase.apiClients.smartContract.createSmartContract(this.getWalletId(), this.getId(), {

@@ -398,2 +426,29 @@ type: client_1.SmartContractType.Erc721,

/**
* Creates a custom contract.
*
* @private
* @param {CreateCustomContractOptions} options - The options for creating the custom contract.
* @param {string} options.solidityVersion - The version of the solidity compiler, must be 0.8.+, such as "0.8.28+commit.7893614a". See https://binaries.soliditylang.org/bin/list.json
* @param {string} options.solidityInputJson - The input json for the solidity compiler. See https://docs.soliditylang.org/en/latest/using-the-compiler.html#input-description for more details.
* @param {string} options.contractName - The name of the contract class.
* @param {Record<string, any>} options.constructorArgs - The arguments for the constructor.
* @returns {Promise<SmartContract>} A Promise that resolves to the created SmartContract.
* @throws {APIError} If the API request to compile or subsequently create a smart contract fails.
*/
async createCustomContract({ solidityVersion, solidityInputJson, contractName, constructorArgs, }) {
const compileContractResp = await coinbase_1.Coinbase.apiClients.smartContract.compileSmartContract({
solidity_compiler_version: solidityVersion,
solidity_input_json: solidityInputJson,
contract_name: contractName,
});
const compiledContract = compileContractResp.data;
const compiledContractId = compiledContract.compiled_smart_contract_id;
const createContractResp = await coinbase_1.Coinbase.apiClients.smartContract.createSmartContract(this.getWalletId(), this.getId(), {
type: client_1.SmartContractType.Custom,
options: JSON.stringify(constructorArgs),
compiled_smart_contract_id: compiledContractId,
});
return smart_contract_1.SmartContract.fromModel(createContractResp?.data);
}
/**
* Creates a contract invocation with the given data.

@@ -559,3 +614,3 @@ *

*/
async fund({ amount, assetId, }) {
async fund({ amount, assetId }) {
const normalizedAmount = new decimal_js_1.Decimal(amount.toString());

@@ -572,3 +627,3 @@ return fund_operation_1.FundOperation.create(this.getWalletId(), this.getId(), normalizedAmount, assetId, this.getNetworkId());

*/
async quoteFund({ amount, assetId, }) {
async quoteFund({ amount, assetId }) {
const normalizedAmount = new decimal_js_1.Decimal(amount.toString());

@@ -575,0 +630,0 @@ return fund_quote_1.FundQuote.create(this.getWalletId(), this.getId(), normalizedAmount, assetId, this.getNetworkId());

@@ -191,2 +191,10 @@ import { ethers } from "ethers";

private isERC721;
/**
* Type guard for checking if the smart contract is an ERC1155.
*
* @param type - The type of the smart contract.
* @param options - The options of the smart contract.
* @returns True if the smart contract is an ERC1155, false otherwise.
*/
private isERC1155;
}

@@ -211,3 +211,3 @@ "use strict";

}
else {
else if (this.isERC1155(this.getType(), options)) {
return {

@@ -217,2 +217,5 @@ uri: options.uri,

}
else {
return options;
}
}

@@ -349,3 +352,13 @@ /**

}
/**
* Type guard for checking if the smart contract is an ERC1155.
*
* @param type - The type of the smart contract.
* @param options - The options of the smart contract.
* @returns True if the smart contract is an ERC1155, false otherwise.
*/
isERC1155(type, options) {
return type === types_1.SmartContractType.ERC1155;
}
}
exports.SmartContract = SmartContract;
import { Decimal } from "decimal.js";
import { AxiosPromise, AxiosRequestConfig, RawAxiosRequestConfig } from "axios";
import { Address as AddressModel, AddressList, AddressBalanceList, AddressHistoricalBalanceList, Balance, CreateAddressRequest, CreateWalletRequest, BroadcastTransferRequest, CreateTransferRequest, TransferList, Wallet as WalletModel, Transfer as TransferModel, Trade as TradeModel, Asset as AssetModel, WalletList, TradeList as TradeListModel, CreateTradeRequest, BroadcastTradeRequest, ServerSignerList, BuildStakingOperationRequest, StakingOperation as StakingOperationModel, GetStakingContextRequest, StakingContext as StakingContextModel, FetchStakingRewardsRequest, FetchStakingRewards200Response, FetchHistoricalStakingBalances200Response, FaucetTransaction, BroadcastStakingOperationRequest, CreateStakingOperationRequest, ValidatorList, Validator, ValidatorStatus as APIValidatorStatus, Webhook as WebhookModel, WebhookList, CreateWebhookRequest, UpdateWebhookRequest, ContractEventList, CreatePayloadSignatureRequest, PayloadSignature as PayloadSignatureModel, PayloadSignatureList, WebhookEventType, WebhookEventFilter, AddressTransactionList, BroadcastContractInvocationRequest, CreateContractInvocationRequest, ContractInvocationList, ContractInvocation as ContractInvocationModel, SmartContractList, CreateSmartContractRequest, SmartContract as SmartContractModel, FundOperation as FundOperationModel, FundQuote as FundQuoteModel, DeploySmartContractRequest, WebhookEventTypeFilter, CreateWalletWebhookRequest, ReadContractRequest, SolidityValue, FundOperationList, CreateFundOperationRequest, CreateFundQuoteRequest, AddressReputation, RegisterSmartContractRequest, UpdateSmartContractRequest } from "./../client/api";
import { Address as AddressModel, AddressList, AddressBalanceList, AddressHistoricalBalanceList, Balance, CreateAddressRequest, CreateWalletRequest, BroadcastTransferRequest, CreateTransferRequest, TransferList, Wallet as WalletModel, Transfer as TransferModel, Trade as TradeModel, Asset as AssetModel, WalletList, TradeList as TradeListModel, CreateTradeRequest, BroadcastTradeRequest, ServerSignerList, BuildStakingOperationRequest, StakingOperation as StakingOperationModel, GetStakingContextRequest, StakingContext as StakingContextModel, FetchStakingRewardsRequest, FetchStakingRewards200Response, FetchHistoricalStakingBalances200Response, FaucetTransaction, BroadcastStakingOperationRequest, CreateStakingOperationRequest, ValidatorList, Validator, ValidatorStatus as APIValidatorStatus, Webhook as WebhookModel, WebhookList, CreateWebhookRequest, UpdateWebhookRequest, ContractEventList, CreatePayloadSignatureRequest, PayloadSignature as PayloadSignatureModel, PayloadSignatureList, WebhookEventType, WebhookEventFilter, AddressTransactionList, BroadcastContractInvocationRequest, CreateContractInvocationRequest, ContractInvocationList, ContractInvocation as ContractInvocationModel, SmartContractList, CreateSmartContractRequest, SmartContract as SmartContractModel, FundOperation as FundOperationModel, FundQuote as FundQuoteModel, DeploySmartContractRequest, WebhookEventTypeFilter, CreateWalletWebhookRequest, ReadContractRequest, SolidityValue, FundOperationList, CreateFundOperationRequest, CreateFundQuoteRequest, AddressReputation, RegisterSmartContractRequest, UpdateSmartContractRequest, CompileSmartContractRequest, CompiledSmartContract } from "./../client/api";
import { Address } from "./address";

@@ -711,3 +711,3 @@ import { Wallet } from "./wallet";

*/
export type SmartContractOptions = NFTContractOptions | TokenContractOptions | MultiTokenContractOptions;
export type SmartContractOptions = NFTContractOptions | TokenContractOptions | MultiTokenContractOptions | string;
/**

@@ -765,2 +765,15 @@ * Options for creating a Transfer.

/**
* Options for creating an arbitrary contract.
*/
export type CreateCustomContractOptions = {
/** The version of the solidity compiler, must be 0.8.+, such as "0.8.28+commit.7893614a". See https://binaries.soliditylang.org/bin/list.json */
solidityVersion: string;
/** The input json for the solidity compiler. See https://docs.soliditylang.org/en/latest/using-the-compiler.html#input-description for more details. */
solidityInputJson: string;
/** The name of the contract class to be deployed. */
contractName: string;
/** The arguments for the constructor. */
constructorArgs: Record<string, any>;
};
/**
* Options for creating a fund operation.

@@ -1019,2 +1032,11 @@ */

/**
* Compiles a custom contract.
*
* @param compileSmartContractRequest - The request body containing the compile smart contract details.
* @param options - Axios request options.
* @returns - A promise resolving to the compiled smart contract.
* @throws {APIError} If the request fails.
*/
compileSmartContract(compileSmartContractRequest: CompileSmartContractRequest, options?: RawAxiosRequestConfig): AxiosPromise<CompiledSmartContract>;
/**
* Creates a new Smart Contract.

@@ -1021,0 +1043,0 @@ *

@@ -9,3 +9,3 @@ import Decimal from "decimal.js";

import { Transfer } from "./transfer";
import { Amount, StakingRewardFormat, CreateContractInvocationOptions, CreateTransferOptions, CreateTradeOptions, ServerSignerStatus, StakeOptionsMode, WalletCreateOptions, WalletData, MnemonicSeedPhrase, CreateERC20Options, CreateERC721Options, CreateERC1155Options, PaginationOptions, PaginationResponse, CreateFundOptions, CreateQuoteOptions } from "./types";
import { Amount, StakingRewardFormat, CreateContractInvocationOptions, CreateTransferOptions, CreateTradeOptions, ServerSignerStatus, StakeOptionsMode, WalletCreateOptions, WalletData, MnemonicSeedPhrase, CreateERC20Options, CreateERC721Options, CreateERC1155Options, PaginationOptions, PaginationResponse, CreateFundOptions, CreateQuoteOptions, CreateCustomContractOptions } from "./types";
import { StakingOperation } from "./staking_operation";

@@ -457,2 +457,14 @@ import { StakingReward } from "./staking_reward";

/**
* Deploys a custom contract.
*
* @param options - The options for creating the custom contract.
* @param options.solidityVersion - The version of the solidity compiler, must be 0.8.+, such as "0.8.28+commit.7893614a". See https://binaries.soliditylang.org/bin/list.json
* @param options.solidityInputJson - The input json for the solidity compiler. See https://docs.soliditylang.org/en/latest/using-the-compiler.html#input-description for more details.
* @param options.contractName - The name of the contract class to be deployed.
* @param options.constructorArgs - The arguments for the constructor.
* @returns A Promise that resolves to the deployed SmartContract object.
* @throws {Error} If the private key is not loaded when not using server signer.
*/
deployContract(options: CreateCustomContractOptions): Promise<SmartContract>;
/**
* Fund the wallet from your account on the Coinbase Platform.

@@ -459,0 +471,0 @@ *

@@ -759,2 +759,16 @@ "use strict";

/**
* Deploys a custom contract.
*
* @param options - The options for creating the custom contract.
* @param options.solidityVersion - The version of the solidity compiler, must be 0.8.+, such as "0.8.28+commit.7893614a". See https://binaries.soliditylang.org/bin/list.json
* @param options.solidityInputJson - The input json for the solidity compiler. See https://docs.soliditylang.org/en/latest/using-the-compiler.html#input-description for more details.
* @param options.contractName - The name of the contract class to be deployed.
* @param options.constructorArgs - The arguments for the constructor.
* @returns A Promise that resolves to the deployed SmartContract object.
* @throws {Error} If the private key is not loaded when not using server signer.
*/
async deployContract(options) {
return (await this.getDefaultAddress()).deployContract(options);
}
/**
* Fund the wallet from your account on the Coinbase Platform.

@@ -761,0 +775,0 @@ *

4

dist/tests/authenticator_test.js

@@ -48,4 +48,4 @@ "use strict";

describe("when a source version is provided", () => {
beforeAll(() => sourceVersion = "1.0.0");
afterAll(() => sourceVersion = undefined);
beforeAll(() => (sourceVersion = "1.0.0"));
afterAll(() => (sourceVersion = undefined));
it("includes the source version in the correlation context", async () => {

@@ -52,0 +52,0 @@ const config = await authenticator.authenticateRequest(VALID_CONFIG, true);

/// <reference types="jest" />
import { AxiosInstance } from "axios";
import { Configuration, Wallet as WalletModel, Balance as BalanceModel, AddressBalanceList, Address as AddressModel, Transfer as TransferModel, FaucetTransaction as FaucetTransactionModel, StakingOperation as StakingOperationModel, PayloadSignature as PayloadSignatureModel, PayloadSignatureList, ContractInvocation as ContractInvocationModel, SmartContract as SmartContractModel, CryptoAmount as CryptoAmountModel, Asset as AssetModel, FundQuote as FundQuoteModel, FundOperation as FundOperationModel, ValidatorList, Validator, StakingOperationStatusEnum, ValidatorStatus } from "../client";
import { Configuration, Wallet as WalletModel, Balance as BalanceModel, AddressBalanceList, Address as AddressModel, Transfer as TransferModel, FaucetTransaction as FaucetTransactionModel, StakingOperation as StakingOperationModel, PayloadSignature as PayloadSignatureModel, CompiledSmartContract as CompiledSmartContractModel, PayloadSignatureList, ContractInvocation as ContractInvocationModel, SmartContract as SmartContractModel, CryptoAmount as CryptoAmountModel, Asset as AssetModel, FundQuote as FundQuoteModel, FundOperation as FundOperationModel, ValidatorList, Validator, StakingOperationStatusEnum, ValidatorStatus } from "../client";
import { HDKey } from "@scure/bip32";

@@ -61,2 +61,4 @@ export declare const mockFn: (...args: any[]) => any;

export declare const VALID_SMART_CONTRACT_ERC1155_MODEL: SmartContractModel;
export declare const VALID_COMPILED_CONTRACT_MODEL: CompiledSmartContractModel;
export declare const VALID_SMART_CONTRACT_CUSTOM_MODEL: SmartContractModel;
export declare const VALID_SMART_CONTRACT_EXTERNAL_MODEL: SmartContractModel;

@@ -181,2 +183,3 @@ export declare const VALID_USDC_CRYPTO_AMOUNT_MODEL: CryptoAmountModel;

export declare const smartContractApiMock: {
compileSmartContract: jest.Mock<any, any, any>;
createSmartContract: jest.Mock<any, any, any>;

@@ -183,0 +186,0 @@ deploySmartContract: jest.Mock<any, any, any>;

@@ -6,4 +6,4 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.createAxiosMock = exports.getAssetMock = exports.VALID_BALANCE_MODEL = exports.VALID_EXITING_VALIDATOR_LIST = exports.VALID_ACTIVE_VALIDATOR_LIST = exports.mockEthereumValidator = exports.VALID_ADDRESS_BALANCE_LIST = exports.VALID_NATIVE_ETH_UNSTAKE_OPERATION_MODEL = exports.mockStakingOperation = exports.VALID_FUND_OPERATION_MODEL = exports.VALID_FUND_QUOTE_MODEL = exports.VALID_ASSET_MODEL = exports.VALID_ETH_CRYPTO_AMOUNT_MODEL = exports.VALID_USDC_CRYPTO_AMOUNT_MODEL = exports.VALID_SMART_CONTRACT_EXTERNAL_MODEL = exports.VALID_SMART_CONTRACT_ERC1155_MODEL = exports.ERC1155_URI = exports.VALID_SMART_CONTRACT_ERC721_MODEL = exports.ERC721_BASE_URI = exports.ERC721_SYMBOL = exports.ERC721_NAME = exports.VALID_EXTERNAL_SMART_CONTRACT_ERC20_MODEL = exports.VALID_SMART_CONTRACT_ERC20_MODEL = exports.ERC20_TOTAL_SUPPLY = exports.ERC20_SYMBOL = exports.ERC20_NAME = exports.VALID_SIGNED_CONTRACT_INVOCATION_MODEL = exports.VALID_CONTRACT_INVOCATION_MODEL = exports.VALID_FAUCET_TRANSACTION_MODEL = exports.MINT_NFT_ARGS = exports.MINT_NFT_ABI = exports.VALID_PAYLOAD_SIGNATURE_LIST = exports.VALID_SIGNED_PAYLOAD_SIGNATURE_MODEL = exports.VALID_PAYLOAD_SIGNATURE_MODEL = exports.VALID_STAKING_OPERATION_MODEL = exports.VALID_TRANSFER_SPONSORED_SEND_MODEL = exports.VALID_TRANSFER_MODEL = exports.VALID_WALLET_MODEL = exports.VALID_ADDRESS_MODEL = exports.newAddressModel = exports.generateRandomHash = exports.generateWalletFromSeed = exports.amount = exports.transferId = exports.walletId = exports.mockListAddress = exports.getAddressFromHDKey = exports.mockReturnRejectedValue = exports.mockReturnValue = exports.mockFn = void 0;
exports.testAllReadTypesABI = exports.reputationApiMock = exports.fundOperationsApiMock = exports.assetApiMock = exports.contractInvocationApiMock = exports.smartContractApiMock = exports.contractEventApiMock = exports.serverSignersApiMock = exports.transactionHistoryApiMock = exports.balanceHistoryApiMock = exports.externalAddressApiMock = exports.validatorApiMock = exports.walletStakeApiMock = exports.stakeApiMock = exports.transfersApiMock = exports.tradeApiMock = exports.addressesApiMock = exports.walletsApiMock = exports.assetsApiMock = exports.usersApiMock = void 0;
exports.VALID_BALANCE_MODEL = exports.VALID_EXITING_VALIDATOR_LIST = exports.VALID_ACTIVE_VALIDATOR_LIST = exports.mockEthereumValidator = exports.VALID_ADDRESS_BALANCE_LIST = exports.VALID_NATIVE_ETH_UNSTAKE_OPERATION_MODEL = exports.mockStakingOperation = exports.VALID_FUND_OPERATION_MODEL = exports.VALID_FUND_QUOTE_MODEL = exports.VALID_ASSET_MODEL = exports.VALID_ETH_CRYPTO_AMOUNT_MODEL = exports.VALID_USDC_CRYPTO_AMOUNT_MODEL = exports.VALID_SMART_CONTRACT_EXTERNAL_MODEL = exports.VALID_SMART_CONTRACT_CUSTOM_MODEL = exports.VALID_COMPILED_CONTRACT_MODEL = exports.VALID_SMART_CONTRACT_ERC1155_MODEL = exports.ERC1155_URI = exports.VALID_SMART_CONTRACT_ERC721_MODEL = exports.ERC721_BASE_URI = exports.ERC721_SYMBOL = exports.ERC721_NAME = exports.VALID_EXTERNAL_SMART_CONTRACT_ERC20_MODEL = exports.VALID_SMART_CONTRACT_ERC20_MODEL = exports.ERC20_TOTAL_SUPPLY = exports.ERC20_SYMBOL = exports.ERC20_NAME = exports.VALID_SIGNED_CONTRACT_INVOCATION_MODEL = exports.VALID_CONTRACT_INVOCATION_MODEL = exports.VALID_FAUCET_TRANSACTION_MODEL = exports.MINT_NFT_ARGS = exports.MINT_NFT_ABI = exports.VALID_PAYLOAD_SIGNATURE_LIST = exports.VALID_SIGNED_PAYLOAD_SIGNATURE_MODEL = exports.VALID_PAYLOAD_SIGNATURE_MODEL = exports.VALID_STAKING_OPERATION_MODEL = exports.VALID_TRANSFER_SPONSORED_SEND_MODEL = exports.VALID_TRANSFER_MODEL = exports.VALID_WALLET_MODEL = exports.VALID_ADDRESS_MODEL = exports.newAddressModel = exports.generateRandomHash = exports.generateWalletFromSeed = exports.amount = exports.transferId = exports.walletId = exports.mockListAddress = exports.getAddressFromHDKey = exports.mockReturnRejectedValue = exports.mockReturnValue = exports.mockFn = void 0;
exports.testAllReadTypesABI = exports.reputationApiMock = exports.fundOperationsApiMock = exports.assetApiMock = exports.contractInvocationApiMock = exports.smartContractApiMock = exports.contractEventApiMock = exports.serverSignersApiMock = exports.transactionHistoryApiMock = exports.balanceHistoryApiMock = exports.externalAddressApiMock = exports.validatorApiMock = exports.walletStakeApiMock = exports.stakeApiMock = exports.transfersApiMock = exports.tradeApiMock = exports.addressesApiMock = exports.walletsApiMock = exports.assetsApiMock = exports.usersApiMock = exports.createAxiosMock = exports.getAssetMock = void 0;
/* eslint-disable @typescript-eslint/no-explicit-any */

@@ -338,2 +338,25 @@ const axios_1 = __importDefault(require("axios"));

};
exports.VALID_COMPILED_CONTRACT_MODEL = {
compiled_smart_contract_id: "test-compiled-contract-1",
solidity_input_json: "{}",
contract_creation_bytecode: "0x",
abi: JSON.stringify("some-abi"),
contract_name: "TestContract",
};
exports.VALID_SMART_CONTRACT_CUSTOM_MODEL = {
smart_contract_id: "test-smart-contract-custom",
network_id: coinbase_1.Coinbase.networks.BaseSepolia,
wallet_id: exports.walletId,
contract_name: "TestContract",
is_external: false,
contract_address: "0xcontract-address",
type: client_1.SmartContractType.Custom,
abi: JSON.stringify("some-abi"),
transaction: {
network_id: coinbase_1.Coinbase.networks.BaseSepolia,
from_address_id: "0xdeadbeef",
unsigned_payload: "7b2274797065223a22307832222c22636861696e4964223a2230783134613334222c226e6f6e6365223a22307830222c22746f223a22307861383261623835303466646562326461646161336234663037356539363762626533353036356239222c22676173223a22307865623338222c226761735072696365223a6e756c6c2c226d61785072696f72697479466565506572476173223a2230786634323430222c226d6178466565506572476173223a2230786634333638222c2276616c7565223a22307830222c22696e707574223a223078366136323738343230303030303030303030303030303030303030303030303034373564343164653761383132393862613236333138343939363830306362636161643733633062222c226163636573734c697374223a5b5d2c2276223a22307830222c2272223a22307830222c2273223a22307830222c2279506172697479223a22307830222c2268617368223a22307865333131636632303063643237326639313566656433323165663065376431653965353362393761346166623737336638653935646431343630653665326163227d",
status: client_1.TransactionStatusEnum.Pending,
},
};
exports.VALID_SMART_CONTRACT_EXTERNAL_MODEL = {

@@ -693,2 +716,3 @@ smart_contract_id: "test-smart-contract-external",

exports.smartContractApiMock = {
compileSmartContract: jest.fn(),
createSmartContract: jest.fn(),

@@ -695,0 +719,0 @@ deploySmartContract: jest.fn(),

@@ -203,3 +203,5 @@ "use strict";

const webhook = webhook_1.Webhook.init(mockModel);
await webhook.update({ eventTypeFilter: { wallet_id: "test-wallet-id", addresses: ["0x1..", "0x2.."] } });
await webhook.update({
eventTypeFilter: { wallet_id: "test-wallet-id", addresses: ["0x1..", "0x2.."] },
});
expect(coinbase_1.Coinbase.apiClients.webhook.updateWebhook).toHaveBeenCalledWith("test-id", {

@@ -206,0 +208,0 @@ notification_uri: "https://example.com/callback",

@@ -7,3 +7,3 @@ {

"repository": "https://github.com/coinbase/coinbase-sdk-nodejs",
"version": "0.14.1",
"version": "0.15.0",
"main": "dist/index.js",

@@ -10,0 +10,0 @@ "types": "dist/index.d.ts",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc