mirror of
https://github.com/wharfkit/signing-request.git
synced 2026-07-21 16:03:29 +00:00
3.x release (#37)
* Starting migration to Wharfkit namespace and libs * Version 3.0.0-beta1 * Updating package name * Version 3.1.0-rc1 * Updating to @wharfkit/antelope 1.0.0 * Removing embedded ABIs in an unideal way until fixes are implemented * Version 3.1.0
This commit is contained in:
+7
-7
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "eosio-signing-request",
|
"name": "@wharfkit/signing-request",
|
||||||
"version": "2.5.3",
|
"version": "3.1.0",
|
||||||
"description": "EOSIO Signing Request (ESR / EEP-7) encoder and decoder",
|
"description": "Signing Request (ESR / EEP-7) encoder and decoder for Antelope blockchains",
|
||||||
"homepage": "https://github.com/greymass/eosio-signing-request",
|
"homepage": "https://github.com/greymass/eosio-signing-request",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "lib/esr.js",
|
"main": "lib/signing-request.js",
|
||||||
"module": "lib/esr.m.js",
|
"module": "lib/signing-request.m.js",
|
||||||
"types": "lib/esr.d.ts",
|
"types": "lib/signing-request.d.ts",
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"files": [
|
"files": [
|
||||||
"src/*",
|
"src/*",
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
"prepare": "make"
|
"prepare": "make"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@greymass/eosio": "^0.6.0",
|
"@wharfkit/antelope": "^1.0.0",
|
||||||
"tslib": "^2.0.3"
|
"tslib": "^2.0.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ import {
|
|||||||
TypeAlias,
|
TypeAlias,
|
||||||
UInt8,
|
UInt8,
|
||||||
Variant,
|
Variant,
|
||||||
} from '@greymass/eosio'
|
} from '@wharfkit/antelope'
|
||||||
|
|
||||||
import {ChainIdVariant} from './chain-id'
|
import {ChainIdVariant} from './chain-id'
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import {
|
|||||||
TypeAlias,
|
TypeAlias,
|
||||||
UInt8,
|
UInt8,
|
||||||
Variant,
|
Variant,
|
||||||
} from '@greymass/eosio'
|
} from '@wharfkit/antelope'
|
||||||
|
|
||||||
/** Chain ID aliases. */
|
/** Chain ID aliases. */
|
||||||
export enum ChainName {
|
export enum ChainName {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import {
|
|||||||
TimePointSec,
|
TimePointSec,
|
||||||
TimePointType,
|
TimePointType,
|
||||||
Transaction,
|
Transaction,
|
||||||
} from '@greymass/eosio'
|
} from '@wharfkit/antelope'
|
||||||
|
|
||||||
import {IdentityV3} from './abi'
|
import {IdentityV3} from './abi'
|
||||||
import {ChainId, ChainIdType} from './chain-id'
|
import {ChainId, ChainIdType} from './chain-id'
|
||||||
|
|||||||
+26
-18
@@ -33,7 +33,7 @@ import {
|
|||||||
UInt32Type,
|
UInt32Type,
|
||||||
UInt8,
|
UInt8,
|
||||||
VarUInt,
|
VarUInt,
|
||||||
} from '@greymass/eosio'
|
} from '@wharfkit/antelope'
|
||||||
|
|
||||||
import * as base64u from './base64u'
|
import * as base64u from './base64u'
|
||||||
import {ChainAlias, ChainId, ChainIdType, ChainIdVariant, ChainName} from './chain-id'
|
import {ChainAlias, ChainId, ChainIdType, ChainIdVariant, ChainName} from './chain-id'
|
||||||
@@ -936,14 +936,16 @@ export class SigningRequest {
|
|||||||
data = Serializer.encode({object: id})
|
data = Serializer.encode({object: id})
|
||||||
authorization = [id.permission]
|
authorization = [id.permission]
|
||||||
}
|
}
|
||||||
return [
|
const action = Action.from({
|
||||||
Action.from({
|
account: '',
|
||||||
account: '',
|
name: 'identity',
|
||||||
name: 'identity',
|
authorization,
|
||||||
authorization,
|
data,
|
||||||
data,
|
})
|
||||||
}),
|
// TODO: The way payloads are encoded is including the ABI, which isn't what we want
|
||||||
]
|
// This needs to be resolved in wharfkit/antelope, and then the delete call here should be removed
|
||||||
|
delete action.abi
|
||||||
|
return [action]
|
||||||
} else {
|
} else {
|
||||||
// eslint-disable-next-line prefer-const
|
// eslint-disable-next-line prefer-const
|
||||||
let {scope, permission} = req.value as IdentityV3
|
let {scope, permission} = req.value as IdentityV3
|
||||||
@@ -951,14 +953,16 @@ export class SigningRequest {
|
|||||||
permission = PlaceholderAuth
|
permission = PlaceholderAuth
|
||||||
}
|
}
|
||||||
const data = Serializer.encode({object: {scope, permission}, type: IdentityV3})
|
const data = Serializer.encode({object: {scope, permission}, type: IdentityV3})
|
||||||
return [
|
const action = Action.from({
|
||||||
Action.from({
|
account: '',
|
||||||
account: '',
|
name: 'identity',
|
||||||
name: 'identity',
|
authorization: [permission],
|
||||||
authorization: [permission],
|
data,
|
||||||
data,
|
})
|
||||||
}),
|
// TODO: The way payloads are encoded is including the ABI, which isn't what we want
|
||||||
]
|
// This needs to be resolved in wharfkit/antelope, and then the delete call here should be removed
|
||||||
|
delete action.abi
|
||||||
|
return [action]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case 'transaction':
|
case 'transaction':
|
||||||
@@ -1246,7 +1250,11 @@ function encodeAction(action: AnyAction, abis: Record<string, ABIDef>): Action {
|
|||||||
if (!abi) {
|
if (!abi) {
|
||||||
throw new Error(`Missing ABI for ${action.account}`)
|
throw new Error(`Missing ABI for ${action.account}`)
|
||||||
}
|
}
|
||||||
return Action.from(action, abi)
|
const data = Action.from(action, abi)
|
||||||
|
// TODO: The way payloads are encoded is including the ABI, which isn't what we want
|
||||||
|
// This needs to be resolved in wharfkit/antelope, and then the delete call here should be removed
|
||||||
|
delete data.abi
|
||||||
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
function isIdentity(action: AnyAction) {
|
function isIdentity(action: AnyAction) {
|
||||||
|
|||||||
+1
-1
@@ -12,7 +12,7 @@ import {
|
|||||||
SigningRequestEncodingOptions,
|
SigningRequestEncodingOptions,
|
||||||
} from '../src'
|
} from '../src'
|
||||||
import * as TSModule from '../src'
|
import * as TSModule from '../src'
|
||||||
import {Name, PrivateKey, Serializer, Signature, UInt64} from '@greymass/eosio'
|
import {Name, PrivateKey, Serializer, Signature, UInt64} from '@wharfkit/antelope'
|
||||||
import {IdentityProof} from '../src/identity-proof'
|
import {IdentityProof} from '../src/identity-proof'
|
||||||
|
|
||||||
let {SigningRequest, PlaceholderAuth, PlaceholderName} = TSModule
|
let {SigningRequest, PlaceholderAuth, PlaceholderName} = TSModule
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {readdirSync as readdir, readFileSync as readfile} from 'fs'
|
import {readdirSync as readdir, readFileSync as readfile} from 'fs'
|
||||||
import {join as joinPath} from 'path'
|
import {join as joinPath} from 'path'
|
||||||
import {AbiProvider} from '../../src'
|
import {AbiProvider} from '../../src'
|
||||||
import {Name} from '@greymass/eosio'
|
import {Name} from '@wharfkit/antelope'
|
||||||
|
|
||||||
// To add an ABI for testing run (in project root):
|
// To add an ABI for testing run (in project root):
|
||||||
// CONTRACT=eosio.token; cleos -u https://eos.greymass.com get abi $CONTRACT > test/abis/$CONTRACT.json
|
// CONTRACT=eosio.token; cleos -u https://eos.greymass.com get abi $CONTRACT > test/abis/$CONTRACT.json
|
||||||
|
|||||||
@@ -212,17 +212,6 @@
|
|||||||
minimatch "^3.0.4"
|
minimatch "^3.0.4"
|
||||||
strip-json-comments "^3.1.1"
|
strip-json-comments "^3.1.1"
|
||||||
|
|
||||||
"@greymass/eosio@^0.6.0":
|
|
||||||
version "0.6.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@greymass/eosio/-/eosio-0.6.1.tgz#2af601b6f38a37cb3c78b62d80fd293b80814f62"
|
|
||||||
integrity sha512-K9VmejZmXHczuLBdQzEQayzISEG/s1PQ9awNf3nMeiVOnmjC5jnw/qNatY1PDpVhXsu+FcW59EAoCEWpuKnrfA==
|
|
||||||
dependencies:
|
|
||||||
bn.js "^4.11.9"
|
|
||||||
brorand "^1.1.0"
|
|
||||||
elliptic "^6.5.4"
|
|
||||||
hash.js "^1.0.0"
|
|
||||||
tslib "^2.0.3"
|
|
||||||
|
|
||||||
"@humanwhocodes/config-array@^0.9.2":
|
"@humanwhocodes/config-array@^0.9.2":
|
||||||
version "0.9.5"
|
version "0.9.5"
|
||||||
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.5.tgz#2cbaf9a89460da24b5ca6531b8bbfc23e1df50c7"
|
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.9.5.tgz#2cbaf9a89460da24b5ca6531b8bbfc23e1df50c7"
|
||||||
@@ -459,6 +448,18 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44"
|
resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44"
|
||||||
integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==
|
integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==
|
||||||
|
|
||||||
|
"@wharfkit/antelope@^1.0.0":
|
||||||
|
version "1.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@wharfkit/antelope/-/antelope-1.0.0.tgz#c3057b70575991be5de3aea19e0c474614783c80"
|
||||||
|
integrity sha512-gwc6L3AzceN/menx9HCV22Ekd3it1wRruY6dIkyfCaV2UBGmfvIVJ3wPaDi4Ppj2k50b86ShSSHdd52jOFd+dg==
|
||||||
|
dependencies:
|
||||||
|
bn.js "^4.11.9"
|
||||||
|
brorand "^1.1.0"
|
||||||
|
elliptic "^6.5.4"
|
||||||
|
hash.js "^1.0.0"
|
||||||
|
pako "^2.1.0"
|
||||||
|
tslib "^2.0.3"
|
||||||
|
|
||||||
acorn-jsx@^5.3.1:
|
acorn-jsx@^5.3.1:
|
||||||
version "5.3.2"
|
version "5.3.2"
|
||||||
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
|
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
|
||||||
@@ -1750,6 +1751,11 @@ package-hash@^4.0.0:
|
|||||||
lodash.flattendeep "^4.4.0"
|
lodash.flattendeep "^4.4.0"
|
||||||
release-zalgo "^1.0.0"
|
release-zalgo "^1.0.0"
|
||||||
|
|
||||||
|
pako@^2.1.0:
|
||||||
|
version "2.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86"
|
||||||
|
integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==
|
||||||
|
|
||||||
parent-module@^1.0.0:
|
parent-module@^1.0.0:
|
||||||
version "1.0.1"
|
version "1.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2"
|
resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2"
|
||||||
|
|||||||
Reference in New Issue
Block a user