@ocap/sdk 1.21.3 → 1.22.0

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.
Files changed (2) hide show
  1. package/index.d.ts +115 -1
  2. package/package.json +7 -7
package/index.d.ts CHANGED
@@ -328,7 +328,7 @@ export {};
328
328
  import * as LibMessage from './lib/message';
329
329
  declare const _OcapMessage: typeof LibMessage;
330
330
  export = _OcapMessage;
331
- import { TCreateAssetTx, TCreateFactoryTx, TCreateRollupTx, TCreateTokenTx } from '@ocap/types';
331
+ import { TCreateAssetTx, TCreateFactoryTx, TCreateRollupTx, TCreateTokenTx, CreateTokenFactoryTx } from '@ocap/types';
332
332
  /**
333
333
  * Create an itx address
334
334
  */
@@ -345,6 +345,10 @@ export declare function toFactoryAddress(itx: Partial<TCreateFactoryTx>): string
345
345
  * Create an token address
346
346
  */
347
347
  export declare function toTokenAddress(itx: Partial<TCreateTokenTx>): string;
348
+ /**
349
+ * Create a token factory address
350
+ */
351
+ export declare function toTokenFactoryAddress(itx: Partial<CreateTokenFactoryTx>): string;
348
352
  /**
349
353
  * Create an rollup address
350
354
  */
@@ -429,6 +433,7 @@ declare interface OcapSDK {
429
433
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.AcquireAssetV3Tx>>,
430
434
  extra?: any
431
435
  ): Promise<string>;
436
+ sendBurnTokenTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.BurnTokenTx>>, extra?: any): Promise<string>;
432
437
  sendClaimBlockRewardTx(
433
438
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ClaimBlockRewardTx>>,
434
439
  extra?: any
@@ -458,6 +463,10 @@ declare interface OcapSDK {
458
463
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateRollupTx>>,
459
464
  extra?: any
460
465
  ): Promise<string>;
466
+ sendCreateTokenFactoryTx(
467
+ param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateTokenFactoryTx>>,
468
+ extra?: any
469
+ ): Promise<string>;
461
470
  sendCreateTokenTx(
462
471
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateTokenTx>>,
463
472
  extra?: any
@@ -479,6 +488,7 @@ declare interface OcapSDK {
479
488
  extra?: any
480
489
  ): Promise<string>;
481
490
  sendMintAssetTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.MintAssetTx>>, extra?: any): Promise<string>;
491
+ sendMintTokenTx(param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.MintTokenTx>>, extra?: any): Promise<string>;
482
492
  sendPauseRollupTx(
483
493
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.PauseRollupTx>>,
484
494
  extra?: any
@@ -512,6 +522,10 @@ declare interface OcapSDK {
512
522
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpdateRollupTx>>,
513
523
  extra?: any
514
524
  ): Promise<string>;
525
+ sendUpdateTokenFactoryTx(
526
+ param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpdateTokenFactoryTx>>,
527
+ extra?: any
528
+ ): Promise<string>;
515
529
  sendUpgradeNodeTx(
516
530
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpgradeNodeTx>>,
517
531
  extra?: any
@@ -529,6 +543,9 @@ declare interface OcapSDK {
529
543
  encodeAcquireAssetV3Tx(
530
544
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.AcquireAssetV3Tx>>
531
545
  ): Promise<GraphQLClient.EncodeTxResult>;
546
+ encodeBurnTokenTx(
547
+ param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.BurnTokenTx>>
548
+ ): Promise<GraphQLClient.EncodeTxResult>;
532
549
  encodeClaimBlockRewardTx(
533
550
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ClaimBlockRewardTx>>
534
551
  ): Promise<GraphQLClient.EncodeTxResult>;
@@ -553,6 +570,9 @@ declare interface OcapSDK {
553
570
  encodeCreateRollupTx(
554
571
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateRollupTx>>
555
572
  ): Promise<GraphQLClient.EncodeTxResult>;
573
+ encodeCreateTokenFactoryTx(
574
+ param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateTokenFactoryTx>>
575
+ ): Promise<GraphQLClient.EncodeTxResult>;
556
576
  encodeCreateTokenTx(
557
577
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateTokenTx>>
558
578
  ): Promise<GraphQLClient.EncodeTxResult>;
@@ -580,6 +600,9 @@ declare interface OcapSDK {
580
600
  encodeMintAssetTx(
581
601
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.MintAssetTx>>
582
602
  ): Promise<GraphQLClient.EncodeTxResult>;
603
+ encodeMintTokenTx(
604
+ param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.MintTokenTx>>
605
+ ): Promise<GraphQLClient.EncodeTxResult>;
583
606
  encodePauseRollupTx(
584
607
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.PauseRollupTx>>
585
608
  ): Promise<GraphQLClient.EncodeTxResult>;
@@ -616,6 +639,9 @@ declare interface OcapSDK {
616
639
  encodeUpdateRollupTx(
617
640
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpdateRollupTx>>
618
641
  ): Promise<GraphQLClient.EncodeTxResult>;
642
+ encodeUpdateTokenFactoryTx(
643
+ param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpdateTokenFactoryTx>>
644
+ ): Promise<GraphQLClient.EncodeTxResult>;
619
645
  encodeUpgradeNodeTx(
620
646
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpgradeNodeTx>>
621
647
  ): Promise<GraphQLClient.EncodeTxResult>;
@@ -631,6 +657,9 @@ declare interface OcapSDK {
631
657
  signAcquireAssetV3Tx(
632
658
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.AcquireAssetV3Tx>>
633
659
  ): Promise<GraphQLClient.Transaction>;
660
+ signBurnTokenTx(
661
+ param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.BurnTokenTx>>
662
+ ): Promise<GraphQLClient.Transaction>;
634
663
  signClaimBlockRewardTx(
635
664
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.ClaimBlockRewardTx>>
636
665
  ): Promise<GraphQLClient.Transaction>;
@@ -655,6 +684,9 @@ declare interface OcapSDK {
655
684
  signCreateRollupTx(
656
685
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateRollupTx>>
657
686
  ): Promise<GraphQLClient.Transaction>;
687
+ signCreateTokenFactoryTx(
688
+ param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateTokenFactoryTx>>
689
+ ): Promise<GraphQLClient.Transaction>;
658
690
  signCreateTokenTx(
659
691
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.CreateTokenTx>>
660
692
  ): Promise<GraphQLClient.Transaction>;
@@ -682,6 +714,9 @@ declare interface OcapSDK {
682
714
  signMintAssetTx(
683
715
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.MintAssetTx>>
684
716
  ): Promise<GraphQLClient.Transaction>;
717
+ signMintTokenTx(
718
+ param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.MintTokenTx>>
719
+ ): Promise<GraphQLClient.Transaction>;
685
720
  signPauseRollupTx(
686
721
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.PauseRollupTx>>
687
722
  ): Promise<GraphQLClient.Transaction>;
@@ -716,6 +751,9 @@ declare interface OcapSDK {
716
751
  signUpdateRollupTx(
717
752
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpdateRollupTx>>
718
753
  ): Promise<GraphQLClient.Transaction>;
754
+ signUpdateTokenFactoryTx(
755
+ param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpdateTokenFactoryTx>>
756
+ ): Promise<GraphQLClient.Transaction>;
719
757
  signUpgradeNodeTx(
720
758
  param: GraphQLClient.TxParam<PartialDeep<GraphQLClient.UpgradeNodeTx>>
721
759
  ): Promise<GraphQLClient.Transaction>;
@@ -788,6 +826,9 @@ declare interface OcapSDK {
788
826
  params: PartialDeep<GraphQLClient.GetEvidenceStateParams>
789
827
  ): Promise<GraphQLClient.ResponseGetEvidenceState>;
790
828
  getForgeState(params: PartialDeep<GraphQLClient.GetForgeStateParams>): Promise<GraphQLClient.ResponseGetForgeState>;
829
+ getTokenFactoryState(
830
+ params: PartialDeep<GraphQLClient.GetTokenFactoryStateParams>
831
+ ): Promise<GraphQLClient.ResponseGetTokenFactoryState>;
791
832
  getTx(params: PartialDeep<GraphQLClient.GetTxParams>): Promise<GraphQLClient.ResponseGetTx>;
792
833
  getBlock(params: PartialDeep<GraphQLClient.GetBlockParams>): Promise<GraphQLClient.ResponseGetBlock>;
793
834
  getBlocks(params: PartialDeep<GraphQLClient.GetBlocksParams>): Promise<GraphQLClient.ResponseGetBlocks>;
@@ -845,6 +886,9 @@ declare interface OcapSDK {
845
886
  getTokenDistribution(
846
887
  params: PartialDeep<GraphQLClient.GetTokenDistributionParams>
847
888
  ): Promise<GraphQLClient.ResponseGetTokenDistribution>;
889
+ listTokenFactories(
890
+ params: PartialDeep<GraphQLClient.ListTokenFactoriesParams>
891
+ ): Promise<GraphQLClient.ResponseListTokenFactories>;
848
892
  sendTx(params: PartialDeep<GraphQLClient.SendTxParams>): Promise<GraphQLClient.ResponseSendTx>;
849
893
  }
850
894
 
@@ -1242,6 +1286,7 @@ declare namespace GraphQLClient {
1242
1286
  rollupFilter: GraphQLClient.RollupFilterInput;
1243
1287
  stakeFilter: GraphQLClient.StakeFilterInput;
1244
1288
  delegationFilter: GraphQLClient.DelegationFilterInput;
1289
+ tokenFactoryFilter: GraphQLClient.TokenFactoryFilterInput;
1245
1290
  }
1246
1291
 
1247
1292
  interface RequestSearchInput {
@@ -1276,6 +1321,10 @@ declare namespace GraphQLClient {
1276
1321
  field: string;
1277
1322
  }
1278
1323
 
1324
+ interface TokenFactoryFilterInput {
1325
+ tokenFactories: string[];
1326
+ }
1327
+
1279
1328
  interface TokenFilterInput {
1280
1329
  tokens: string[];
1281
1330
  }
@@ -1631,6 +1680,14 @@ declare namespace GraphQLClient {
1631
1680
  data: GraphQLClient.Any;
1632
1681
  }
1633
1682
 
1683
+ interface CurveConfig {
1684
+ type: string;
1685
+ basePrice: string;
1686
+ fixedPrice: string;
1687
+ slope: string;
1688
+ constant: number;
1689
+ }
1690
+
1634
1691
  interface DelegateConfig {
1635
1692
  deltaInterval: number;
1636
1693
  typeUrls: string[];
@@ -1987,6 +2044,23 @@ declare namespace GraphQLClient {
1987
2044
  data: GraphQLClient.Any;
1988
2045
  }
1989
2046
 
2047
+ interface IndexedTokenFactoryState {
2048
+ address: string;
2049
+ owner: string;
2050
+ tokenAddress: string;
2051
+ reserveAddress: string;
2052
+ curve: GraphQLClient.CurveConfig;
2053
+ feeRate: number;
2054
+ currentSupply: string;
2055
+ reserveBalance: string;
2056
+ status: string;
2057
+ genesisTime: string;
2058
+ renaissanceTime: string;
2059
+ token: GraphQLClient.IndexedTokenInput;
2060
+ reserveToken: GraphQLClient.IndexedTokenInput;
2061
+ data: GraphQLClient.Any;
2062
+ }
2063
+
1990
2064
  interface IndexedTokenFlow {
1991
2065
  value: string;
1992
2066
  hash: string;
@@ -2015,6 +2089,7 @@ declare namespace GraphQLClient {
2015
2089
  genesisTime: string;
2016
2090
  renaissanceTime: string;
2017
2091
  foreignToken: GraphQLClient.ForeignToken;
2092
+ tokenFactoryAddress: string;
2018
2093
  data: GraphQLClient.Any;
2019
2094
  }
2020
2095
 
@@ -2261,6 +2336,11 @@ declare namespace GraphQLClient {
2261
2336
  data: GraphQLClient.TokenDistribution;
2262
2337
  }
2263
2338
 
2339
+ interface ResponseGetTokenFactoryState {
2340
+ code: string;
2341
+ state: GraphQLClient.TokenFactoryState;
2342
+ }
2343
+
2264
2344
  interface ResponseGetTokenState {
2265
2345
  code: string;
2266
2346
  state: GraphQLClient.TokenState;
@@ -2336,6 +2416,12 @@ declare namespace GraphQLClient {
2336
2416
  stakes: GraphQLClient.IndexedStakeState[];
2337
2417
  }
2338
2418
 
2419
+ interface ResponseListTokenFactories {
2420
+ code: string;
2421
+ page: GraphQLClient.PageInfo;
2422
+ tokenFactories: GraphQLClient.IndexedTokenFactoryState[];
2423
+ }
2424
+
2339
2425
  interface ResponseListTokenFlows {
2340
2426
  code: string;
2341
2427
  page: GraphQLClient.PageInfo;
@@ -2531,6 +2617,20 @@ declare namespace GraphQLClient {
2531
2617
  gasStake: string;
2532
2618
  }
2533
2619
 
2620
+ interface TokenFactoryState {
2621
+ address: string;
2622
+ tokenAddress: string;
2623
+ reserveAddress: string;
2624
+ currentSupply: string;
2625
+ reserveBalance: string;
2626
+ feeRate: number;
2627
+ curve: GraphQLClient.CurveConfig;
2628
+ context: GraphQLClient.StateContext;
2629
+ token: GraphQLClient.TokenState;
2630
+ reserveToken: GraphQLClient.TokenState;
2631
+ data: GraphQLClient.Any;
2632
+ }
2633
+
2534
2634
  interface TokenInfo {
2535
2635
  address: string;
2536
2636
  balance: string;
@@ -2570,6 +2670,7 @@ declare namespace GraphQLClient {
2570
2670
  icon: string;
2571
2671
  totalSupply: string;
2572
2672
  foreignToken: GraphQLClient.ForeignToken;
2673
+ tokenFactoryAddress: string;
2573
2674
  context: GraphQLClient.StateContext;
2574
2675
  data: GraphQLClient.Any;
2575
2676
  }
@@ -2833,6 +2934,10 @@ declare namespace GraphQLClient {
2833
2934
  keys: string[];
2834
2935
  }
2835
2936
 
2937
+ interface GetTokenFactoryStateParams {
2938
+ address: string;
2939
+ }
2940
+
2836
2941
  interface GetTxParams {
2837
2942
  hash: string;
2838
2943
  }
@@ -2896,6 +3001,7 @@ declare namespace GraphQLClient {
2896
3001
  rollupFilter: GraphQLClient.RollupFilterInput;
2897
3002
  stakeFilter: GraphQLClient.StakeFilterInput;
2898
3003
  delegationFilter: GraphQLClient.DelegationFilterInput;
3004
+ tokenFactoryFilter: GraphQLClient.TokenFactoryFilterInput;
2899
3005
  }
2900
3006
 
2901
3007
  interface ListTokensParams {
@@ -2998,6 +3104,14 @@ declare namespace GraphQLClient {
2998
3104
  tokenAddress: string;
2999
3105
  }
3000
3106
 
3107
+ interface ListTokenFactoriesParams {
3108
+ tokenAddress: string;
3109
+ reserveAddress: string;
3110
+ owner: string;
3111
+ paging: GraphQLClient.PageInput;
3112
+ timeFilter: GraphQLClient.TimeFilterInput;
3113
+ }
3114
+
3001
3115
  interface SendTxParams {
3002
3116
  commit: boolean;
3003
3117
  token: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ocap/sdk",
3
3
  "description": "Forge javascript SDK packages all-in-one",
4
- "version": "1.21.3",
4
+ "version": "1.22.0",
5
5
  "author": {
6
6
  "name": "wangshijun",
7
7
  "email": "shijun@arcblock.io",
@@ -22,11 +22,11 @@
22
22
  "debug": "^4.3.6",
23
23
  "react-app-polyfill": "^1.0.6",
24
24
  "readable-stream": "3.6.0",
25
- "@arcblock/did-util": "1.21.3",
26
- "@ocap/client": "1.21.3",
27
- "@ocap/message": "1.21.3",
28
- "@ocap/util": "1.21.3",
29
- "@ocap/wallet": "1.21.3"
25
+ "@arcblock/did-util": "1.22.0",
26
+ "@ocap/client": "1.22.0",
27
+ "@ocap/util": "1.22.0",
28
+ "@ocap/message": "1.22.0",
29
+ "@ocap/wallet": "1.22.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "inspectpack": "^4.7.1",
@@ -39,7 +39,7 @@
39
39
  "webpack": "^5.94.0",
40
40
  "webpack-bundle-analyzer": "^4.10.2",
41
41
  "webpack-cli": "^5.1.4",
42
- "@ocap/e2e-test": "1.21.3"
42
+ "@ocap/e2e-test": "1.22.0"
43
43
  },
44
44
  "remarkConfig": {
45
45
  "plugins": [