Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async claim(order: Order): Promise {
if (order.kind === OrderKind.ACTIONS_ORDER) {
order = normalizeActionsOrderIds(order, this._provider);
if (this._provider.signMethod == SignMethod.PERSONAL_SIGN) {
return actionsOrderClaimPersonalSign(this, order);
} else {
return actionsOrderClaimEthSign(this, order);
}
} else if (order.kind === OrderKind.ASSET_LEDGER_DEPLOY_ORDER) {
order = normalizeAssetLedgerDeployOrderIds(order, this._provider);
if (this._provider.signMethod == SignMethod.PERSONAL_SIGN) {
return assetLedgerDeployOrderClaimPersonalSign(this, order);
} else {
return assetLedgerDeployOrderClaimEthSign(this, order);
}
} else if (order.kind === OrderKind.VALUE_LEDGER_DEPLOY_ORDER) {
order = normalizeValueLedgerDeployOrderIds(order, this._provider);
if (this._provider.signMethod == SignMethod.PERSONAL_SIGN) {
return valueLedgerDeployOrderClaimPersonalSign(this, order);
} else {
return valueLedgerDeployOrderClaimEthSign(this, order);
}
} else {
throw new Error('Not implemented');
}
}
public async claim(deploy: Deploy): Promise {
deploy = normalizeDeployIds(deploy, this._provider);
if (this._provider.signMethod == SignMethod.PERSONAL_SIGN) {
return claimPersonalSign(this, deploy);
} else {
return claimEthSign(this, deploy);
}
}
public constructor(options?: MetamaskProviderOptions) {
super({
...options,
signMethod: SignMethod.PERSONAL_SIGN,
});
if (this.isSupported()) {
this.installClient();
this.installEvents();
}
}