@dfns/sdk 0.6.9-rc.2 → 0.6.10

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.
@@ -6,6 +6,7 @@ export declare class StakingClient {
6
6
  createStake(request: T.CreateStakeRequest): Promise<T.CreateStakeResponse>;
7
7
  createStakeAction(request: T.CreateStakeActionRequest): Promise<T.CreateStakeActionResponse>;
8
8
  getStakeRewards(request: T.GetStakeRewardsRequest): Promise<T.GetStakeRewardsResponse>;
9
- listStakeActions(request?: T.ListStakeActionsRequest): Promise<T.ListStakeActionsResponse>;
9
+ getStakes(request: T.GetStakesRequest): Promise<T.GetStakesResponse>;
10
+ listStakeActions(request: T.ListStakeActionsRequest): Promise<T.ListStakeActionsResponse>;
10
11
  listStakes(request?: T.ListStakesRequest): Promise<T.ListStakesResponse>;
11
12
  }
@@ -44,10 +44,21 @@ class StakingClient {
44
44
  });
45
45
  return response.json();
46
46
  }
47
+ async getStakes(request) {
48
+ const path = (0, url_1.buildPathAndQuery)('/staking/stakes/:stakeId', {
49
+ path: request ?? {},
50
+ query: request.query ?? {},
51
+ });
52
+ const response = await (0, fetch_1.simpleFetch)(path, {
53
+ method: 'GET',
54
+ apiOptions: this.apiOptions,
55
+ });
56
+ return response.json();
57
+ }
47
58
  async listStakeActions(request) {
48
59
  const path = (0, url_1.buildPathAndQuery)('/staking/stakes/:stakeId/actions', {
49
60
  path: request ?? {},
50
- query: request?.query ?? {},
61
+ query: request.query ?? {},
51
62
  });
52
63
  const response = await (0, fetch_1.simpleFetch)(path, {
53
64
  method: 'GET',
@@ -9,6 +9,7 @@ export declare class DelegatedStakingClient {
9
9
  createStakeActionInit(request: T.CreateStakeActionRequest): Promise<UserActionChallengeResponse>;
10
10
  createStakeActionComplete(request: T.CreateStakeActionRequest, signedChallenge: SignUserActionChallengeRequest): Promise<T.CreateStakeActionResponse>;
11
11
  getStakeRewards(request: T.GetStakeRewardsRequest): Promise<T.GetStakeRewardsResponse>;
12
- listStakeActions(request?: T.ListStakeActionsRequest): Promise<T.ListStakeActionsResponse>;
12
+ getStakes(request: T.GetStakesRequest): Promise<T.GetStakesResponse>;
13
+ listStakeActions(request: T.ListStakeActionsRequest): Promise<T.ListStakeActionsResponse>;
13
14
  listStakes(request?: T.ListStakesRequest): Promise<T.ListStakesResponse>;
14
15
  }
@@ -73,10 +73,21 @@ class DelegatedStakingClient {
73
73
  });
74
74
  return response.json();
75
75
  }
76
+ async getStakes(request) {
77
+ const path = (0, url_1.buildPathAndQuery)('/staking/stakes/:stakeId', {
78
+ path: request ?? {},
79
+ query: request.query ?? {},
80
+ });
81
+ const response = await (0, fetch_1.simpleFetch)(path, {
82
+ method: 'GET',
83
+ apiOptions: this.apiOptions,
84
+ });
85
+ return response.json();
86
+ }
76
87
  async listStakeActions(request) {
77
88
  const path = (0, url_1.buildPathAndQuery)('/staking/stakes/:stakeId/actions', {
78
89
  path: request ?? {},
79
- query: request?.query ?? {},
90
+ query: request.query ?? {},
80
91
  });
81
92
  const response = await (0, fetch_1.simpleFetch)(path, {
82
93
  method: 'GET',
@@ -350,6 +350,130 @@ export type GetStakeRewardsResponse = {
350
350
  balance: string;
351
351
  } | undefined;
352
352
  export type GetStakeRewardsRequest = GetStakeRewardsParams;
353
+ export type GetStakesParams = {
354
+ stakeId: string;
355
+ };
356
+ export type GetStakesQuery = {
357
+ limit?: number | undefined;
358
+ paginationToken?: string | undefined;
359
+ };
360
+ export type GetStakesResponse = {
361
+ id: string;
362
+ provider?: ("Figment") | undefined;
363
+ walletId: string;
364
+ status: "Active" | "Creating" | "Failed" | "Unbonding" | "Unbond" | "Withdrawing" | "Withdrawn";
365
+ requester: {
366
+ userId: string;
367
+ tokenId?: string | undefined;
368
+ appId?: string | undefined;
369
+ };
370
+ requestBody: {
371
+ protocol: "Babylon";
372
+ walletId: string;
373
+ provider: "Figment";
374
+ amount: string;
375
+ duration: number;
376
+ } | {
377
+ protocol: "Ethereum";
378
+ walletId: string;
379
+ provider: "Figment";
380
+ amount: string;
381
+ } | {
382
+ protocol: "Iota";
383
+ walletId: string;
384
+ validator: string;
385
+ amount?: string | undefined;
386
+ lockedIotas?: string[] | undefined;
387
+ };
388
+ dateCreated: string;
389
+ protocol: "Babylon";
390
+ data: {
391
+ finalityProviders: string[];
392
+ covenantPubkeys: string[];
393
+ magicBytes: string;
394
+ covenantThreshold: number;
395
+ minUnbondingTime: number;
396
+ lockHeight: number;
397
+ };
398
+ } | {
399
+ id: string;
400
+ provider?: ("Figment") | undefined;
401
+ walletId: string;
402
+ status: "Active" | "Creating" | "Failed" | "Unbonding" | "Unbond" | "Withdrawing" | "Withdrawn";
403
+ requester: {
404
+ userId: string;
405
+ tokenId?: string | undefined;
406
+ appId?: string | undefined;
407
+ };
408
+ requestBody: {
409
+ protocol: "Babylon";
410
+ walletId: string;
411
+ provider: "Figment";
412
+ amount: string;
413
+ duration: number;
414
+ } | {
415
+ protocol: "Ethereum";
416
+ walletId: string;
417
+ provider: "Figment";
418
+ amount: string;
419
+ } | {
420
+ protocol: "Iota";
421
+ walletId: string;
422
+ validator: string;
423
+ amount?: string | undefined;
424
+ lockedIotas?: string[] | undefined;
425
+ };
426
+ dateCreated: string;
427
+ protocol: "Iota";
428
+ data: {
429
+ stakedObjectId?: string | undefined;
430
+ expirationDate?: string | undefined;
431
+ amount: string;
432
+ validator: string;
433
+ };
434
+ } | {
435
+ id: string;
436
+ provider?: ("Figment") | undefined;
437
+ walletId: string;
438
+ status: "Active" | "Creating" | "Failed" | "Unbonding" | "Unbond" | "Withdrawing" | "Withdrawn";
439
+ requester: {
440
+ userId: string;
441
+ tokenId?: string | undefined;
442
+ appId?: string | undefined;
443
+ };
444
+ requestBody: {
445
+ protocol: "Babylon";
446
+ walletId: string;
447
+ provider: "Figment";
448
+ amount: string;
449
+ duration: number;
450
+ } | {
451
+ protocol: "Ethereum";
452
+ walletId: string;
453
+ provider: "Figment";
454
+ amount: string;
455
+ } | {
456
+ protocol: "Iota";
457
+ walletId: string;
458
+ validator: string;
459
+ amount?: string | undefined;
460
+ lockedIotas?: string[] | undefined;
461
+ };
462
+ dateCreated: string;
463
+ protocol: "Ethereum";
464
+ data: {
465
+ validators: {
466
+ pubkey: string;
467
+ withdrawalAddress: string;
468
+ }[];
469
+ };
470
+ };
471
+ export type GetStakesRequest = GetStakesParams & {
472
+ query?: GetStakesQuery;
473
+ };
474
+ export type ListStakeActionsParams = {
475
+ stakeId: string;
476
+ };
353
477
  export type ListStakeActionsQuery = {
354
478
  limit?: number | undefined;
355
479
  paginationToken?: string | undefined;
@@ -398,7 +522,7 @@ export type ListStakeActionsResponse = {
398
522
  }[];
399
523
  nextPageToken?: string | undefined;
400
524
  };
401
- export type ListStakeActionsRequest = {
525
+ export type ListStakeActionsRequest = ListStakeActionsParams & {
402
526
  query?: ListStakeActionsQuery;
403
527
  };
404
528
  export type ListStakesQuery = {