@imtbl/sdk 1.39.0 → 1.39.1-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blockchain_data.js +2 -2
- package/dist/browser/checkout/sdk.js +4 -4
- package/dist/checkout.js +4 -4
- package/dist/config.js +1 -1
- package/dist/index.browser.js +4 -4
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +612 -15
- package/dist/index.d.ts +139 -7
- package/dist/index.js +611 -16
- package/dist/minting_backend.d.ts +3528 -0
- package/dist/minting_backend.js +6600 -0
- package/dist/orderbook.js +1 -1
- package/dist/passport.js +4 -4
- package/dist/webhook.d.ts +11 -0
- package/dist/webhook.js +388 -0
- package/dist/x.js +3 -3
- package/package.json +13 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { Pool } from 'pg';
|
|
3
|
+
|
|
2
4
|
declare enum Environment {
|
|
3
5
|
PRODUCTION = "production",
|
|
4
6
|
SANDBOX = "sandbox"
|
|
@@ -7841,7 +7843,7 @@ interface MintUser$1 {
|
|
|
7841
7843
|
* @export
|
|
7842
7844
|
* @interface MintRequest
|
|
7843
7845
|
*/
|
|
7844
|
-
interface MintRequest$
|
|
7846
|
+
interface MintRequest$2 {
|
|
7845
7847
|
/**
|
|
7846
7848
|
* Signature from authorised minter
|
|
7847
7849
|
* @type {string}
|
|
@@ -10820,7 +10822,7 @@ interface MintsApiMintTokensRequest$1 {
|
|
|
10820
10822
|
* @type {Array<MintRequest>}
|
|
10821
10823
|
* @memberof MintsApiMintTokens
|
|
10822
10824
|
*/
|
|
10823
|
-
readonly mintTokensRequestV2: Array<MintRequest$
|
|
10825
|
+
readonly mintTokensRequestV2: Array<MintRequest$2>;
|
|
10824
10826
|
}
|
|
10825
10827
|
/**
|
|
10826
10828
|
* MintsApi - object-oriented interface
|
|
@@ -21033,7 +21035,7 @@ type UnsignedTransferRequest = TokenAmount & {
|
|
|
21033
21035
|
/**
|
|
21034
21036
|
* Parameter required to Mint tokens
|
|
21035
21037
|
*/
|
|
21036
|
-
type UnsignedMintRequest = Omit<MintRequest$
|
|
21038
|
+
type UnsignedMintRequest = Omit<MintRequest$2, 'auth_signature'>;
|
|
21037
21039
|
/**
|
|
21038
21040
|
* Parameter required to create a Transfer
|
|
21039
21041
|
*/
|
|
@@ -21191,7 +21193,7 @@ interface MetadataSchemaRequest extends MetadataSchemaRequest$1 {
|
|
|
21191
21193
|
}
|
|
21192
21194
|
interface MintFee extends MintFee$1 {
|
|
21193
21195
|
}
|
|
21194
|
-
interface MintRequest extends MintRequest$
|
|
21196
|
+
interface MintRequest$1 extends MintRequest$2 {
|
|
21195
21197
|
}
|
|
21196
21198
|
interface MintTokenDataV2 extends MintTokenDataV2$1 {
|
|
21197
21199
|
}
|
|
@@ -31837,7 +31839,6 @@ declare const x_d_MetadataRefreshesApi: typeof MetadataRefreshesApi;
|
|
|
31837
31839
|
type x_d_MetadataSchemaRequest = MetadataSchemaRequest;
|
|
31838
31840
|
declare const x_d_MetadataSchemaRequestTypeEnum: typeof MetadataSchemaRequestTypeEnum;
|
|
31839
31841
|
type x_d_MintFee = MintFee;
|
|
31840
|
-
type x_d_MintRequest = MintRequest;
|
|
31841
31842
|
type x_d_MintTokenDataV2 = MintTokenDataV2;
|
|
31842
31843
|
type x_d_MintTokensResponse = MintTokensResponse;
|
|
31843
31844
|
type x_d_MintUser = MintUser;
|
|
@@ -31983,7 +31984,7 @@ declare namespace x_d {
|
|
|
31983
31984
|
x_d_MetadataSchemaRequest as MetadataSchemaRequest,
|
|
31984
31985
|
x_d_MetadataSchemaRequestTypeEnum as MetadataSchemaRequestTypeEnum,
|
|
31985
31986
|
x_d_MintFee as MintFee,
|
|
31986
|
-
|
|
31987
|
+
MintRequest$1 as MintRequest,
|
|
31987
31988
|
x_d_MintTokenDataV2 as MintTokenDataV2,
|
|
31988
31989
|
x_d_MintTokensResponse as MintTokensResponse,
|
|
31989
31990
|
x_d_MintUser as MintUser,
|
|
@@ -32050,4 +32051,135 @@ declare namespace x_d {
|
|
|
32050
32051
|
};
|
|
32051
32052
|
}
|
|
32052
32053
|
|
|
32053
|
-
|
|
32054
|
+
declare const init: (body: string | Record<string, unknown>, env: Environment, handlers: {
|
|
32055
|
+
zkevmMintRequestUpdated: (event: any) => Promise<void>;
|
|
32056
|
+
others?: ((event: any) => Promise<void>) | undefined;
|
|
32057
|
+
}) => Promise<void>;
|
|
32058
|
+
|
|
32059
|
+
declare const webhook_d_init: typeof init;
|
|
32060
|
+
declare namespace webhook_d {
|
|
32061
|
+
export {
|
|
32062
|
+
webhook_d_init as init,
|
|
32063
|
+
};
|
|
32064
|
+
}
|
|
32065
|
+
|
|
32066
|
+
type CreateMintRequest = {
|
|
32067
|
+
contract_address: string;
|
|
32068
|
+
asset_id: string;
|
|
32069
|
+
metadata: any;
|
|
32070
|
+
owner_address: string;
|
|
32071
|
+
};
|
|
32072
|
+
type MintRequest = {
|
|
32073
|
+
id: string;
|
|
32074
|
+
contract_address: string;
|
|
32075
|
+
wallet_address: string;
|
|
32076
|
+
asset_id: string;
|
|
32077
|
+
metadata: any;
|
|
32078
|
+
owner_address: string;
|
|
32079
|
+
tried_count: number;
|
|
32080
|
+
};
|
|
32081
|
+
type SubmittedMintRequest = {
|
|
32082
|
+
tokenId: string | null;
|
|
32083
|
+
status: string;
|
|
32084
|
+
assetId: string;
|
|
32085
|
+
contractAddress: string;
|
|
32086
|
+
ownerAddress: string;
|
|
32087
|
+
metadataId: string;
|
|
32088
|
+
imtblZkevmMintRequestUpdatedId: string;
|
|
32089
|
+
error: any | null;
|
|
32090
|
+
};
|
|
32091
|
+
interface MintingPersistence {
|
|
32092
|
+
recordMint: (request: CreateMintRequest) => Promise<void>;
|
|
32093
|
+
getNextBatchForSubmission: (limit: number) => Promise<MintRequest[]>;
|
|
32094
|
+
updateMintingStatusToSubmitted: (ids: string[]) => Promise<void>;
|
|
32095
|
+
updateMintingStatusToSubmissionFailed: (ids: string[]) => Promise<void>;
|
|
32096
|
+
syncMintingStatus: (submittedMintRequest: SubmittedMintRequest) => Promise<void>;
|
|
32097
|
+
markAsConflict: (assetIds: string[], contractAddress: string) => Promise<void>;
|
|
32098
|
+
resetMintingStatus: (ids: string[]) => Promise<void>;
|
|
32099
|
+
markForRetry: (ids: string[]) => Promise<void>;
|
|
32100
|
+
getMintingRequest: (contractAddress: string, referenceId: string) => Promise<MintRequest | null>;
|
|
32101
|
+
}
|
|
32102
|
+
|
|
32103
|
+
declare const mintingPersistence$1: (client: Pool) => MintingPersistence;
|
|
32104
|
+
|
|
32105
|
+
declare const mintingPersistence: (client: any) => MintingPersistence;
|
|
32106
|
+
|
|
32107
|
+
interface Logger {
|
|
32108
|
+
info: (message: string) => void;
|
|
32109
|
+
error: (message: any) => void;
|
|
32110
|
+
}
|
|
32111
|
+
|
|
32112
|
+
declare const recordMint: (mintingPersistence: MintingPersistence, mintRequest: CreateMintRequest) => Promise<void>;
|
|
32113
|
+
declare const submitMintingRequests: (mintingPersistence: MintingPersistence, blockchainDataSDKClient: BlockchainData, { defaultBatchSize, chainName, maxNumberOfTries, }: {
|
|
32114
|
+
defaultBatchSize?: number | undefined;
|
|
32115
|
+
chainName?: string | undefined;
|
|
32116
|
+
maxNumberOfTries?: number | undefined;
|
|
32117
|
+
}, logger?: Logger) => Promise<never>;
|
|
32118
|
+
type MintRequestEvent = {
|
|
32119
|
+
event_name: string;
|
|
32120
|
+
chain: string;
|
|
32121
|
+
event_id: string;
|
|
32122
|
+
data: {
|
|
32123
|
+
chain: {
|
|
32124
|
+
id: string;
|
|
32125
|
+
name: string;
|
|
32126
|
+
};
|
|
32127
|
+
contract_address: string;
|
|
32128
|
+
owner_address: string;
|
|
32129
|
+
reference_id: string;
|
|
32130
|
+
metadata_id: string;
|
|
32131
|
+
token_id: string | null;
|
|
32132
|
+
status: string;
|
|
32133
|
+
transaction_hash: string | null;
|
|
32134
|
+
activity_id: string | null;
|
|
32135
|
+
error: {
|
|
32136
|
+
code: string;
|
|
32137
|
+
message: string;
|
|
32138
|
+
} | null;
|
|
32139
|
+
created_at: string;
|
|
32140
|
+
updated_at: string;
|
|
32141
|
+
};
|
|
32142
|
+
};
|
|
32143
|
+
declare const processMint: (mintingPersistence: MintingPersistence, event: MintRequestEvent, logger?: Logger) => Promise<void>;
|
|
32144
|
+
|
|
32145
|
+
interface MintingBackendModuleConfiguration extends ModuleConfiguration<undefined> {
|
|
32146
|
+
persistence: MintingPersistence;
|
|
32147
|
+
logger?: Logger;
|
|
32148
|
+
}
|
|
32149
|
+
declare class MintingBackendModule {
|
|
32150
|
+
private readonly baseConfig;
|
|
32151
|
+
private readonly persistence;
|
|
32152
|
+
private readonly blockchainDataClient;
|
|
32153
|
+
private readonly logger;
|
|
32154
|
+
constructor(config: MintingBackendModuleConfiguration);
|
|
32155
|
+
recordMint(mintRequest: CreateMintRequest): Promise<void>;
|
|
32156
|
+
submitMintingRequests(config: {
|
|
32157
|
+
defaultBatchSize?: number;
|
|
32158
|
+
chainName?: string;
|
|
32159
|
+
maxNumberOfTries?: number;
|
|
32160
|
+
}): Promise<void>;
|
|
32161
|
+
processMint(body: string | Record<string, unknown>, otherHandlers?: {
|
|
32162
|
+
zkevmMintRequestUpdated: (event: MintRequestEvent) => Promise<void>;
|
|
32163
|
+
others: (..._args: any) => Promise<void>;
|
|
32164
|
+
}): Promise<void>;
|
|
32165
|
+
}
|
|
32166
|
+
|
|
32167
|
+
type minting_backend_d_MintingBackendModule = MintingBackendModule;
|
|
32168
|
+
declare const minting_backend_d_MintingBackendModule: typeof MintingBackendModule;
|
|
32169
|
+
type minting_backend_d_MintingBackendModuleConfiguration = MintingBackendModuleConfiguration;
|
|
32170
|
+
declare const minting_backend_d_processMint: typeof processMint;
|
|
32171
|
+
declare const minting_backend_d_recordMint: typeof recordMint;
|
|
32172
|
+
declare const minting_backend_d_submitMintingRequests: typeof submitMintingRequests;
|
|
32173
|
+
declare namespace minting_backend_d {
|
|
32174
|
+
export {
|
|
32175
|
+
minting_backend_d_MintingBackendModule as MintingBackendModule,
|
|
32176
|
+
minting_backend_d_MintingBackendModuleConfiguration as MintingBackendModuleConfiguration,
|
|
32177
|
+
mintingPersistence$1 as mintingPersistencePg,
|
|
32178
|
+
mintingPersistence as mintingPersistencePrismaSqlite,
|
|
32179
|
+
minting_backend_d_processMint as processMint,
|
|
32180
|
+
minting_backend_d_recordMint as recordMint,
|
|
32181
|
+
minting_backend_d_submitMintingRequests as submitMintingRequests,
|
|
32182
|
+
};
|
|
32183
|
+
}
|
|
32184
|
+
|
|
32185
|
+
export { blockchain_data_d as blockchainData, checkout_d as checkout, config_d as config, minting_backend_d as mintingBackend, orderbook_d as orderbook, passport_d as passport, webhook_d as webhook, x_d as x };
|