@0xsequence/metadata 0.0.0-202182517435 → 0.0.0-20220413180329

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/CHANGELOG.md CHANGED
@@ -1,6 +1,218 @@
1
1
  # @0xsequence/metadata
2
2
 
3
- ## 0.0.0-202182517435
3
+ ## 0.0.0-20220413180329
4
+
5
+ ### Patch Changes
6
+
7
+ - update metadata proto
8
+
9
+ ## 0.0.0-20220412184039
10
+
11
+ ### Patch Changes
12
+
13
+ - update metadata proto
14
+
15
+ ## 0.36.9
16
+
17
+ ### Patch Changes
18
+
19
+ - minor dev xp improvements
20
+
21
+ ## 0.36.8
22
+
23
+ ### Patch Changes
24
+
25
+ - more connect options (theme, payment providers, funding currencies)
26
+
27
+ ## 0.36.7
28
+
29
+ ### Patch Changes
30
+
31
+ - fix missing break
32
+
33
+ ## 0.36.6
34
+
35
+ ### Patch Changes
36
+
37
+ - wallet_switchEthereumChain support
38
+
39
+ ## 0.36.5
40
+
41
+ ### Patch Changes
42
+
43
+ - auth: bump ethauth to 0.7.0
44
+ network, wallet: don't assume position of auth network in list
45
+ api/indexer/metadata: trim trailing slash on hostname, and add endpoint urls
46
+ relayer: Allow to specify local relayer transaction parameters like gas price or gas limit
47
+
48
+ ## 0.36.4
49
+
4
50
  ### Patch Changes
5
51
 
6
- - next
52
+ - Updating list of chain ids to include other ethereum compatible chains
53
+
54
+ ## 0.36.3
55
+
56
+ ### Patch Changes
57
+
58
+ - provider: pass connect options to prompter methods
59
+
60
+ ## 0.36.2
61
+
62
+ ### Patch Changes
63
+
64
+ - transactions: Setting target to 0x0 when empty to during SequenceTxAbiEncode
65
+
66
+ ## 0.36.1
67
+
68
+ ### Patch Changes
69
+
70
+ - metadata: update client with more fields
71
+
72
+ ## 0.36.0
73
+
74
+ ### Minor Changes
75
+
76
+ - relayer, wallet: fee quote support
77
+
78
+ ## 0.35.12
79
+
80
+ ### Patch Changes
81
+
82
+ - provider: rename wallet.commands to wallet.utils
83
+
84
+ ## 0.35.11
85
+
86
+ ### Patch Changes
87
+
88
+ - provider/utils: smoother message validation
89
+
90
+ ## 0.35.10
91
+
92
+ ### Patch Changes
93
+
94
+ - upgrade deps
95
+
96
+ ## 0.35.9
97
+
98
+ ### Patch Changes
99
+
100
+ - provider: window-transport override event handlers with new wallet instance
101
+
102
+ ## 0.35.8
103
+
104
+ ### Patch Changes
105
+
106
+ - provider: async wallet sign in improvements
107
+
108
+ ## 0.35.7
109
+
110
+ ### Patch Changes
111
+
112
+ - config: cache wallet configs
113
+
114
+ ## 0.35.6
115
+
116
+ ### Patch Changes
117
+
118
+ - provider: support async signin of wallet request handler
119
+
120
+ ## 0.35.5
121
+
122
+ ### Patch Changes
123
+
124
+ - wallet: skip threshold check during fee estimation
125
+
126
+ ## 0.35.4
127
+
128
+ ### Patch Changes
129
+
130
+ - - browser extension mode, center window
131
+
132
+ ## 0.35.3
133
+
134
+ ### Patch Changes
135
+
136
+ - - update window position when in browser extension mode
137
+
138
+ ## 0.35.2
139
+
140
+ ### Patch Changes
141
+
142
+ - - provider: WindowMessageHandler accept optional windowHref
143
+
144
+ ## 0.35.1
145
+
146
+ ### Patch Changes
147
+
148
+ - wallet: update config on undeployed too
149
+
150
+ ## 0.35.0
151
+
152
+ ### Minor Changes
153
+
154
+ - - config: add buildStubSignature
155
+ - provider: add checks to signing cases for wallet deployment and config statuses
156
+ - provider: add prompt for wallet deployment
157
+ - relayer: add BaseRelayer.prependWalletDeploy
158
+ - relayer: add Relayer.feeOptions
159
+ - relayer: account for wallet deployment in fee estimation
160
+ - transactions: add fromTransactionish
161
+ - wallet: add Account.prependConfigUpdate
162
+ - wallet: add Account.getFeeOptions
163
+
164
+ ## 0.34.0
165
+
166
+ ### Minor Changes
167
+
168
+ - - upgrade deps
169
+
170
+ ## 0.31.3
171
+
172
+ ### Patch Changes
173
+
174
+ - update metadata bindings
175
+
176
+ ## 0.31.0
177
+
178
+ ### Minor Changes
179
+
180
+ - - upgrading to ethers v5.5
181
+
182
+ ## 0.30.0
183
+
184
+ ### Minor Changes
185
+
186
+ - - upgrade most deps
187
+
188
+ ## 0.29.8
189
+
190
+ ### Patch Changes
191
+
192
+ - update api
193
+
194
+ ## 0.29.1
195
+
196
+ ### Patch Changes
197
+
198
+ - metadata: ContractInfo.decimals is now optional, i.e. may be undefined
199
+
200
+ api: new APIs for user storage and isUsingGoogleMail
201
+
202
+ ## 0.29.0
203
+
204
+ ### Minor Changes
205
+
206
+ - major architectural changes in Sequence design
207
+
208
+ - only one API instance, API is no longer a per-chain service
209
+ - separate per-chain indexer service, API no longer handles indexing
210
+ - single contract metadata service, API no longer serves metadata
211
+
212
+ chaind package has been removed, indexer and metadata packages have been added
213
+
214
+ stronger typing with new explicit ChainId type
215
+
216
+ multicall fixes and improvements
217
+
218
+ forbid "wait" transactions in sendTransactionBatch calls
@@ -27,7 +27,7 @@ function _extends() {
27
27
  }
28
28
 
29
29
  /* eslint-disable */
30
- // sequence-metadata v0.4.0 f1264bc1871ed85b966466b348374ace021d3723
30
+ // sequence-metadata v0.4.0 376fc6f21f770a4d0457a039d13b6aca6d174e3f
31
31
  // --
32
32
  // This file has been generated by https://github.com/webrpc/webrpc using gen/typescript
33
33
  // Do not edit by hand. Update your webrpc schema and re-generate.
@@ -36,10 +36,21 @@ const WebRPCVersion = "v1"; // Schema version of your RIDL schema
36
36
 
37
37
  const WebRPCSchemaVersion = "v0.4.0"; // Schema hash generated from your RIDL schema
38
38
 
39
- const WebRPCSchemaHash = "f1264bc1871ed85b966466b348374ace021d3723"; //
39
+ const WebRPCSchemaHash = "376fc6f21f770a4d0457a039d13b6aca6d174e3f"; //
40
40
  // Types
41
41
  //
42
42
 
43
+ exports.ContractType = void 0;
44
+
45
+ (function (ContractType) {
46
+ ContractType["ERC20"] = "ERC20";
47
+ ContractType["ContractURI"] = "ContractURI";
48
+ ContractType["OpenSea"] = "OpenSea";
49
+ ContractType["ERC1155"] = "ERC1155";
50
+ ContractType["ERC721"] = "ERC721";
51
+ ContractType["UNKNOWN"] = "UNKNOWN";
52
+ })(exports.ContractType || (exports.ContractType = {}));
53
+
43
54
  exports.SwapType = void 0;
44
55
 
45
56
  (function (SwapType) {
@@ -48,6 +59,13 @@ exports.SwapType = void 0;
48
59
  SwapType["SELL"] = "SELL";
49
60
  })(exports.SwapType || (exports.SwapType = {}));
50
61
 
62
+ exports.SortOrder = void 0;
63
+
64
+ (function (SortOrder) {
65
+ SortOrder["DESC"] = "DESC";
66
+ SortOrder["ASC"] = "ASC";
67
+ })(exports.SortOrder || (exports.SortOrder = {}));
68
+
51
69
  //
52
70
  // Client
53
71
  //
@@ -107,6 +125,28 @@ class Metadata {
107
125
  });
108
126
  };
109
127
 
128
+ this.searchTokenMetadata = (args, headers) => {
129
+ return this.fetch(this.url('SearchTokenMetadata'), createHTTPRequest(args, headers)).then(res => {
130
+ return buildResponse(res).then(_data => {
131
+ return {
132
+ page: _data.page,
133
+ tokenMetadata: _data.tokenMetadata
134
+ };
135
+ });
136
+ });
137
+ };
138
+
139
+ this.searchTokenIDs = (args, headers) => {
140
+ return this.fetch(this.url('SearchTokenIDs'), createHTTPRequest(args, headers)).then(res => {
141
+ return buildResponse(res).then(_data => {
142
+ return {
143
+ page: _data.page,
144
+ tokenIds: _data.tokenIds
145
+ };
146
+ });
147
+ });
148
+ };
149
+
110
150
  this.getContractInfo = (args, headers) => {
111
151
  return this.fetch(this.url('GetContractInfo'), createHTTPRequest(args, headers)).then(res => {
112
152
  return buildResponse(res).then(_data => {
@@ -210,8 +250,8 @@ const buildResponse = res => {
210
250
  };
211
251
 
212
252
  class SequenceMetadataClient extends Metadata {
213
- constructor(hostname) {
214
- super(hostname, fetch__default['default']);
253
+ constructor(hostname = 'https://metadata.sequence.app') {
254
+ super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch__default["default"]);
215
255
  }
216
256
 
217
257
  }
@@ -27,7 +27,7 @@ function _extends() {
27
27
  }
28
28
 
29
29
  /* eslint-disable */
30
- // sequence-metadata v0.4.0 f1264bc1871ed85b966466b348374ace021d3723
30
+ // sequence-metadata v0.4.0 376fc6f21f770a4d0457a039d13b6aca6d174e3f
31
31
  // --
32
32
  // This file has been generated by https://github.com/webrpc/webrpc using gen/typescript
33
33
  // Do not edit by hand. Update your webrpc schema and re-generate.
@@ -36,10 +36,21 @@ const WebRPCVersion = "v1"; // Schema version of your RIDL schema
36
36
 
37
37
  const WebRPCSchemaVersion = "v0.4.0"; // Schema hash generated from your RIDL schema
38
38
 
39
- const WebRPCSchemaHash = "f1264bc1871ed85b966466b348374ace021d3723"; //
39
+ const WebRPCSchemaHash = "376fc6f21f770a4d0457a039d13b6aca6d174e3f"; //
40
40
  // Types
41
41
  //
42
42
 
43
+ exports.ContractType = void 0;
44
+
45
+ (function (ContractType) {
46
+ ContractType["ERC20"] = "ERC20";
47
+ ContractType["ContractURI"] = "ContractURI";
48
+ ContractType["OpenSea"] = "OpenSea";
49
+ ContractType["ERC1155"] = "ERC1155";
50
+ ContractType["ERC721"] = "ERC721";
51
+ ContractType["UNKNOWN"] = "UNKNOWN";
52
+ })(exports.ContractType || (exports.ContractType = {}));
53
+
43
54
  exports.SwapType = void 0;
44
55
 
45
56
  (function (SwapType) {
@@ -48,6 +59,13 @@ exports.SwapType = void 0;
48
59
  SwapType["SELL"] = "SELL";
49
60
  })(exports.SwapType || (exports.SwapType = {}));
50
61
 
62
+ exports.SortOrder = void 0;
63
+
64
+ (function (SortOrder) {
65
+ SortOrder["DESC"] = "DESC";
66
+ SortOrder["ASC"] = "ASC";
67
+ })(exports.SortOrder || (exports.SortOrder = {}));
68
+
51
69
  //
52
70
  // Client
53
71
  //
@@ -107,6 +125,28 @@ class Metadata {
107
125
  });
108
126
  };
109
127
 
128
+ this.searchTokenMetadata = (args, headers) => {
129
+ return this.fetch(this.url('SearchTokenMetadata'), createHTTPRequest(args, headers)).then(res => {
130
+ return buildResponse(res).then(_data => {
131
+ return {
132
+ page: _data.page,
133
+ tokenMetadata: _data.tokenMetadata
134
+ };
135
+ });
136
+ });
137
+ };
138
+
139
+ this.searchTokenIDs = (args, headers) => {
140
+ return this.fetch(this.url('SearchTokenIDs'), createHTTPRequest(args, headers)).then(res => {
141
+ return buildResponse(res).then(_data => {
142
+ return {
143
+ page: _data.page,
144
+ tokenIds: _data.tokenIds
145
+ };
146
+ });
147
+ });
148
+ };
149
+
110
150
  this.getContractInfo = (args, headers) => {
111
151
  return this.fetch(this.url('GetContractInfo'), createHTTPRequest(args, headers)).then(res => {
112
152
  return buildResponse(res).then(_data => {
@@ -210,8 +250,8 @@ const buildResponse = res => {
210
250
  };
211
251
 
212
252
  class SequenceMetadataClient extends Metadata {
213
- constructor(hostname) {
214
- super(hostname, fetch__default['default']);
253
+ constructor(hostname = 'https://metadata.sequence.app') {
254
+ super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch__default["default"]);
215
255
  }
216
256
 
217
257
  }
@@ -19,7 +19,7 @@ function _extends() {
19
19
  }
20
20
 
21
21
  /* eslint-disable */
22
- // sequence-metadata v0.4.0 f1264bc1871ed85b966466b348374ace021d3723
22
+ // sequence-metadata v0.4.0 376fc6f21f770a4d0457a039d13b6aca6d174e3f
23
23
  // --
24
24
  // This file has been generated by https://github.com/webrpc/webrpc using gen/typescript
25
25
  // Do not edit by hand. Update your webrpc schema and re-generate.
@@ -28,10 +28,21 @@ const WebRPCVersion = "v1"; // Schema version of your RIDL schema
28
28
 
29
29
  const WebRPCSchemaVersion = "v0.4.0"; // Schema hash generated from your RIDL schema
30
30
 
31
- const WebRPCSchemaHash = "f1264bc1871ed85b966466b348374ace021d3723"; //
31
+ const WebRPCSchemaHash = "376fc6f21f770a4d0457a039d13b6aca6d174e3f"; //
32
32
  // Types
33
33
  //
34
34
 
35
+ let ContractType;
36
+
37
+ (function (ContractType) {
38
+ ContractType["ERC20"] = "ERC20";
39
+ ContractType["ContractURI"] = "ContractURI";
40
+ ContractType["OpenSea"] = "OpenSea";
41
+ ContractType["ERC1155"] = "ERC1155";
42
+ ContractType["ERC721"] = "ERC721";
43
+ ContractType["UNKNOWN"] = "UNKNOWN";
44
+ })(ContractType || (ContractType = {}));
45
+
35
46
  let SwapType;
36
47
 
37
48
  (function (SwapType) {
@@ -40,6 +51,13 @@ let SwapType;
40
51
  SwapType["SELL"] = "SELL";
41
52
  })(SwapType || (SwapType = {}));
42
53
 
54
+ let SortOrder;
55
+
56
+ (function (SortOrder) {
57
+ SortOrder["DESC"] = "DESC";
58
+ SortOrder["ASC"] = "ASC";
59
+ })(SortOrder || (SortOrder = {}));
60
+
43
61
  //
44
62
  // Client
45
63
  //
@@ -99,6 +117,28 @@ class Metadata {
99
117
  });
100
118
  };
101
119
 
120
+ this.searchTokenMetadata = (args, headers) => {
121
+ return this.fetch(this.url('SearchTokenMetadata'), createHTTPRequest(args, headers)).then(res => {
122
+ return buildResponse(res).then(_data => {
123
+ return {
124
+ page: _data.page,
125
+ tokenMetadata: _data.tokenMetadata
126
+ };
127
+ });
128
+ });
129
+ };
130
+
131
+ this.searchTokenIDs = (args, headers) => {
132
+ return this.fetch(this.url('SearchTokenIDs'), createHTTPRequest(args, headers)).then(res => {
133
+ return buildResponse(res).then(_data => {
134
+ return {
135
+ page: _data.page,
136
+ tokenIds: _data.tokenIds
137
+ };
138
+ });
139
+ });
140
+ };
141
+
102
142
  this.getContractInfo = (args, headers) => {
103
143
  return this.fetch(this.url('GetContractInfo'), createHTTPRequest(args, headers)).then(res => {
104
144
  return buildResponse(res).then(_data => {
@@ -202,10 +242,10 @@ const buildResponse = res => {
202
242
  };
203
243
 
204
244
  class SequenceMetadataClient extends Metadata {
205
- constructor(hostname) {
206
- super(hostname, fetch);
245
+ constructor(hostname = 'https://metadata.sequence.app') {
246
+ super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch);
207
247
  }
208
248
 
209
249
  }
210
250
 
211
- export { Metadata, SequenceMetadataClient, SwapType, WebRPCSchemaHash, WebRPCSchemaVersion, WebRPCVersion };
251
+ export { ContractType, Metadata, SequenceMetadataClient, SortOrder, SwapType, WebRPCSchemaHash, WebRPCSchemaVersion, WebRPCVersion };
@@ -1,5 +1,5 @@
1
- export * from './metadata.gen';
2
- import { Metadata as BaseSequenceMetadata } from './metadata.gen';
3
- export declare class SequenceMetadataClient extends BaseSequenceMetadata {
4
- constructor(hostname: string);
5
- }
1
+ export * from './metadata.gen';
2
+ import { Metadata as BaseSequenceMetadata } from './metadata.gen';
3
+ export declare class SequenceMetadataClient extends BaseSequenceMetadata {
4
+ constructor(hostname?: string);
5
+ }
@@ -1,185 +1,249 @@
1
- export declare const WebRPCVersion = "v1";
2
- export declare const WebRPCSchemaVersion = "v0.4.0";
3
- export declare const WebRPCSchemaHash = "f1264bc1871ed85b966466b348374ace021d3723";
4
- export declare enum SwapType {
5
- UNKNOWN = "UNKNOWN",
6
- BUY = "BUY",
7
- SELL = "SELL"
8
- }
9
- export interface Version {
10
- webrpcVersion: string;
11
- schemaVersion: string;
12
- schemaHash: string;
13
- appVersion: string;
14
- }
15
- export interface RuntimeStatus {
16
- healthOK: boolean;
17
- startTime: string;
18
- uptime: number;
19
- ver: string;
20
- branch: string;
21
- commitHash: string;
22
- checks: RuntimeChecks;
23
- }
24
- export interface RuntimeChecks {
25
- }
26
- export interface ContractInfo {
27
- chainId: number;
28
- address: string;
29
- name: string;
30
- type: string;
31
- symbol: string;
32
- decimals: number;
33
- logoURI: string;
34
- extensions: ContractInfoExtensions;
35
- }
36
- export interface ContractInfoExtensions {
37
- link: string;
38
- description: string;
39
- ogImage: string;
40
- originChainId: number;
41
- originAddress: string;
42
- }
43
- export interface TokenMetadata {
44
- tokenId: string;
45
- contractAddress: string;
46
- name: string;
47
- description: string;
48
- image: string;
49
- decimals: number;
50
- properties: {
51
- [key: string]: any;
52
- };
53
- image_data: string;
54
- external_url: string;
55
- background_color: string;
56
- attributes: Array<{
57
- [key: string]: any;
58
- }>;
59
- }
60
- export interface GetNiftyswapUnitPricesRequest {
61
- swapType: SwapType;
62
- ids: Array<string>;
63
- amounts: Array<string>;
64
- }
65
- export interface Metadata {
66
- ping(headers?: object): Promise<PingReturn>;
67
- version(headers?: object): Promise<VersionReturn>;
68
- runtimeStatus(headers?: object): Promise<RuntimeStatusReturn>;
69
- getTokenMetadata(args: GetTokenMetadataArgs, headers?: object): Promise<GetTokenMetadataReturn>;
70
- getTokenMetadataBatch(args: GetTokenMetadataBatchArgs, headers?: object): Promise<GetTokenMetadataBatchReturn>;
71
- getContractInfo(args: GetContractInfoArgs, headers?: object): Promise<GetContractInfoReturn>;
72
- getContractInfoBatch(args: GetContractInfoBatchArgs, headers?: object): Promise<GetContractInfoBatchReturn>;
73
- searchContractInfo(args: SearchContractInfoArgs, headers?: object): Promise<SearchContractInfoReturn>;
74
- searchContractInfoBatch(args: SearchContractInfoBatchArgs, headers?: object): Promise<SearchContractInfoBatchReturn>;
75
- getNiftyswapTokenQuantity(args: GetNiftyswapTokenQuantityArgs, headers?: object): Promise<GetNiftyswapTokenQuantityReturn>;
76
- getNiftyswapUnitPrices(args: GetNiftyswapUnitPricesArgs, headers?: object): Promise<GetNiftyswapUnitPricesReturn>;
77
- }
78
- export interface PingArgs {
79
- }
80
- export interface PingReturn {
81
- status: boolean;
82
- }
83
- export interface VersionArgs {
84
- }
85
- export interface VersionReturn {
86
- version: Version;
87
- }
88
- export interface RuntimeStatusArgs {
89
- }
90
- export interface RuntimeStatusReturn {
91
- status: RuntimeStatus;
92
- }
93
- export interface GetTokenMetadataArgs {
94
- chainID: string;
95
- contractAddress: string;
96
- tokenIDs: Array<string>;
97
- }
98
- export interface GetTokenMetadataReturn {
99
- tokenMetadata: Array<TokenMetadata>;
100
- }
101
- export interface GetTokenMetadataBatchArgs {
102
- chainID: string;
103
- contractTokenMap: {
104
- [key: string]: Array<string>;
105
- };
106
- }
107
- export interface GetTokenMetadataBatchReturn {
108
- contractTokenMetadata: {
109
- [key: string]: Array<TokenMetadata>;
110
- };
111
- }
112
- export interface GetContractInfoArgs {
113
- chainID: string;
114
- contractAddress: string;
115
- }
116
- export interface GetContractInfoReturn {
117
- contractInfo: ContractInfo;
118
- }
119
- export interface GetContractInfoBatchArgs {
120
- chainID: string;
121
- contractAddresses: Array<string>;
122
- }
123
- export interface GetContractInfoBatchReturn {
124
- contractInfoMap: {
125
- [key: string]: ContractInfo;
126
- };
127
- }
128
- export interface SearchContractInfoArgs {
129
- contractAddress: string;
130
- }
131
- export interface SearchContractInfoReturn {
132
- contractInfoList: Array<ContractInfo>;
133
- }
134
- export interface SearchContractInfoBatchArgs {
135
- contractAddresses: Array<string>;
136
- }
137
- export interface SearchContractInfoBatchReturn {
138
- contractInfoByChain: {
139
- [key: string]: Array<ContractInfo>;
140
- };
141
- }
142
- export interface GetNiftyswapTokenQuantityArgs {
143
- chainID: string;
144
- contractAddress: string;
145
- tokenIDs: Array<string>;
146
- }
147
- export interface GetNiftyswapTokenQuantityReturn {
148
- quantity: {
149
- [key: string]: string;
150
- };
151
- }
152
- export interface GetNiftyswapUnitPricesArgs {
153
- chainID: string;
154
- contractAddress: string;
155
- req: GetNiftyswapUnitPricesRequest;
156
- }
157
- export interface GetNiftyswapUnitPricesReturn {
158
- prices: {
159
- [key: string]: string;
160
- };
161
- }
162
- export declare class Metadata implements Metadata {
163
- protected hostname: string;
164
- protected fetch: Fetch;
165
- protected path: string;
166
- constructor(hostname: string, fetch: Fetch);
167
- private url;
168
- ping: (headers?: object | undefined) => Promise<PingReturn>;
169
- version: (headers?: object | undefined) => Promise<VersionReturn>;
170
- runtimeStatus: (headers?: object | undefined) => Promise<RuntimeStatusReturn>;
171
- getTokenMetadata: (args: GetTokenMetadataArgs, headers?: object | undefined) => Promise<GetTokenMetadataReturn>;
172
- getTokenMetadataBatch: (args: GetTokenMetadataBatchArgs, headers?: object | undefined) => Promise<GetTokenMetadataBatchReturn>;
173
- getContractInfo: (args: GetContractInfoArgs, headers?: object | undefined) => Promise<GetContractInfoReturn>;
174
- getContractInfoBatch: (args: GetContractInfoBatchArgs, headers?: object | undefined) => Promise<GetContractInfoBatchReturn>;
175
- searchContractInfo: (args: SearchContractInfoArgs, headers?: object | undefined) => Promise<SearchContractInfoReturn>;
176
- searchContractInfoBatch: (args: SearchContractInfoBatchArgs, headers?: object | undefined) => Promise<SearchContractInfoBatchReturn>;
177
- getNiftyswapTokenQuantity: (args: GetNiftyswapTokenQuantityArgs, headers?: object | undefined) => Promise<GetNiftyswapTokenQuantityReturn>;
178
- getNiftyswapUnitPrices: (args: GetNiftyswapUnitPricesArgs, headers?: object | undefined) => Promise<GetNiftyswapUnitPricesReturn>;
179
- }
180
- export interface WebRPCError extends Error {
181
- code: string;
182
- msg: string;
183
- status: number;
184
- }
185
- export declare type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>;
1
+ export declare const WebRPCVersion = "v1";
2
+ export declare const WebRPCSchemaVersion = "v0.4.0";
3
+ export declare const WebRPCSchemaHash = "376fc6f21f770a4d0457a039d13b6aca6d174e3f";
4
+ export declare enum ContractType {
5
+ ERC20 = "ERC20",
6
+ ContractURI = "ContractURI",
7
+ OpenSea = "OpenSea",
8
+ ERC1155 = "ERC1155",
9
+ ERC721 = "ERC721",
10
+ UNKNOWN = "UNKNOWN"
11
+ }
12
+ export declare enum SwapType {
13
+ UNKNOWN = "UNKNOWN",
14
+ BUY = "BUY",
15
+ SELL = "SELL"
16
+ }
17
+ export declare enum SortOrder {
18
+ DESC = "DESC",
19
+ ASC = "ASC"
20
+ }
21
+ export interface Version {
22
+ webrpcVersion: string;
23
+ schemaVersion: string;
24
+ schemaHash: string;
25
+ appVersion: string;
26
+ }
27
+ export interface RuntimeStatus {
28
+ healthOK: boolean;
29
+ startTime: string;
30
+ uptime: number;
31
+ ver: string;
32
+ branch: string;
33
+ commitHash: string;
34
+ checks: RuntimeChecks;
35
+ }
36
+ export interface RuntimeChecks {
37
+ }
38
+ export interface ContractIndex {
39
+ chainId: string;
40
+ address: string;
41
+ type: ContractType;
42
+ metadata: {
43
+ [key: string]: any;
44
+ };
45
+ }
46
+ export interface ContractInfo {
47
+ chainId: number;
48
+ address: string;
49
+ name: string;
50
+ type: string;
51
+ symbol: string;
52
+ decimals?: number;
53
+ logoURI: string;
54
+ extensions: ContractInfoExtensions;
55
+ }
56
+ export interface ContractInfoExtensions {
57
+ link: string;
58
+ description: string;
59
+ ogImage: string;
60
+ originChainId: number;
61
+ originAddress: string;
62
+ blacklist: boolean;
63
+ }
64
+ export interface TokenIndex {
65
+ chainId: string;
66
+ contractAddress: string;
67
+ tokenId: string;
68
+ metadata: {
69
+ [key: string]: any;
70
+ };
71
+ }
72
+ export interface TokenMetadata {
73
+ tokenId: string;
74
+ contractAddress: string;
75
+ name: string;
76
+ description: string;
77
+ image: string;
78
+ decimals: number;
79
+ properties: {
80
+ [key: string]: any;
81
+ };
82
+ video: string;
83
+ audio: string;
84
+ image_data: string;
85
+ external_url: string;
86
+ background_color: string;
87
+ animation_url: string;
88
+ attributes: Array<{
89
+ [key: string]: any;
90
+ }>;
91
+ }
92
+ export interface GetNiftyswapUnitPricesRequest {
93
+ swapType: SwapType;
94
+ ids: Array<string>;
95
+ amounts: Array<string>;
96
+ }
97
+ export interface Page {
98
+ pageSize?: number;
99
+ page?: number;
100
+ }
101
+ export interface SortBy {
102
+ column: string;
103
+ order: SortOrder;
104
+ }
105
+ export interface Metadata {
106
+ ping(headers?: object): Promise<PingReturn>;
107
+ version(headers?: object): Promise<VersionReturn>;
108
+ runtimeStatus(headers?: object): Promise<RuntimeStatusReturn>;
109
+ getTokenMetadata(args: GetTokenMetadataArgs, headers?: object): Promise<GetTokenMetadataReturn>;
110
+ getTokenMetadataBatch(args: GetTokenMetadataBatchArgs, headers?: object): Promise<GetTokenMetadataBatchReturn>;
111
+ searchTokenMetadata(args: SearchTokenMetadataArgs, headers?: object): Promise<SearchTokenMetadataReturn>;
112
+ searchTokenIDs(args: SearchTokenIDsArgs, headers?: object): Promise<SearchTokenIDsReturn>;
113
+ getContractInfo(args: GetContractInfoArgs, headers?: object): Promise<GetContractInfoReturn>;
114
+ getContractInfoBatch(args: GetContractInfoBatchArgs, headers?: object): Promise<GetContractInfoBatchReturn>;
115
+ searchContractInfo(args: SearchContractInfoArgs, headers?: object): Promise<SearchContractInfoReturn>;
116
+ searchContractInfoBatch(args: SearchContractInfoBatchArgs, headers?: object): Promise<SearchContractInfoBatchReturn>;
117
+ getNiftyswapTokenQuantity(args: GetNiftyswapTokenQuantityArgs, headers?: object): Promise<GetNiftyswapTokenQuantityReturn>;
118
+ getNiftyswapUnitPrices(args: GetNiftyswapUnitPricesArgs, headers?: object): Promise<GetNiftyswapUnitPricesReturn>;
119
+ }
120
+ export interface PingArgs {
121
+ }
122
+ export interface PingReturn {
123
+ status: boolean;
124
+ }
125
+ export interface VersionArgs {
126
+ }
127
+ export interface VersionReturn {
128
+ version: Version;
129
+ }
130
+ export interface RuntimeStatusArgs {
131
+ }
132
+ export interface RuntimeStatusReturn {
133
+ status: RuntimeStatus;
134
+ }
135
+ export interface GetTokenMetadataArgs {
136
+ chainID: string;
137
+ contractAddress: string;
138
+ tokenIDs: Array<string>;
139
+ }
140
+ export interface GetTokenMetadataReturn {
141
+ tokenMetadata: Array<TokenMetadata>;
142
+ }
143
+ export interface GetTokenMetadataBatchArgs {
144
+ chainID: string;
145
+ contractTokenMap: {
146
+ [key: string]: Array<string>;
147
+ };
148
+ }
149
+ export interface GetTokenMetadataBatchReturn {
150
+ contractTokenMetadata: {
151
+ [key: string]: Array<TokenMetadata>;
152
+ };
153
+ }
154
+ export interface SearchTokenMetadataArgs {
155
+ chainID: string;
156
+ contractAddress: string;
157
+ filter: string;
158
+ page?: Page;
159
+ }
160
+ export interface SearchTokenMetadataReturn {
161
+ page: Page;
162
+ tokenMetadata: Array<TokenMetadata>;
163
+ }
164
+ export interface SearchTokenIDsArgs {
165
+ chainID: string;
166
+ contractAddress: string;
167
+ filter: string;
168
+ page?: Page;
169
+ }
170
+ export interface SearchTokenIDsReturn {
171
+ page: Page;
172
+ tokenIds: Array<string>;
173
+ }
174
+ export interface GetContractInfoArgs {
175
+ chainID: string;
176
+ contractAddress: string;
177
+ }
178
+ export interface GetContractInfoReturn {
179
+ contractInfo: ContractInfo;
180
+ }
181
+ export interface GetContractInfoBatchArgs {
182
+ chainID: string;
183
+ contractAddresses: Array<string>;
184
+ }
185
+ export interface GetContractInfoBatchReturn {
186
+ contractInfoMap: {
187
+ [key: string]: ContractInfo;
188
+ };
189
+ }
190
+ export interface SearchContractInfoArgs {
191
+ contractAddress: string;
192
+ }
193
+ export interface SearchContractInfoReturn {
194
+ contractInfoList: Array<ContractInfo>;
195
+ }
196
+ export interface SearchContractInfoBatchArgs {
197
+ contractAddresses: Array<string>;
198
+ }
199
+ export interface SearchContractInfoBatchReturn {
200
+ contractInfoByChain: {
201
+ [key: string]: Array<ContractInfo>;
202
+ };
203
+ }
204
+ export interface GetNiftyswapTokenQuantityArgs {
205
+ chainID: string;
206
+ contractAddress: string;
207
+ tokenIDs: Array<string>;
208
+ }
209
+ export interface GetNiftyswapTokenQuantityReturn {
210
+ quantity: {
211
+ [key: string]: string;
212
+ };
213
+ }
214
+ export interface GetNiftyswapUnitPricesArgs {
215
+ chainID: string;
216
+ contractAddress: string;
217
+ req: GetNiftyswapUnitPricesRequest;
218
+ }
219
+ export interface GetNiftyswapUnitPricesReturn {
220
+ prices: {
221
+ [key: string]: string;
222
+ };
223
+ }
224
+ export declare class Metadata implements Metadata {
225
+ protected hostname: string;
226
+ protected fetch: Fetch;
227
+ protected path: string;
228
+ constructor(hostname: string, fetch: Fetch);
229
+ private url;
230
+ ping: (headers?: object | undefined) => Promise<PingReturn>;
231
+ version: (headers?: object | undefined) => Promise<VersionReturn>;
232
+ runtimeStatus: (headers?: object | undefined) => Promise<RuntimeStatusReturn>;
233
+ getTokenMetadata: (args: GetTokenMetadataArgs, headers?: object | undefined) => Promise<GetTokenMetadataReturn>;
234
+ getTokenMetadataBatch: (args: GetTokenMetadataBatchArgs, headers?: object | undefined) => Promise<GetTokenMetadataBatchReturn>;
235
+ searchTokenMetadata: (args: SearchTokenMetadataArgs, headers?: object | undefined) => Promise<SearchTokenMetadataReturn>;
236
+ searchTokenIDs: (args: SearchTokenIDsArgs, headers?: object | undefined) => Promise<SearchTokenIDsReturn>;
237
+ getContractInfo: (args: GetContractInfoArgs, headers?: object | undefined) => Promise<GetContractInfoReturn>;
238
+ getContractInfoBatch: (args: GetContractInfoBatchArgs, headers?: object | undefined) => Promise<GetContractInfoBatchReturn>;
239
+ searchContractInfo: (args: SearchContractInfoArgs, headers?: object | undefined) => Promise<SearchContractInfoReturn>;
240
+ searchContractInfoBatch: (args: SearchContractInfoBatchArgs, headers?: object | undefined) => Promise<SearchContractInfoBatchReturn>;
241
+ getNiftyswapTokenQuantity: (args: GetNiftyswapTokenQuantityArgs, headers?: object | undefined) => Promise<GetNiftyswapTokenQuantityReturn>;
242
+ getNiftyswapUnitPrices: (args: GetNiftyswapUnitPricesArgs, headers?: object | undefined) => Promise<GetNiftyswapUnitPricesReturn>;
243
+ }
244
+ export interface WebRPCError extends Error {
245
+ code: string;
246
+ msg: string;
247
+ status: number;
248
+ }
249
+ export declare type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xsequence/metadata",
3
- "version": "0.0.0-202182517435",
3
+ "version": "0.0.0-20220413180329",
4
4
  "description": "metadata sub-package for Sequence",
5
5
  "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/metadata",
6
6
  "source": "src/index.ts",
@@ -13,7 +13,7 @@
13
13
  "typecheck": "tsc --noEmit"
14
14
  },
15
15
  "dependencies": {
16
- "cross-fetch": "^3.0.6"
16
+ "cross-fetch": "^3.1.5"
17
17
  },
18
18
  "peerDependencies": {},
19
19
  "devDependencies": {},
package/src/index.ts CHANGED
@@ -5,7 +5,7 @@ import fetch from 'cross-fetch'
5
5
  import { Metadata as BaseSequenceMetadata } from './metadata.gen'
6
6
 
7
7
  export class SequenceMetadataClient extends BaseSequenceMetadata {
8
- constructor(hostname: string) {
9
- super(hostname, fetch)
8
+ constructor(hostname: string = 'https://metadata.sequence.app') {
9
+ super(hostname.endsWith('/') ? hostname.slice(0, -1) : hostname, fetch)
10
10
  }
11
11
  }
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable */
2
- // sequence-metadata v0.4.0 f1264bc1871ed85b966466b348374ace021d3723
2
+ // sequence-metadata v0.4.0 376fc6f21f770a4d0457a039d13b6aca6d174e3f
3
3
  // --
4
4
  // This file has been generated by https://github.com/webrpc/webrpc using gen/typescript
5
5
  // Do not edit by hand. Update your webrpc schema and re-generate.
@@ -11,18 +11,32 @@ export const WebRPCVersion = "v1"
11
11
  export const WebRPCSchemaVersion = "v0.4.0"
12
12
 
13
13
  // Schema hash generated from your RIDL schema
14
- export const WebRPCSchemaHash = "f1264bc1871ed85b966466b348374ace021d3723"
14
+ export const WebRPCSchemaHash = "376fc6f21f770a4d0457a039d13b6aca6d174e3f"
15
15
 
16
16
 
17
17
  //
18
18
  // Types
19
19
  //
20
+ export enum ContractType {
21
+ ERC20 = 'ERC20',
22
+ ContractURI = 'ContractURI',
23
+ OpenSea = 'OpenSea',
24
+ ERC1155 = 'ERC1155',
25
+ ERC721 = 'ERC721',
26
+ UNKNOWN = 'UNKNOWN'
27
+ }
28
+
20
29
  export enum SwapType {
21
30
  UNKNOWN = 'UNKNOWN',
22
31
  BUY = 'BUY',
23
32
  SELL = 'SELL'
24
33
  }
25
34
 
35
+ export enum SortOrder {
36
+ DESC = 'DESC',
37
+ ASC = 'ASC'
38
+ }
39
+
26
40
  export interface Version {
27
41
  webrpcVersion: string
28
42
  schemaVersion: string
@@ -43,13 +57,20 @@ export interface RuntimeStatus {
43
57
  export interface RuntimeChecks {
44
58
  }
45
59
 
60
+ export interface ContractIndex {
61
+ chainId: string
62
+ address: string
63
+ type: ContractType
64
+ metadata: {[key: string]: any}
65
+ }
66
+
46
67
  export interface ContractInfo {
47
68
  chainId: number
48
69
  address: string
49
70
  name: string
50
71
  type: string
51
72
  symbol: string
52
- decimals: number
73
+ decimals?: number
53
74
  logoURI: string
54
75
  extensions: ContractInfoExtensions
55
76
  }
@@ -60,6 +81,15 @@ export interface ContractInfoExtensions {
60
81
  ogImage: string
61
82
  originChainId: number
62
83
  originAddress: string
84
+ blacklist: boolean
85
+ }
86
+
87
+ export interface TokenIndex {
88
+ chainId: string
89
+ contractAddress: string
90
+ tokenId: string
91
+ metadata: {[key: string]: any}
92
+
63
93
  }
64
94
 
65
95
  export interface TokenMetadata {
@@ -70,9 +100,12 @@ export interface TokenMetadata {
70
100
  image: string
71
101
  decimals: number
72
102
  properties: {[key: string]: any}
103
+ video: string
104
+ audio: string
73
105
  image_data: string
74
106
  external_url: string
75
107
  background_color: string
108
+ animation_url: string
76
109
  attributes: Array<{[key: string]: any}>
77
110
  }
78
111
 
@@ -82,12 +115,24 @@ export interface GetNiftyswapUnitPricesRequest {
82
115
  amounts: Array<string>
83
116
  }
84
117
 
118
+ export interface Page {
119
+ pageSize?: number
120
+ page?: number
121
+ }
122
+
123
+ export interface SortBy {
124
+ column: string
125
+ order: SortOrder
126
+ }
127
+
85
128
  export interface Metadata {
86
129
  ping(headers?: object): Promise<PingReturn>
87
130
  version(headers?: object): Promise<VersionReturn>
88
131
  runtimeStatus(headers?: object): Promise<RuntimeStatusReturn>
89
132
  getTokenMetadata(args: GetTokenMetadataArgs, headers?: object): Promise<GetTokenMetadataReturn>
90
133
  getTokenMetadataBatch(args: GetTokenMetadataBatchArgs, headers?: object): Promise<GetTokenMetadataBatchReturn>
134
+ searchTokenMetadata(args: SearchTokenMetadataArgs, headers?: object): Promise<SearchTokenMetadataReturn>
135
+ searchTokenIDs(args: SearchTokenIDsArgs, headers?: object): Promise<SearchTokenIDsReturn>
91
136
  getContractInfo(args: GetContractInfoArgs, headers?: object): Promise<GetContractInfoReturn>
92
137
  getContractInfoBatch(args: GetContractInfoBatchArgs, headers?: object): Promise<GetContractInfoBatchReturn>
93
138
  searchContractInfo(args: SearchContractInfoArgs, headers?: object): Promise<SearchContractInfoReturn>
@@ -131,6 +176,28 @@ export interface GetTokenMetadataBatchArgs {
131
176
  export interface GetTokenMetadataBatchReturn {
132
177
  contractTokenMetadata: {[key: string]: Array<TokenMetadata>}
133
178
  }
179
+ export interface SearchTokenMetadataArgs {
180
+ chainID: string
181
+ contractAddress: string
182
+ filter: string
183
+ page?: Page
184
+ }
185
+
186
+ export interface SearchTokenMetadataReturn {
187
+ page: Page
188
+ tokenMetadata: Array<TokenMetadata>
189
+ }
190
+ export interface SearchTokenIDsArgs {
191
+ chainID: string
192
+ contractAddress: string
193
+ filter: string
194
+ page?: Page
195
+ }
196
+
197
+ export interface SearchTokenIDsReturn {
198
+ page: Page
199
+ tokenIds: Array<string>
200
+ }
134
201
  export interface GetContractInfoArgs {
135
202
  chainID: string
136
203
  contractAddress: string
@@ -262,6 +329,32 @@ export class Metadata implements Metadata {
262
329
  })
263
330
  }
264
331
 
332
+ searchTokenMetadata = (args: SearchTokenMetadataArgs, headers?: object): Promise<SearchTokenMetadataReturn> => {
333
+ return this.fetch(
334
+ this.url('SearchTokenMetadata'),
335
+ createHTTPRequest(args, headers)).then((res) => {
336
+ return buildResponse(res).then(_data => {
337
+ return {
338
+ page: <Page>(_data.page),
339
+ tokenMetadata: <Array<TokenMetadata>>(_data.tokenMetadata)
340
+ }
341
+ })
342
+ })
343
+ }
344
+
345
+ searchTokenIDs = (args: SearchTokenIDsArgs, headers?: object): Promise<SearchTokenIDsReturn> => {
346
+ return this.fetch(
347
+ this.url('SearchTokenIDs'),
348
+ createHTTPRequest(args, headers)).then((res) => {
349
+ return buildResponse(res).then(_data => {
350
+ return {
351
+ page: <Page>(_data.page),
352
+ tokenIds: <Array<string>>(_data.tokenIds)
353
+ }
354
+ })
355
+ })
356
+ }
357
+
265
358
  getContractInfo = (args: GetContractInfoArgs, headers?: object): Promise<GetContractInfoReturn> => {
266
359
  return this.fetch(
267
360
  this.url('GetContractInfo'),
@@ -366,4 +459,4 @@ const buildResponse = (res: Response): Promise<any> => {
366
459
  })
367
460
  }
368
461
 
369
- export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>
462
+ export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>