Skip to content

Commit

Permalink
feat: allow the SDK to be instanced with an account that has no identity
Browse files Browse the repository at this point in the history
The current identity is now fetched from the chain whenever it is used

BREAKING CHANGE: `getIdentity` in the `Polymesh` class is now async
  • Loading branch information
monitz87 committed Aug 28, 2020
1 parent da3a97f commit f71cd3a
Show file tree
Hide file tree
Showing 114 changed files with 583 additions and 710 deletions.
22 changes: 11 additions & 11 deletions docs/classes/authorizationrequest.md
Expand Up @@ -35,7 +35,7 @@ who then has to accept it in order for the ownership transfer to be complete

**authId**: *BigNumber*

*Defined in [src/api/entities/AuthorizationRequest.ts:71](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/api/entities/AuthorizationRequest.ts#L71)*
*Defined in [src/api/entities/AuthorizationRequest.ts:71](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/api/entities/AuthorizationRequest.ts#L71)*

internal identifier for the request (used to accept/reject/cancel)

Expand All @@ -47,15 +47,15 @@ ___

*Inherited from [Entity](entity.md).[context](entity.md#protected-context)*

*Defined in [src/base/Entity.ts:49](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/base/Entity.ts#L49)*
*Defined in [src/base/Entity.ts:49](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/base/Entity.ts#L49)*

___

### data

**data**: *[Authorization](../globals.md#authorization)*

*Defined in [src/api/entities/AuthorizationRequest.ts:60](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/api/entities/AuthorizationRequest.ts#L60)*
*Defined in [src/api/entities/AuthorizationRequest.ts:60](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/api/entities/AuthorizationRequest.ts#L60)*

authorization request data corresponding to type of authorization

Expand All @@ -76,7 +76,7 @@ ___

**expiry**: *Date | null*

*Defined in [src/api/entities/AuthorizationRequest.ts:66](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/api/entities/AuthorizationRequest.ts#L66)*
*Defined in [src/api/entities/AuthorizationRequest.ts:66](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/api/entities/AuthorizationRequest.ts#L66)*

date at which the authorization request expires and can no longer be accepted.
At this point, a new authorization request must be emitted. Null if the request never expires
Expand All @@ -87,7 +87,7 @@ ___

**issuerIdentity**: *[Identity](identity.md)*

*Defined in [src/api/entities/AuthorizationRequest.ts:44](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/api/entities/AuthorizationRequest.ts#L44)*
*Defined in [src/api/entities/AuthorizationRequest.ts:44](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/api/entities/AuthorizationRequest.ts#L44)*

Identity that emitted the request

Expand All @@ -97,7 +97,7 @@ ___

**targetIdentity**: *[Identity](identity.md)*

*Defined in [src/api/entities/AuthorizationRequest.ts:39](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/api/entities/AuthorizationRequest.ts#L39)*
*Defined in [src/api/entities/AuthorizationRequest.ts:39](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/api/entities/AuthorizationRequest.ts#L39)*

Identity to which the request was emitted

Expand All @@ -109,15 +109,15 @@ ___

*Inherited from [Entity](entity.md).[uuid](entity.md#uuid)*

*Defined in [src/base/Entity.ts:47](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/base/Entity.ts#L47)*
*Defined in [src/base/Entity.ts:47](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/base/Entity.ts#L47)*

## Methods

### accept

**accept**(): *Promise‹[TransactionQueue](transactionqueue.md)*

*Defined in [src/api/entities/AuthorizationRequest.ts:93](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/api/entities/AuthorizationRequest.ts#L93)*
*Defined in [src/api/entities/AuthorizationRequest.ts:93](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/api/entities/AuthorizationRequest.ts#L93)*

Accept the authorization request. You must be the target of the request to be able to accept it

Expand All @@ -129,7 +129,7 @@ ___

**remove**(): *Promise‹[TransactionQueue](transactionqueue.md)*

*Defined in [src/api/entities/AuthorizationRequest.ts:106](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/api/entities/AuthorizationRequest.ts#L106)*
*Defined in [src/api/entities/AuthorizationRequest.ts:106](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/api/entities/AuthorizationRequest.ts#L106)*

Remove the authorization request

Expand All @@ -146,7 +146,7 @@ ___

*Inherited from [Entity](entity.md).[generateUuid](entity.md#static-generateuuid)*

*Defined in [src/base/Entity.ts:15](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/base/Entity.ts#L15)*
*Defined in [src/base/Entity.ts:15](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/base/Entity.ts#L15)*

Generate the Entity's UUID from its identifying properties

Expand All @@ -170,7 +170,7 @@ ___

*Inherited from [Entity](entity.md).[unserialize](entity.md#static-unserialize)*

*Defined in [src/base/Entity.ts:24](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/base/Entity.ts#L24)*
*Defined in [src/base/Entity.ts:24](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/base/Entity.ts#L24)*

Unserialize a UUID into its Unique Identifiers

Expand Down
8 changes: 4 additions & 4 deletions docs/classes/authorizations.md
Expand Up @@ -28,7 +28,7 @@ Handles all Identity Authorization related functionality

*Inherited from void*

*Defined in [src/base/Namespace.ts:12](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/base/Namespace.ts#L12)*
*Defined in [src/base/Namespace.ts:12](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/base/Namespace.ts#L12)*

___

Expand All @@ -38,15 +38,15 @@ ___

*Inherited from void*

*Defined in [src/base/Namespace.ts:10](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/base/Namespace.ts#L10)*
*Defined in [src/base/Namespace.ts:10](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/base/Namespace.ts#L10)*

## Methods

### getReceived

**getReceived**(`paginationOpts?`: [PaginationOptions](../interfaces/paginationoptions.md)): *Promise‹[ResultSet](../interfaces/resultset.md)[AuthorizationRequest](authorizationrequest.md)››*

*Defined in [src/api/entities/Identity/Authorizations.ts:30](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/api/entities/Identity/Authorizations.ts#L30)*
*Defined in [src/api/entities/Identity/Authorizations.ts:30](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/api/entities/Identity/Authorizations.ts#L30)*

Fetch all pending authorization requests for which this identity is the target

Expand All @@ -66,7 +66,7 @@ ___

**getSent**(`paginationOpts?`: [PaginationOptions](../interfaces/paginationoptions.md)): *Promise‹[ResultSet](../interfaces/resultset.md)[AuthorizationRequest](authorizationrequest.md)››*

*Defined in [src/api/entities/Identity/Authorizations.ts:64](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/api/entities/Identity/Authorizations.ts#L64)*
*Defined in [src/api/entities/Identity/Authorizations.ts:64](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/api/entities/Identity/Authorizations.ts#L64)*

Fetch all pending authorization requests issued by this identity

Expand Down
8 changes: 4 additions & 4 deletions docs/classes/compliance.md
Expand Up @@ -25,7 +25,7 @@ Handles all Security Token Compliance related functionality

*Inherited from void*

*Defined in [src/base/Namespace.ts:12](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/base/Namespace.ts#L12)*
*Defined in [src/base/Namespace.ts:12](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/base/Namespace.ts#L12)*

___

Expand All @@ -35,20 +35,20 @@ ___

*Inherited from void*

*Defined in [src/base/Namespace.ts:10](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/base/Namespace.ts#L10)*
*Defined in [src/base/Namespace.ts:10](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/base/Namespace.ts#L10)*

___

### rules

**rules**: *[Rules](rules.md)*

*Defined in [src/api/entities/SecurityToken/Compliance/index.ts:13](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/api/entities/SecurityToken/Compliance/index.ts#L13)*
*Defined in [src/api/entities/SecurityToken/Compliance/index.ts:13](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/api/entities/SecurityToken/Compliance/index.ts#L13)*

___

### trustedClaimIssuers

**trustedClaimIssuers**: *[TrustedClaimIssuers](trustedclaimissuers.md)*

*Defined in [src/api/entities/SecurityToken/Compliance/index.ts:12](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/api/entities/SecurityToken/Compliance/index.ts#L12)*
*Defined in [src/api/entities/SecurityToken/Compliance/index.ts:12](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/api/entities/SecurityToken/Compliance/index.ts#L12)*
8 changes: 4 additions & 4 deletions docs/classes/documents.md
Expand Up @@ -28,7 +28,7 @@ Handles all Security Token Document related functionality

*Inherited from void*

*Defined in [src/base/Namespace.ts:12](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/base/Namespace.ts#L12)*
*Defined in [src/base/Namespace.ts:12](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/base/Namespace.ts#L12)*

___

Expand All @@ -38,15 +38,15 @@ ___

*Inherited from void*

*Defined in [src/base/Namespace.ts:10](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/base/Namespace.ts#L10)*
*Defined in [src/base/Namespace.ts:10](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/base/Namespace.ts#L10)*

## Methods

### get

**get**(`paginationOpts?`: [PaginationOptions](../interfaces/paginationoptions.md)): *Promise‹[ResultSet](../interfaces/resultset.md)[TokenDocument](../interfaces/tokendocument.md)››*

*Defined in [src/api/entities/SecurityToken/Documents.ts:38](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/api/entities/SecurityToken/Documents.ts#L38)*
*Defined in [src/api/entities/SecurityToken/Documents.ts:38](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/api/entities/SecurityToken/Documents.ts#L38)*

Retrieve all documents linked to the Security Token

Expand All @@ -66,7 +66,7 @@ ___

**set**(`args`: [SetTokenDocumentsParams](../interfaces/settokendocumentsparams.md)): *Promise‹[TransactionQueue](transactionqueue.md)[SecurityToken](securitytoken.md)››*

*Defined in [src/api/entities/SecurityToken/Documents.ts:25](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/api/entities/SecurityToken/Documents.ts#L25)*
*Defined in [src/api/entities/SecurityToken/Documents.ts:25](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/api/entities/SecurityToken/Documents.ts#L25)*

Assign a new list of documents to the Security Token by replacing the existing list of documents with the one passed in the parameters

Expand Down
10 changes: 5 additions & 5 deletions docs/classes/entity.md
Expand Up @@ -41,23 +41,23 @@ Represents an object or resource in the Polymesh Ecosystem with its own set of p

**context**: *Context*

*Defined in [src/base/Entity.ts:49](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/base/Entity.ts#L49)*
*Defined in [src/base/Entity.ts:49](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/base/Entity.ts#L49)*

___

### uuid

**uuid**: *string*

*Defined in [src/base/Entity.ts:47](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/base/Entity.ts#L47)*
*Defined in [src/base/Entity.ts:47](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/base/Entity.ts#L47)*

## Methods

### `Static` generateUuid

**generateUuid****Identifiers**›(`identifiers`: Identifiers): *string*

*Defined in [src/base/Entity.ts:15](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/base/Entity.ts#L15)*
*Defined in [src/base/Entity.ts:15](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/base/Entity.ts#L15)*

Generate the Entity's UUID from its identifying properties

Expand All @@ -79,7 +79,7 @@ ___

**isUniqueIdentifiers**(`identifiers`: unknown): *boolean*

*Defined in [src/base/Entity.ts:43](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/base/Entity.ts#L43)*
*Defined in [src/base/Entity.ts:43](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/base/Entity.ts#L43)*

Typeguard that checks whether the object passed corresponds to the unique identifiers of the class. Must be overridden

Expand All @@ -97,7 +97,7 @@ ___

**unserialize****Identifiers**›(`serialized`: string): *Identifiers*

*Defined in [src/base/Entity.ts:24](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/base/Entity.ts#L24)*
*Defined in [src/base/Entity.ts:24](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/base/Entity.ts#L24)*

Unserialize a UUID into its Unique Identifiers

Expand Down
16 changes: 8 additions & 8 deletions docs/classes/governance.md
Expand Up @@ -23,7 +23,7 @@ Handles all Governance related functionality

**createProposal**(`args`: [CreateProposalParams](../interfaces/createproposalparams.md)): *Promise‹[TransactionQueue](transactionqueue.md)[Proposal](proposal.md)››*

*Defined in [src/Governance.ts:103](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/Governance.ts#L103)*
*Defined in [src/Governance.ts:103](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/Governance.ts#L103)*

Create a proposal

Expand All @@ -41,7 +41,7 @@ ___

**getGovernanceCommitteeMembers**(): *Promise‹[Identity](identity.md)[]*

*Defined in [src/Governance.ts:36](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/Governance.ts#L36)*
*Defined in [src/Governance.ts:36](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/Governance.ts#L36)*

Retrieve a list of all active committee members

Expand All @@ -53,7 +53,7 @@ ___

**getProposals**(`opts`: object): *Promise‹[Proposal](proposal.md)[]*

*Defined in [src/Governance.ts:69](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/Governance.ts#L69)*
*Defined in [src/Governance.ts:69](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/Governance.ts#L69)*

Retrieve a list of proposals. Can be filtered using parameters

Expand All @@ -77,7 +77,7 @@ ___

**getTransactionArguments**(`args`: object): *[TransactionArgument](../globals.md#transactionargument)[]*

*Defined in [src/Governance.ts:56](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/Governance.ts#L56)*
*Defined in [src/Governance.ts:56](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/Governance.ts#L56)*

Retrieve the types of arguments that a certain transaction requires to be run

Expand All @@ -97,7 +97,7 @@ ___

**minimumProposalDeposit**(): *Promise‹BigNumber›*

*Defined in [src/Governance.ts:112](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/Governance.ts#L112)*
*Defined in [src/Governance.ts:112](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/Governance.ts#L112)*

Get the minimum amount of POLYX that has to be deposited when creating a proposal

Expand All @@ -107,7 +107,7 @@ Get the minimum amount of POLYX that has to be deposited when creating a proposa

**minimumProposalDeposit**(`callback`: [SubCallback](../globals.md#subcallback)‹BigNumber›): *Promise‹[UnsubCallback](../globals.md#unsubcallback)*

*Defined in [src/Governance.ts:113](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/Governance.ts#L113)*
*Defined in [src/Governance.ts:113](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/Governance.ts#L113)*

**Parameters:**

Expand All @@ -123,7 +123,7 @@ ___

**proposalTimeFrames**(): *Promise‹[ProposalTimeFrames](../interfaces/proposaltimeframes.md)*

*Defined in [src/Governance.ts:146](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/Governance.ts#L146)*
*Defined in [src/Governance.ts:146](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/Governance.ts#L146)*

Retrieve the proposal time frames. This includes:

Expand All @@ -136,7 +136,7 @@ Retrieve the proposal time frames. This includes:

**proposalTimeFrames**(`callback`: [SubCallback](../globals.md#subcallback)[ProposalTimeFrames](../interfaces/proposaltimeframes.md)›): *Promise‹[UnsubCallback](../globals.md#unsubcallback)*

*Defined in [src/Governance.ts:147](https://github.com/PolymathNetwork/polymesh-sdk/blob/4b9adaf/src/Governance.ts#L147)*
*Defined in [src/Governance.ts:147](https://github.com/PolymathNetwork/polymesh-sdk/blob/da3a97f/src/Governance.ts#L147)*

**Parameters:**

Expand Down

0 comments on commit f71cd3a

Please sign in to comment.