Skip to content

Commit 95c9f5a

Browse files
committed
fix(sdk-coin-fetchai): change asset name from fetch to fetchai
TICKET: COIN-4128 BREAKING CHANGE: Changing module/asset name from fetch to fetchai
1 parent 57cf6f9 commit 95c9f5a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+99
-99
lines changed

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
/modules/sdk-coin-cspr/ @BitGo/ethalt-team
6262
/modules/sdk-coin-dot/ @BitGo/ethalt-team
6363
/modules/sdk-coin-eos/ @BitGo/ethalt-team
64-
/modules/sdk-coin-fetch/ @BitGo/ethalt-team
64+
/modules/sdk-coin-fetchai/ @BitGo/ethalt-team
6565
/modules/sdk-coin-flr/ @BitGo/ethalt-team
6666
/modules/sdk-coin-ethlike/ @BitGo/ethalt-team
6767
/modules/sdk-coin-hbar/ @BitGo/ethalt-team

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ COPY --from=builder /tmp/bitgo/modules/sdk-coin-cronos /var/modules/sdk-coin-cro
7676
COPY --from=builder /tmp/bitgo/modules/sdk-coin-cspr /var/modules/sdk-coin-cspr/
7777
COPY --from=builder /tmp/bitgo/modules/sdk-coin-dot /var/modules/sdk-coin-dot/
7878
COPY --from=builder /tmp/bitgo/modules/sdk-coin-etc /var/modules/sdk-coin-etc/
79-
COPY --from=builder /tmp/bitgo/modules/sdk-coin-fetch /var/modules/sdk-coin-fetch/
79+
COPY --from=builder /tmp/bitgo/modules/sdk-coin-fetchai /var/modules/sdk-coin-fetchai/
8080
COPY --from=builder /tmp/bitgo/modules/sdk-coin-flr /var/modules/sdk-coin-flr/
8181
COPY --from=builder /tmp/bitgo/modules/sdk-coin-hash /var/modules/sdk-coin-hash/
8282
COPY --from=builder /tmp/bitgo/modules/sdk-coin-hbar /var/modules/sdk-coin-hbar/
@@ -168,7 +168,7 @@ cd /var/modules/sdk-coin-cronos && yarn link && \
168168
cd /var/modules/sdk-coin-cspr && yarn link && \
169169
cd /var/modules/sdk-coin-dot && yarn link && \
170170
cd /var/modules/sdk-coin-etc && yarn link && \
171-
cd /var/modules/sdk-coin-fetch && yarn link && \
171+
cd /var/modules/sdk-coin-fetchai && yarn link && \
172172
cd /var/modules/sdk-coin-flr && yarn link && \
173173
cd /var/modules/sdk-coin-hash && yarn link && \
174174
cd /var/modules/sdk-coin-hbar && yarn link && \
@@ -263,7 +263,7 @@ RUN cd /var/bitgo-express && \
263263
yarn link @bitgo/sdk-coin-cspr && \
264264
yarn link @bitgo/sdk-coin-dot && \
265265
yarn link @bitgo/sdk-coin-etc && \
266-
yarn link @bitgo/sdk-coin-fetch && \
266+
yarn link @bitgo/sdk-coin-fetchai && \
267267
yarn link @bitgo/sdk-coin-flr && \
268268
yarn link @bitgo/sdk-coin-hash && \
269269
yarn link @bitgo/sdk-coin-hbar && \

modules/account-lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"@bitgo/sdk-coin-dot": "^4.1.57",
4646
"@bitgo/sdk-coin-etc": "^2.2.46",
4747
"@bitgo/sdk-coin-eth": "^24.4.2",
48-
"@bitgo/sdk-coin-fetch": "^1.1.0",
48+
"@bitgo/sdk-coin-fetchai": "^1.1.0",
4949
"@bitgo/sdk-coin-flr": "^1.2.3",
5050
"@bitgo/sdk-coin-hash": "^3.0.48",
5151
"@bitgo/sdk-coin-hbar": "^2.0.79",

modules/account-lib/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ export { Mantra };
113113
import * as Cronos from '@bitgo/sdk-coin-cronos';
114114
export { Cronos };
115115

116-
import * as Fetch from '@bitgo/sdk-coin-fetch';
117-
export { Fetch };
116+
import * as FetchAi from '@bitgo/sdk-coin-fetchai';
117+
export { FetchAi };
118118

119119
import * as Initia from '@bitgo/sdk-coin-initia';
120120
export { Initia };
@@ -272,8 +272,8 @@ const coinBuilderMap = {
272272
tbaby: Baby.TransactionBuilder,
273273
cronos: Cronos.TransactionBuilder,
274274
tcronos: Cronos.TransactionBuilder,
275-
fetch: Fetch.TransactionBuilder,
276-
tfetch: Fetch.TransactionBuilder,
275+
fetchai: FetchAi.TransactionBuilder,
276+
tfetchai: FetchAi.TransactionBuilder,
277277
initia: Initia.TransactionBuilder,
278278
tinitia: Initia.TransactionBuilder,
279279
flr: Flr.TransactionBuilder,

modules/bitgo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"@bitgo/sdk-coin-eth": "^24.4.2",
7979
"@bitgo/sdk-coin-ethlike": "^1.2.14",
8080
"@bitgo/sdk-coin-ethw": "^20.0.79",
81-
"@bitgo/sdk-coin-fetch": "^1.1.0",
81+
"@bitgo/sdk-coin-fetchai": "^1.1.0",
8282
"@bitgo/sdk-coin-flr": "^1.2.3",
8383
"@bitgo/sdk-coin-hash": "^3.0.48",
8484
"@bitgo/sdk-coin-hbar": "^2.0.79",

modules/bitgo/src/v2/coinFactory.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ import {
4848
Eth,
4949
Ethw,
5050
EthLikeCoin,
51-
Fetch,
51+
FetchAi,
5252
Flr,
5353
TethLikeCoin,
5454
FiatAED,
@@ -121,7 +121,7 @@ import {
121121
Teos,
122122
Tetc,
123123
Teth,
124-
Tfetch,
124+
TfetchAi,
125125
Tflr,
126126
Tmon,
127127
TfiatAED,
@@ -217,7 +217,7 @@ export function registerCoinConstructors(coinFactory: CoinFactory, coinMap: Coin
217217
coinFactory.register('fiatgbp', FiatGBP.createInstance);
218218
coinFactory.register('fiatsgd', FiatSGD.createInstance);
219219
coinFactory.register('fiatusd', FiatUsd.createInstance);
220-
coinFactory.register('fetch', Fetch.createInstance);
220+
coinFactory.register('fetchai', FetchAi.createInstance);
221221
coinFactory.register('flr', Flr.createInstance);
222222
coinFactory.register('gteth', Gteth.createInstance);
223223
coinFactory.register('hash', Hash.createInstance);
@@ -285,7 +285,7 @@ export function registerCoinConstructors(coinFactory: CoinFactory, coinMap: Coin
285285
coinFactory.register('tfiatgbp', TfiatGBP.createInstance);
286286
coinFactory.register('tfiatsgd', TfiatSGD.createInstance);
287287
coinFactory.register('tfiatusd', TfiatUsd.createInstance);
288-
coinFactory.register('tfetch', Tfetch.createInstance);
288+
coinFactory.register('tfetchai', TfetchAi.createInstance);
289289
coinFactory.register('tflr', Tflr.createInstance);
290290
coinFactory.register('tmon', Tmon.createInstance);
291291
coinFactory.register('thash', Thash.createInstance);

modules/bitgo/src/v2/coins/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { Dot, Tdot } from '@bitgo/sdk-coin-dot';
2727
import { Eos, EosToken, Teos } from '@bitgo/sdk-coin-eos';
2828
import { Etc, Tetc } from '@bitgo/sdk-coin-etc';
2929
import { Erc20Token, Eth, Gteth, Hteth, Teth } from '@bitgo/sdk-coin-eth';
30-
import { Fetch, Tfetch } from '@bitgo/sdk-coin-fetch';
30+
import { FetchAi, TfetchAi } from '@bitgo/sdk-coin-fetchai';
3131
import { Flr, Tflr } from '@bitgo/sdk-coin-flr';
3232
import { Ethw } from '@bitgo/sdk-coin-ethw';
3333
import { EthLikeCoin, TethLikeCoin } from '@bitgo/sdk-coin-ethlike';
@@ -99,7 +99,7 @@ export { Erc20Token, Eth, Gteth, Hteth, Teth };
9999
export { Ethw };
100100
export { EthLikeCoin, TethLikeCoin };
101101
export { Etc, Tetc };
102-
export { Fetch, Tfetch };
102+
export { FetchAi, TfetchAi };
103103
export { Flr, Tflr };
104104
export { Hash, Thash };
105105
export { Hbar, Thbar };

modules/bitgo/test/v2/unit/keychains.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ describe('V2 Keychains', function () {
8282
n.asset !== UnderlyingAsset.SONEIUM &&
8383
n.asset !== UnderlyingAsset.VET &&
8484
n.asset !== UnderlyingAsset.CRONOS &&
85-
n.asset !== UnderlyingAsset.FETCH &&
85+
n.asset !== UnderlyingAsset.FETCHAI &&
8686
n.asset !== UnderlyingAsset.INITIA &&
8787
coinFamilyValues.includes(n.name)
8888
);

modules/bitgo/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
"path": "../sdk-coin-ethw"
148148
},
149149
{
150-
"path": "../sdk-coin-fetch"
150+
"path": "../sdk-coin-fetchai"
151151
},
152152
{
153153
"path": "../sdk-coin-flr"

modules/sdk-coin-fetch/src/index.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

modules/sdk-coin-fetch/src/register.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

modules/sdk-coin-fetch/README.md renamed to modules/sdk-coin-fetchai/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
# BitGo sdk-coin-fetch
1+
# BitGo sdk-coin-fetchai
22

33
SDK coins provide a modular approach to a monolithic architecture. This and all BitGoJS SDK coins allow developers to use only the coins needed for a given project.
44

55
## Installation
66

77
All coins are loaded traditionally through the `bitgo` package. If you are using coins individually, you will be accessing the coin via the `@bitgo/sdk-api` package.
88

9-
In your project install both `@bitgo/sdk-api` and `@bitgo/sdk-coin-fetch`.
9+
In your project install both `@bitgo/sdk-api` and `@bitgo/sdk-coin-fetchai`.
1010

1111
```shell
12-
npm i @bitgo/sdk-api @bitgo/sdk-coin-fetch
12+
npm i @bitgo/sdk-api @bitgo/sdk-coin-fetchai
1313
```
1414

1515
Next, you will be able to initialize an instance of "bitgo" through `@bitgo/sdk-api` instead of `bitgo`.
1616

1717
```javascript
1818
import { BitGoAPI } from '@bitgo/sdk-api';
19-
import { Fetch } from '@bitgo/sdk-coin-fetch';
19+
import { FetchAi } from '@bitgo/sdk-coin-fetchai';
2020

2121
const sdk = new BitGoAPI();
2222

23-
sdk.register('fetch', Fetch.createInstance);
23+
sdk.register('fetchai', FetchAi.createInstance);
2424
```
2525

2626
## Development

modules/sdk-coin-fetch/package.json renamed to modules/sdk-coin-fetchai/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "@bitgo/sdk-coin-fetch",
2+
"name": "@bitgo/sdk-coin-fetchai",
33
"version": "1.1.0",
4-
"description": "BitGo SDK coin library for Fetch",
4+
"description": "BitGo SDK coin library for Fetch.ai",
55
"main": "./dist/src/index.js",
66
"types": "./dist/src/index.d.ts",
77
"scripts": {
@@ -23,7 +23,7 @@
2323
"repository": {
2424
"type": "git",
2525
"url": "https://github.com/BitGo/BitGoJS.git",
26-
"directory": "modules/sdk-coin-fetch"
26+
"directory": "modules/sdk-coin-fetchai"
2727
},
2828
"lint-staged": {
2929
"*.{js,ts}": [

modules/sdk-coin-fetch/src/fetch.ts renamed to modules/sdk-coin-fetchai/src/fetchai.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import utils from './lib/utils';
1212
* Docs: https://website.prod.fetch-ai.com/docs/
1313
* GitHub : https://github.com/fetchai
1414
*/
15-
export class Fetch extends CosmosCoin {
15+
export class FetchAi extends CosmosCoin {
1616
protected readonly _staticsCoin: Readonly<StaticsBaseCoin>;
1717

1818
protected constructor(bitgo: BitGoBase, staticsCoin?: Readonly<StaticsBaseCoin>) {
@@ -26,7 +26,7 @@ export class Fetch extends CosmosCoin {
2626
}
2727

2828
static createInstance(bitgo: BitGoBase, staticsCoin?: Readonly<StaticsBaseCoin>): BaseCoin {
29-
return new Fetch(bitgo, staticsCoin);
29+
return new FetchAi(bitgo, staticsCoin);
3030
}
3131

3232
/** @inheritDoc **/
@@ -46,7 +46,7 @@ export class Fetch extends CosmosCoin {
4646

4747
/** @inheritDoc **/
4848
getDenomination(): string {
49-
return BaseUnit.FETCH;
49+
return BaseUnit.FETCHAI;
5050
}
5151

5252
/** @inheritDoc **/
@@ -64,7 +64,7 @@ export class Fetch extends CosmosCoin {
6464

6565
/** @inheritDoc **/
6666
protected getPublicNodeUrl(): string {
67-
return Environments[this.bitgo.getEnv()].fetchNodeUrl;
67+
return Environments[this.bitgo.getEnv()].fetchAiNodeUrl;
6868
}
6969

7070
/** @inheritDoc **/

modules/sdk-coin-fetchai/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export * from './lib';
2+
export * from './register';
3+
export * from './fetchai';
4+
export * from './tfetchai';

modules/sdk-coin-fetch/src/lib/keyPair.ts renamed to modules/sdk-coin-fetchai/src/lib/keyPair.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { CosmosKeyPair } from '@bitgo/abstract-cosmos';
44
import { ADDRESS_PREFIX } from './constants';
55

66
/**
7-
* Fetch keys and address management.
7+
* Fetch.ai keys and address management.
88
*/
99
export class KeyPair extends CosmosKeyPair {
1010
constructor(source?: KeyPairOptions) {
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { BitGoBase } from '@bitgo/sdk-core';
2+
import { FetchAi } from './fetchai';
3+
import { TfetchAi } from './tfetchai';
4+
5+
export const register = (sdk: BitGoBase): void => {
6+
sdk.register('fetchai', FetchAi.createInstance);
7+
sdk.register('tfetchai', TfetchAi.createInstance);
8+
};

modules/sdk-coin-fetch/src/tfetch.ts renamed to modules/sdk-coin-fetchai/src/tfetchai.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { BaseCoin, BitGoBase } from '@bitgo/sdk-core';
22
import { BaseCoin as StaticsBaseCoin } from '@bitgo/statics';
3-
import { Fetch } from './fetch';
3+
import { FetchAi } from './fetchai';
44

5-
export class Tfetch extends Fetch {
5+
export class TfetchAi extends FetchAi {
66
protected readonly _staticsCoin: Readonly<StaticsBaseCoin>;
77
protected constructor(bitgo: BitGoBase, staticsCoin?: Readonly<StaticsBaseCoin>) {
88
super(bitgo, staticsCoin);
@@ -15,6 +15,6 @@ export class Tfetch extends Fetch {
1515
}
1616

1717
static createInstance(bitgo: BitGoBase, staticsCoin?: Readonly<StaticsBaseCoin>): BaseCoin {
18-
return new Tfetch(bitgo, staticsCoin);
18+
return new TfetchAi(bitgo, staticsCoin);
1919
}
2020
}

modules/sdk-coin-fetch/test/unit/fetch.ts renamed to modules/sdk-coin-fetchai/test/unit/fetchai.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@ import BigNumber from 'bignumber.js';
33
import sinon from 'sinon';
44
import { TestBitGo, TestBitGoAPI } from '@bitgo/sdk-test';
55
import { BitGoAPI } from '@bitgo/sdk-api';
6-
import { Fetch, Tfetch } from '../../src/index';
6+
import { FetchAi, TfetchAi } from '../../src/index';
77
import utils from '../../src/lib/utils';
8-
import { TEST_SEND_MANY_TX, TEST_SEND_TX, TEST_TX_WITH_MEMO, address, TEST_ACCOUNT } from '../resources/fetch';
8+
import { TEST_SEND_MANY_TX, TEST_SEND_TX, TEST_TX_WITH_MEMO, address, TEST_ACCOUNT } from '../resources/fetchai';
99

1010
const bitgo: TestBitGoAPI = TestBitGo.decorate(BitGoAPI, { env: 'test' });
11-
const coinString = 'fetch';
12-
const testCoinString = 'tfetch';
11+
const coinString = 'fetchai';
12+
const testCoinString = 'tfetchai';
1313
const coinFullName = 'Fetch';
1414
const testCoinFullName = 'Testnet Fetch';
1515
const baseFactor = 1e18;
16-
const coinInstance = Fetch.createInstance;
17-
const testCoinInstance = Tfetch.createInstance;
16+
const coinInstance = FetchAi.createInstance;
17+
const testCoinInstance = TfetchAi.createInstance;
1818
bitgo.safeRegister(testCoinString, testCoinInstance);
1919

20-
describe('Fetch', function () {
20+
describe('Fetch.ai', function () {
2121
let bitgo: TestBitGoAPI;
2222
let basecoin;
2323

@@ -30,18 +30,18 @@ describe('Fetch', function () {
3030
});
3131

3232
it('should return the right info', function () {
33-
const fetch = bitgo.coin(coinString);
34-
const tfetch = bitgo.coin(testCoinString);
33+
const fetchai = bitgo.coin(coinString);
34+
const tfetchai = bitgo.coin(testCoinString);
3535

36-
fetch.getChain().should.equal(coinString);
37-
fetch.getFamily().should.equal(coinString);
38-
fetch.getFullName().should.equal(coinFullName);
39-
fetch.getBaseFactor().should.equal(baseFactor);
36+
fetchai.getChain().should.equal(coinString);
37+
fetchai.getFamily().should.equal(coinString);
38+
fetchai.getFullName().should.equal(coinFullName);
39+
fetchai.getBaseFactor().should.equal(baseFactor);
4040

41-
tfetch.getChain().should.equal(testCoinString);
42-
tfetch.getFamily().should.equal(coinString);
43-
tfetch.getFullName().should.equal(testCoinFullName);
44-
tfetch.getBaseFactor().should.equal(baseFactor);
41+
tfetchai.getChain().should.equal(testCoinString);
42+
tfetchai.getFamily().should.equal(coinString);
43+
tfetchai.getFullName().should.equal(testCoinFullName);
44+
tfetchai.getBaseFactor().should.equal(baseFactor);
4545
});
4646

4747
describe('Address Validation', () => {
@@ -265,7 +265,7 @@ describe('Fetch', function () {
265265
});
266266

267267
it('should fail to parse a transfer transaction when explainTransaction response is undefined', async function () {
268-
const stub = sinon.stub(Fetch.prototype, 'explainTransaction');
268+
const stub = sinon.stub(FetchAi.prototype, 'explainTransaction');
269269
stub.resolves(undefined);
270270
await basecoin
271271
.parseTransaction({ txHex: TEST_SEND_TX.signedTxBase64 })

modules/sdk-coin-fetch/test/unit/keyPair.ts renamed to modules/sdk-coin-fetchai/test/unit/keyPair.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import assert from 'assert';
33
import should from 'should';
44

55
import { KeyPair } from '../../src';
6-
import { TEST_ACCOUNT, TEST_SEND_TX } from '../resources/fetch';
6+
import { TEST_ACCOUNT, TEST_SEND_TX } from '../resources/fetchai';
77

8-
describe('Fetch Key Pair', () => {
8+
describe('Fetch.ai Key Pair', () => {
99
describe('should create a valid KeyPair', () => {
1010
it('from an empty value', () => {
1111
const keyPairObj = new KeyPair();

modules/sdk-coin-fetch/test/unit/transaction.ts renamed to modules/sdk-coin-fetchai/test/unit/transaction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ import { fromBase64 } from '@cosmjs/encoding';
55
import should from 'should';
66
import { Transaction } from '../../src';
77
import utils from '../../src/lib/utils';
8-
import * as testData from '../resources/fetch';
8+
import * as testData from '../resources/fetchai';
99

10-
describe('Fetch Transaction', () => {
10+
describe('Fetch.ai Transaction', () => {
1111
let tx: Transaction;
12-
const testCoinString = 'tfetch';
12+
const testCoinString = 'tfetchai';
1313
const config = coins.get(testCoinString);
1414

1515
beforeEach(() => {

modules/sdk-coin-fetch/test/unit/transactionBuilder/transactionBuilder.ts renamed to modules/sdk-coin-fetchai/test/unit/transactionBuilder/transactionBuilder.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { TransactionType } from '@bitgo/sdk-core';
22
import should from 'should';
33

4-
import * as testData from '../../resources/fetch';
4+
import * as testData from '../../resources/fetchai';
55
import { getBuilderFactory } from '../getBuilderFactory';
66

7-
describe('Fetch Transaction Builder', async () => {
8-
const testCoinString = 'tfetch';
7+
describe('Fetch.ai Transaction Builder', async () => {
8+
const testCoinString = 'tfetchai';
99
const factory = getBuilderFactory(testCoinString);
1010
const testTxData = testData.TEST_SEND_TX;
1111
let data;

0 commit comments

Comments
 (0)