@imtbl/core-sdk
Advanced tools
Comparing version 0.5.0 to 0.6.0
import { ec } from 'elliptic'; | ||
import { MintRequest, GetSignableTransferRequestV1, GetSignableTransferRequest, Configuration } from '../api'; | ||
import { GetSignableBurnRequest } from '../workflows/types'; | ||
import { Signer as L1Signer } from '@ethersproject/abstract-signer'; | ||
export interface StarkWallet { | ||
@@ -14,2 +15,6 @@ path: string; | ||
export { Signer as L1Signer } from '@ethersproject/abstract-signer'; | ||
export interface WalletConnection { | ||
l1Signer: L1Signer; | ||
l2Signer: L2Signer; | ||
} | ||
export declare type EthNetwork = 'dev' | 'ropsten' | 'mainnet'; | ||
@@ -16,0 +21,0 @@ export interface Config { |
@@ -35,2 +35,6 @@ import { TokenType } from './token'; | ||
export declare type TokenPrepareWithdrawal = ETHPrepareWithdrawal | ERC20PrepareWithdrawal | ERC721Withdrawal; | ||
export declare type PrepareWithdrawalRequest = { | ||
token: TokenPrepareWithdrawal; | ||
quantity: string; | ||
}; | ||
export {}; |
@@ -8,2 +8,3 @@ import { ec } from 'elliptic'; | ||
export declare function getPublic(keyPair: ec.KeyPair, compressed?: boolean): string; | ||
/** @deprecated */ | ||
export declare function getStarkPublicKey(keyPair: ec.KeyPair): string; | ||
@@ -10,0 +11,0 @@ export declare function getKeyPairFromPublicKey(publicKey: string): ec.KeyPair; |
import { Signer } from '@ethersproject/abstract-signer'; | ||
import { TransfersApi, CreateTransferResponseV1, TransfersApiGetTransferRequest } from '../api'; | ||
import { GetSignableBurnRequest } from './types'; | ||
import { StarkWallet } from '../types'; | ||
import { StarkWallet, WalletConnection } from '../types'; | ||
declare type burnWorkflowWithSignerParams = WalletConnection & { | ||
request: GetSignableBurnRequest; | ||
transfersApi: TransfersApi; | ||
}; | ||
/** @deprecated */ | ||
export declare function burnWorkflow(signer: Signer, starkWallet: StarkWallet, request: GetSignableBurnRequest, transfersApi: TransfersApi): Promise<CreateTransferResponseV1>; | ||
export declare function burnWorkflowWithSigner({ l1Signer, l2Signer, request, transfersApi, }: burnWorkflowWithSignerParams): Promise<CreateTransferResponseV1>; | ||
export declare function getBurnWorkflow(request: TransfersApiGetTransferRequest, transfersApi: TransfersApi): Promise<import("axios").AxiosResponse<import("../api").Transfer, any>>; | ||
export {}; |
import { Signer } from '@ethersproject/abstract-signer'; | ||
import { StarkWallet } from '../types'; | ||
import { GetSignableCancelOrderRequest, GetSignableOrderRequest, OrdersApi } from '../api'; | ||
import { WalletConnection } from '../types/index'; | ||
declare type CreateOrderWorkflowWithSignerRequest = WalletConnection & { | ||
request: GetSignableOrderRequest; | ||
ordersApi: OrdersApi; | ||
}; | ||
declare type CancelOrderWorkflowWithSignerRequest = WalletConnection & { | ||
request: GetSignableCancelOrderRequest; | ||
ordersApi: OrdersApi; | ||
}; | ||
/** @deprecated */ | ||
export declare function createOrderWorkflow(signer: Signer, starkWallet: StarkWallet, request: GetSignableOrderRequest, ordersApi: OrdersApi): Promise<{ | ||
@@ -9,2 +19,8 @@ order_id: number; | ||
}>; | ||
export declare function createOrderWorkflowWithSigner({ l1Signer, l2Signer, request, ordersApi, }: CreateOrderWorkflowWithSignerRequest): Promise<{ | ||
order_id: number; | ||
status: string; | ||
time: number; | ||
}>; | ||
/** @deprecated */ | ||
export declare function cancelOrderWorkflow(signer: Signer, starkWallet: StarkWallet, request: GetSignableCancelOrderRequest, ordersApi: OrdersApi): Promise<{ | ||
@@ -14,1 +30,6 @@ order_id: number; | ||
}>; | ||
export declare function cancelOrderWorkflowWithSigner({ l1Signer, l2Signer, request, ordersApi, }: CancelOrderWorkflowWithSignerRequest): Promise<{ | ||
order_id: number; | ||
status: string; | ||
}>; | ||
export {}; |
import { Signer } from '@ethersproject/abstract-signer'; | ||
import { GetSignableRegistrationResponse, RegisterUserResponse, UsersApi } from '../api'; | ||
import { Registration } from '../contracts'; | ||
import { L2Signer, StarkWallet } from '../types'; | ||
import { WalletConnection, StarkWallet } from '../types'; | ||
declare type registerOffchainWorkflowWithSignerParams = WalletConnection & { | ||
usersApi: UsersApi; | ||
}; | ||
/** @deprecated */ | ||
export declare function registerOffchainWorkflow(signer: Signer, starkWallet: StarkWallet, usersApi: UsersApi): Promise<RegisterUserResponse>; | ||
export declare function registerOffchainWorkflowWithSigner(l1Signer: Signer, l2Signer: L2Signer, usersApi: UsersApi): Promise<void>; | ||
export declare function registerOffchainWorkflowWithSigner({ l1Signer, l2Signer, usersApi, }: registerOffchainWorkflowWithSignerParams): Promise<void>; | ||
export declare function isRegisteredOnChainWorkflow(starkPublicKey: string, contract: Registration): Promise<boolean>; | ||
export declare function getSignableRegistrationOnchain(etherKey: string, starkPublicKey: string, usersApi: UsersApi): Promise<GetSignableRegistrationResponse>; | ||
export {}; |
@@ -1,5 +0,11 @@ | ||
import { L1Signer, L2Signer, StarkWallet } from '../types'; | ||
import { GetSignableTradeRequest, TradesApi } from '../api'; | ||
import { WalletConnection, StarkWallet } from '../types'; | ||
import { CreateTradeResponse, GetSignableTradeRequest, TradesApi } from '../api'; | ||
import { Signer } from 'ethers'; | ||
export declare function createTradeWorkflow(signer: Signer, starkWallet: StarkWallet, request: GetSignableTradeRequest, tradesApi: TradesApi): Promise<import("../api").CreateTradeResponse>; | ||
export declare function createTradeWorkflowWithSigner(l1Signer: L1Signer, l2Signer: L2Signer, request: GetSignableTradeRequest, tradesApi: TradesApi): Promise<import("../api").CreateTradeResponse>; | ||
declare type createTradeWorkflowWithSignerParams = WalletConnection & { | ||
request: GetSignableTradeRequest; | ||
tradesApi: TradesApi; | ||
}; | ||
/** @deprecated */ | ||
export declare function createTradeWorkflow(signer: Signer, starkWallet: StarkWallet, request: GetSignableTradeRequest, tradesApi: TradesApi): Promise<CreateTradeResponse>; | ||
export declare function createTradeWorkflowWithSigner({ l1Signer, l2Signer, request, tradesApi, }: createTradeWorkflowWithSignerParams): Promise<CreateTradeResponse>; | ||
export {}; |
import { Signer } from '@ethersproject/abstract-signer'; | ||
import { TransfersApi, GetSignableTransferRequestV1, CreateTransferResponseV1, GetSignableTransferRequest, CreateTransferResponse } from '../api'; | ||
import { StarkWallet } from '../types'; | ||
import { StarkWallet, WalletConnection } from '../types'; | ||
declare type TransferRequestParams = WalletConnection & { | ||
request: GetSignableTransferRequestV1; | ||
transfersApi: TransfersApi; | ||
}; | ||
declare type BatchTransferRequestParams = WalletConnection & { | ||
request: GetSignableTransferRequest; | ||
transfersApi: TransfersApi; | ||
}; | ||
export declare function transfersWorkflowWithSigner({ l1Signer, l2Signer, request, transfersApi, }: TransferRequestParams): Promise<CreateTransferResponseV1>; | ||
export declare function transfersWorkflow(signer: Signer, starkWallet: StarkWallet, request: GetSignableTransferRequestV1, transfersApi: TransfersApi): Promise<CreateTransferResponseV1>; | ||
export declare function batchTransfersWorkflow(signer: Signer, starkWallet: StarkWallet, request: GetSignableTransferRequest, transfersApi: TransfersApi): Promise<CreateTransferResponse>; | ||
export declare function batchTransfersWorkflowWithSigner({ l1Signer, l2Signer, request, transfersApi, }: BatchTransferRequestParams): Promise<CreateTransferResponse>; | ||
export {}; |
import { Signer } from '@ethersproject/abstract-signer'; | ||
import { CreateWithdrawalResponse, WithdrawalsApi } from '../../api'; | ||
import { StarkWallet, TokenPrepareWithdrawal } from '../../types'; | ||
import { PrepareWithdrawalRequest, StarkWallet, TokenPrepareWithdrawal, WalletConnection } from '../../types'; | ||
declare type PrepareWithdrawalRequestParams = PrepareWithdrawalRequest & WalletConnection & { | ||
withdrawalsApi: WithdrawalsApi; | ||
}; | ||
export declare function prepareWithdrawalWorkflowWithSigner({ l1Signer, l2Signer, token, quantity, withdrawalsApi, }: PrepareWithdrawalRequestParams): Promise<CreateWithdrawalResponse>; | ||
export declare function prepareWithdrawalWorkflow(signer: Signer, starkWallet: StarkWallet, token: TokenPrepareWithdrawal, quantity: string, withdrawalsApi: WithdrawalsApi): Promise<CreateWithdrawalResponse>; | ||
export {}; |
import { Signer } from '@ethersproject/abstract-signer'; | ||
import { TransfersApiGetTransferRequest, GetSignableOrderRequest, GetSignableCancelOrderRequest, GetSignableTradeRequest } from '../api'; | ||
import { UnsignedMintRequest, UnsignedTransferRequest, UnsignedBatchNftTransferRequest, ERC20Deposit, ERC721Deposit, ETHDeposit, TokenDeposit, UnsignedBurnRequest, TokenPrepareWithdrawal, Config, ERC721Withdrawal, ERC20Withdrawal, TokenWithdrawal, StarkWallet, L1Signer, L2Signer } from '../types'; | ||
import { UnsignedMintRequest, UnsignedTransferRequest, UnsignedBatchNftTransferRequest, ERC20Deposit, ERC721Deposit, ETHDeposit, TokenDeposit, UnsignedBurnRequest, TokenPrepareWithdrawal, Config, ERC721Withdrawal, ERC20Withdrawal, TokenWithdrawal, StarkWallet, PrepareWithdrawalRequest } from '../types'; | ||
import { WalletConnection } from '../types/index'; | ||
export declare class Workflows { | ||
@@ -18,8 +19,14 @@ protected config: Config; | ||
registerOffchain(signer: Signer, starkWallet: StarkWallet): Promise<import("../api").RegisterUserResponse>; | ||
registerOffchainWithSigner(l1Signer: L1Signer, l2Signer: L2Signer): Promise<void>; | ||
registerOffchainWithSigner(walletConnection: WalletConnection): Promise<void>; | ||
isRegisteredOnchain(signer: Signer, starkWallet: StarkWallet): Promise<boolean>; | ||
mint(signer: Signer, request: UnsignedMintRequest): Promise<import("../api").MintTokensResponse>; | ||
/** @deprecated */ | ||
transfer(signer: Signer, starkWallet: StarkWallet, request: UnsignedTransferRequest): Promise<import("../api").CreateTransferResponseV1>; | ||
transferWithSigner(walletConnection: WalletConnection, request: UnsignedTransferRequest): Promise<import("../api").CreateTransferResponseV1>; | ||
/** @deprecated */ | ||
batchNftTransfer(signer: Signer, starkWallet: StarkWallet, request: UnsignedBatchNftTransferRequest): Promise<import("../api").CreateTransferResponse>; | ||
batchNftTransferWithSigner(walletConnection: WalletConnection, request: UnsignedBatchNftTransferRequest): Promise<import("../api").CreateTransferResponse>; | ||
/** @deprecated */ | ||
burn(signer: Signer, starkWallet: StarkWallet, request: UnsignedBurnRequest): Promise<import("../api").CreateTransferResponseV1>; | ||
burnWithSigner(walletConnection: WalletConnection, request: UnsignedBurnRequest): Promise<import("../api").CreateTransferResponseV1>; | ||
getBurn(request: TransfersApiGetTransferRequest): Promise<import("axios").AxiosResponse<import("../api").Transfer, any>>; | ||
@@ -30,3 +37,5 @@ deposit(signer: Signer, deposit: TokenDeposit): Promise<import("@ethersproject/abstract-provider").TransactionResponse>; | ||
depositERC721(signer: Signer, deposit: ERC721Deposit): Promise<import("@ethersproject/abstract-provider").TransactionResponse>; | ||
/** @deprecated */ | ||
prepareWithdrawal(signer: Signer, starkWallet: StarkWallet, token: TokenPrepareWithdrawal, quantity: string): Promise<import("../api").CreateWithdrawalResponse>; | ||
prepareWithdrawalWithSigner(walletConnection: WalletConnection, request: PrepareWithdrawalRequest): Promise<import("../api").CreateWithdrawalResponse>; | ||
completeEthWithdrawal(signer: Signer, starkPublicKey: string): Promise<import("@ethersproject/abstract-provider").TransactionResponse>; | ||
@@ -36,2 +45,3 @@ completeERC20Withdrawal(signer: Signer, starkPublicKey: string, token: ERC20Withdrawal): Promise<import("@ethersproject/abstract-provider").TransactionResponse>; | ||
completeWithdrawal(signer: Signer, starkPublicKey: string, token: TokenWithdrawal): Promise<import("@ethersproject/abstract-provider").TransactionResponse>; | ||
/** @deprecated */ | ||
createOrder(signer: Signer, starkWallet: StarkWallet, request: GetSignableOrderRequest): Promise<{ | ||
@@ -42,2 +52,8 @@ order_id: number; | ||
}>; | ||
createOrderWithSigner(walletConnection: WalletConnection, request: GetSignableOrderRequest): Promise<{ | ||
order_id: number; | ||
status: string; | ||
time: number; | ||
}>; | ||
/** @deprecated */ | ||
cancelOrder(signer: Signer, starkWallet: StarkWallet, request: GetSignableCancelOrderRequest): Promise<{ | ||
@@ -47,5 +63,9 @@ order_id: number; | ||
}>; | ||
cancelOrderWithSigner(walletConnection: WalletConnection, request: GetSignableCancelOrderRequest): Promise<{ | ||
order_id: number; | ||
status: string; | ||
}>; | ||
/** @deprecated */ | ||
createTrade(signer: Signer, starkWallet: StarkWallet, request: GetSignableTradeRequest): Promise<import("../api").CreateTradeResponse>; | ||
createTradeWithSigner(l1Signer: L1Signer, l2Signer: L2Signer, request: GetSignableTradeRequest): Promise<import("../api").CreateTradeResponse>; | ||
createTradeWithSigner(walletConnection: WalletConnection, request: GetSignableTradeRequest): Promise<import("../api").CreateTradeResponse>; | ||
} |
{ | ||
"name": "@imtbl/core-sdk", | ||
"version": "0.5.0", | ||
"version": "0.6.0", | ||
"description": "Immutable Core SDK", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.cjs.js", |
@@ -12,4 +12,5 @@ <div align="center"> | ||
# Immutable Core SDK | ||
[![Maintainability](https://api.codeclimate.com/v1/badges/219466ee5269620167e5/maintainability)](https://codeclimate.com/repos/62848fd8d4420d01b6002210/maintainability) | ||
[![npm version](https://badge.fury.io/js/@imtbl%2Fcore-sdk.svg)](https://www.npmjs.com/package/@imtbl/core-sdk) [![Maintainability](https://api.codeclimate.com/v1/badges/219466ee5269620167e5/maintainability)](https://codeclimate.com/repos/62848fd8d4420d01b6002210/maintainability) | ||
The Immutable Core SDK provides convenient access to Immutable's APIs and smart contracts to help projects build better web3 games and marketplaces. | ||
@@ -16,0 +17,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
2615899
12916
386